Refactor entry handling: update date format, enhance entry retrieval, and improve HTML structure
This commit is contained in:
1 parent
ff2afb4441
commit
fd1b8d9a0b
7 files changed
+15
-7
No files matched your search
+3
-2
@@ -19,10 +19,11 @@ $url = "http://" . APP_DOMAIN . "/api/entrys/get.php";
|
||||
$response = file_get_contents($url);
|
||||
|
||||
$response = json_decode($response, true);
|
||||
|
||||
if ($response["data"]["empty"]) {
|
||||
$html_block = "<p>There aren'n any entrys yet. Be the first one!</p>";
|
||||
}else{
|
||||
$entrys = $response["data"]["entrys"];
|
||||
$entrys = json_decode($response["data"]["entrys"], true);
|
||||
|
||||
$html_block = "";
|
||||
foreach($entrys as $entry) {
|
||||
@@ -32,7 +33,7 @@ if ($response["data"]["empty"]) {
|
||||
|
||||
$html_block .= '
|
||||
<div class="entry">
|
||||
<h3>' . $name . '</h3>
|
||||
<h3 class="md-typescale-display-small">' . $name . '</h3>
|
||||
<p id="date">' . $date . '</p>
|
||||
<p>' . $text . '</p>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user