function display_entries() { global $GB_PG, $ModName; include_once LAZ_INCLUDE_PATH . '/lib/gb.class.php'; $gb = new guestbook(LAZ_INCLUDE_PATH); $GB_PG['base_url'] = $gb->db->VARS['base_url']; $GB_PG['index'] = $gb->db->VARS['laz_url'] . '&op=modload&file=index'; $GB_PG['admin'] = $gb->db->VARS['base_url'] . '/admin.php'; $GB_PG['comment'] = $gb->db->VARS['laz_url'] . '&op=modload&file=index&agbook=comment'; $GB_PG['addentry'] = $gb->db->VARS['laz_url'] . '&op=modload&file=index&agbook=addentry'; $entry = isset($_GET['entry']) ? $_GET['entry'] : 0; $entry = isset($_POST['entry']) ? $_POST['entry'] : $entry; $entry = intval($entry) < 0 ? 0 : intval($entry); $gb->searchfield = isset($_GET['searchfield']) ? trim($_GET['searchfield']) : ''; $gb->searchtext = isset($_GET['searchtext']) ? trim(urldecode($_GET['searchtext'])) : ''; $gb->searchfield = isset($_POST['searchfield']) ? trim($_POST['searchfield']) : $gb->searchfield; $gb->searchtext = isset($_POST['searchtext']) ? trim(urldecode($_POST['searchtext'])) : $gb->searchtext; echo $gb->show_entries($entry); $gb->db->close_db(); }
$gb_post->preview = isset($_POST["gb_preview"]) ? 1 : 0; $gb_post->private = isset($_POST["gb_private"]) ? 1 : 0; $gb_post->token = isset($_POST["gb_token"]) ? $_POST["gb_token"] : ''; $gb_post->gb_captcha = isset($_POST["gb_captcha"]) ? $_POST["gb_captcha"] : ''; echo $gb_post->process($_POST["gb_action"]); } else { echo $gb_post->process(); } $gb_post->db->close_db(); break; default: require_once $include_path . "/lib/vars.class.php"; require_once $include_path . "/lib/gb.class.php"; $gb = new guestbook($include_path); $entry = isset($_GET["entry"]) ? $_GET["entry"] : 0; $entry = isset($_POST["entry"]) ? $_POST["entry"] : $entry; echo $gb->show_entries(intval($entry)); $gb->db->close_db(); } ob_end_flush(); $base_path = dirname(dirname($include_path)); chdir("{$base_path}"); include "{$base_path}/footer.php"; } else { require_once $include_path . "/lib/vars.class.php"; require_once $include_path . "/lib/gb.class.php"; $gb = new guestbook($include_path); $entry = isset($_GET["entry"]) ? $_GET["entry"] : 0; $entry = isset($_POST["entry"]) ? $_POST["entry"] : $entry; echo $gb->show_entries(intval($entry)); }