$_page['extra_js'] = $oTemplConfig->sTinyMceEditorJS; $period = 1; // time period before user can add another record (in minutes) $records_on_page = 16; // number of records at the page $record_maxlength = 1600; // max length of record $record_limit = 100; // maximum number of records in the guest book $_page['header'] = _t("_guestbook"); /* $_page['header_text'] = ('g4' != $tmpl) ? _t("_guestbook") : "<img src=\"{$site['images']}guestbook.gif\">"; */ $_page['header_text'] = _t("_guestbook"); // --------------- page components //$w_ex = 20; $_ni = $_page['name_index']; $_page_cont[$_ni]['page_main_code'] = ThisPageMainCode(); // --------------- [END] page components PageCode(); // --------------- page components functions /** * page code function */ function ThisPageMainCode() { global $logged; $ret = ""; $member['ID'] = (int) $_COOKIE['memberID']; $owner = $_REQUEST['owner'] ? (int) $_REQUEST['owner'] : (int) $_COOKIE['memberID']; // Check if membership allows this action $check_res = checkAction($member['ID'], ACTION_ID_VIEW_GUESTBOOK); if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$logged['admin'] && $member['ID'] != $owner) {
db_res("DELETE FROM `shoutbox` WHERE `date` = '{$oldest_date['date']}'"); } // Select last class $last_class = db_arr("SELECT `class` FROM `shoutbox` ORDER BY `date` DESC LIMIT 1"); if (($cn = substr($last_class['class'], -1)) >= $oTemplConfig->classes) { $cn = $class_name . '1'; } else { $cn = $class_name . ($cn + 1); } // Insert to database $query = "INSERT INTO `shoutbox` VALUES ('{$id}', '{$text}', NOW(), '{$cn}')"; db_res($query); } } echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\r\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-US\" lang=\"en-US\">\r\n\t\t<head>\r\n\t\t<title></title>\r\n\t\t<meta http-equiv=\"Refresh\" content=\"60\" />\r\n\t\t<link href=\"templates/tmpl_" . $tmpl . "/css/shoutbox.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n\t\t<link href=\"templates/tmpl_" . $tmpl . "/css/anchor.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$langHTMLCharset}\" />\r\n\t</head>\r\n\t<body>\n"; echo ThisPageMainCode(); echo "\r\n\t</body>\r\n</html>\n"; // --------------- page components functions /** * page code function */ function ThisPageMainCode() { global $site; global $oTemplConfig; global $logged; global $tmpl; global $date_format; $content = "\r\n \t<form name=\"shoutbox\" method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "\">\r\n \t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n \t\t\t<tr><td>\r\n \t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">"; $class = 'shoutbg1'; // Print input box