Files
better_guestbook/public/index.php
T

37 lines
725 B
PHP
Executable File

<?php
// Debug setting
$debug = true;
// Load GB Libary
require "main.php";
// Init GB Class
$gb = new gb(true);
// Load HTMLLoader Library
require FRONTEND_PATH . "html_loader.php";
$htmlLoader = new HTMLLoader();
// Build Entry Page
$htmlLoader->setTemplate("entrys_frontend");
$url = "http://" . APP_DOMAIN . "/api/entrys/get.php";
$response = file_get_contents($url);
$entrys = json_decode($response, true);
$entrys = $entrys["entrys"];
$html_block = "";
foreach($entrys as $entry) {
$name = $entry["name"];
$text = $entry["text"];
$html_block .= '
<div class="entry">
<h3>' . $name . '</h3>
<p>' . $text . '</p>
</div>
';
}
$htmlLoader->show(["%entrys%" => $html_block]);