<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: guestbook.php,v 1.8.2.8 2004/04/18 20:15:19 ajvwaay Exp $




######################################################################
# Guestbook 1.0
# =============
#
# Copyright (C) 2001 by Heinrich Steenberg (kodewulf@myrealbox.com)
# http://www.kodewulf.za.net
#
# Based on code found in PHP-Nuke Add-On
# Copyright (c) 2000 by Richard Tirtadji AKA King Richard (rtirtadji@hotmail.com)
#                       Hutdik Hermawan AKA hotFix (hutdik76@hotmail.com)
# http://www.phpnuke.web.id
#
######################################################################
# This program is free software. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License.
######################################################################

// 2001-03-03 hombergs: Changed showGuestbook. Make the change from wander.
// 2001-03-03 hombergs: Insertion of missing translate calls.

@( include_once __ROOT__ . 'core_ForumEntry.php' )
  OR goBack( translate( 'Include Error' ) );

( include_once __ROOT__ . 'module.guestbook.php' )
  OR goBack( translate( 'Include Error' ) );

if (isset($cancel)) { $_SERVER['F_LIB'] -> redirectRequest( 'guestbook.php' ); }

if ((!isset($guests_per_page)) || ($guests_per_page == 0) || ($guests_per_page == "")) { $guests_per_page = 10; }

$forum_images_path = "images/forum";
$guests_images_subject = $forum_images_path . "/subject";
$guests_images_icons = $forum_images_path . "/icons";
$guests_images_smilies = $forum_images_path . "/smilies";


// Set BBEncoder Variables

// Allow / Disallow HTML Tags, Strip tags and content if FALSE

if ( $guest_allow_html !== 1 ) { $_SERVER['SAN'] -> allow_html = (bool)FALSE; }

// Allow / Disallow BBCode Tags, Strip tags and content if FALSE

if ( $guest_allow_bbcode !== 1 ) { $_SERVER['SAN'] -> allow_bbcode = (bool)FALSE; }

// Enable / Disable Smiles

if ( $guest_allow_smilies !== 1 ) { $_SERVER['SAN'] -> encode_smileys = (bool)FALSE; }

$gacc = new Guestbook;

include("header.$phpEx");

echo "<h1>$sitename " . translate( 'Guestbook' ) . "</h1>\n";
echo "<br />\n";

OpenTable();

if (!isset($op))
{
    $op = null;
}

switch($op) {
    case "addguest":
        $gacc->showInterface();
        break;
    case "editguest":
        $gacc->showInterface();
        break;
    case "saveguest":
        $gacc->save();
        break;
    case "delguest":
        $gacc->delete();
        break;
    default:
        $gacc->show();
        break;
}

CloseTable();
include("footer.$phpEx");

?>
