Diff
checker
Testo
Testo
Immagini
Documenti
Excel
Cartelle
Legal
Enterprise
Applicazione per desktop
Prezzi
Accedi
Scarica Diffchecker Desktop
Confronta il testo
Trova la differenza tra due file di testo
Strumenti
Cronologia
Visualizzazione
Layout
Diviso
Unificato
Editor live
Nascondi spazi bianchi
Comprimi invariate
Senza a capo
Livello di dettaglio
Intelligente
Sintassi
Nessuno
Modifica aspetto
Elaborazione
Ignora
Trasforma testo
Vai alla prima modifica
Modifica input
Diffchecker Desktop
Il modo più sicuro per usare Diffchecker. Ottieni l'app Diffchecker Desktop: i tuoi diff non lasciano mai il tuo computer!
Ottieni Desktop
index.php
Creato
3 anni fa
Il diff non scade mai
Eliminare
Esporta
Condividere
Spiegare
48 rimozioni
Linee
Totale
Rimosso
Caratteri
Totale
Rimosso
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
461 linee
Copia tutti
60 aggiunte
Linee
Totale
Aggiunto
Caratteri
Totale
Aggiunto
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
462 linee
Copia tutti
<?php
<?php
/*=======================================================================
/*=======================================================================
Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
=======================================================================*/
=======================================================================*/
// ==========================================
// ==========================================
// PHP-NUKE: Shout Box
// PHP-NUKE: Shout Box
// ==========================
// ==========================
//
//
// Copyright (c) 2003-2005 by Aric Bolf (SuperCat)
// Copyright (c) 2003-2005 by Aric Bolf (SuperCat)
// http://www.OurScripts.net
// http://www.OurScripts.net
//
//
// Copyright (c) 2002 by Quiecom
// Copyright (c) 2002 by Quiecom
// http://www.Quiecom.com
// http://www.Quiecom.com
//
//
// This program is free software. You can redistribute it and/or modify
// 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
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation
// the Free Software Foundation
// ===========================================
// ===========================================
/*****[CHANGES]**********************************************************
/*****[CHANGES]**********************************************************
-=[Base]=-
-=[Base]=-
Nuke Patched v3.1.0 08/10/2005
Nuke Patched v3.1.0 08/10/2005
NukeSentinel v2.4.2 02/01/2006
NukeSentinel v2.4.2 02/01/2006
-=[Mod]=-
-=[Mod]=-
Advanced Username Color v1.0.5 10/29/2005
Advanced Username Color v1.0.5 10/29/2005
************************************************************************/
************************************************************************/
if (!defined('MODULE_FILE')) {
if (!defined('MODULE_FILE')) {
die ("You can't access this file directly...");
die ("You can't access this file directly...");
}
}
$module_name = basename(dirname(__FILE__));
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
get_lang($module_name);
$pagetitle = "- "._SHOUTHISTORY;
$pagetitle = "- "._SHOUTHISTORY;
Copia
Copiato
Copia
Copiato
global
$db,
$user, $prefix, $username, $nsnst_const, $userinfo, $cache;
global
$user, $prefix, $username, $nsnst_const, $userinfo, $cache;
global $username;
global $username;
$username = $userinfo['username'];
$username = $userinfo['username'];
if (empty($username)) { $username = "Anonymous"; }
if (empty($username)) { $username = "Anonymous"; }
include_once(NUKE_MODULES_DIR.'Shout_Box/shout.php');
include_once(NUKE_MODULES_DIR.'Shout_Box/shout.php');
global $conf;
global $conf;
if ((($conf = $cache->load('conf', 'shoutbox')) == false) || empty($conf)) {
if ((($conf = $cache->load('conf', 'shoutbox')) == false) || empty($conf)) {
$sql = "SELECT * FROM `".$prefix."_shoutbox_conf`";
$sql = "SELECT * FROM `".$prefix."_shoutbox_conf`";
Copia
Copiato
Copia
Copiato
$result =
$db->sql_
query($sql);
$result =
db
query($sql);
$conf =
$db->sql_fetchrow
($result);
$conf =
dbrow
($result);
$cache->save('conf', 'shoutbox', $conf);
$cache->save('conf', 'shoutbox', $conf);
Copia
Copiato
Copia
Copiato
$db->sql_freeresult
($result);
dbfree
($result);
}
}
$Action = (isset($_REQUEST['Action'])) ? $_REQUEST['Action'] : '';
$Action = (isset($_REQUEST['Action'])) ? $_REQUEST['Action'] : '';
if ($Action == "AJAX") { die(); }
if ($Action == "AJAX") { die(); }
//do IP test then ban if on list
//do IP test then ban if on list
/*****[BEGIN]******************************************
/*****[BEGIN]******************************************
[ Base: NukeSentinel v2.4.2 ]
[ Base: NukeSentinel v2.4.2 ]
******************************************************/
******************************************************/
$uip = $nsnst_const['remote_ip'];
$uip = $nsnst_const['remote_ip'];
/*****[END]********************************************
/*****[END]********************************************
[ Base: NukeSentinel v2.4.2 ]
[ Base: NukeSentinel v2.4.2 ]
******************************************************/
******************************************************/
if($conf['ipblock'] == "yes") {
if($conf['ipblock'] == "yes") {
$sql = "SELECT * FROM ".$prefix."_shoutbox_ipblock";
$sql = "SELECT * FROM ".$prefix."_shoutbox_ipblock";
Copia
Copiato
Copia
Copiato
$ipresult =
$db->sql_
query($sql);
$ipresult =
db
query($sql);
while ($badips =
$db->sql_fetchrow
($ipresult)) {
while ($badips =
dbrow
($ipresult)) {
if (preg_match("/\*/i", $badips['name'])) { // Allow for Subnet bans like 123.456.*
if (preg_match("/\*/i", $badips['name'])) { // Allow for Subnet bans like 123.456.*
$badipsArray = explode(".",$badips['name']);
$badipsArray = explode(".",$badips['name']);
$uipArray = explode(".",$uip);
$uipArray = explode(".",$uip);
$i = 0;
$i = 0;
foreach($badipsArray as $badipsPart) {
foreach($badipsArray as $badipsPart) {
if ($badipsPart == "*") { $Action = "UserBanned"; break; }
if ($badipsPart == "*") { $Action = "UserBanned"; break; }
if ($badipsPart != $uipArray[$i] && $badipsPart != "*") { break; }
if ($badipsPart != $uipArray[$i] && $badipsPart != "*") { break; }
$i++;
$i++;
}
}
} else {
} else {
if($uip == $badips['name']) { $Action = "UserBanned"; break; }
if($uip == $badips['name']) { $Action = "UserBanned"; break; }
}
}
}
}
}
}
//do name test then ban if on list (only applies to registered users)
//do name test then ban if on list (only applies to registered users)
if($conf['nameblock'] == "yes" && $Action != "UserBanned") {
if($conf['nameblock'] == "yes" && $Action != "UserBanned") {
$sql = "SELECT * FROM ".$prefix."_shoutbox_nameblock";
$sql = "SELECT * FROM ".$prefix."_shoutbox_nameblock";
Copia
Copiato
Copia
Copiato
$nameresult =
$db->sql_
query($sql);
$nameresult =
db
query($sql);
while ($badname =
$db->sql_fetchrow
($nameresult)) {
while ($badname =
dbrow
($nameresult)) {
if($username == $badname['name']) { $Action = "UserBanned"; break; }
if($username == $badname['name']) { $Action = "UserBanned"; break; }
}
}
}
}
function searchHistory($where, $sbsearchtext, $results, $style, $order, $page) {
function searchHistory($where, $sbsearchtext, $results, $style, $order, $page) {
Copia
Copiato
Copia
Copiato
global
$db,
$prefix, $username, $userinfo, $board_config;
global
$prefix, $username, $userinfo, $board_config;
include_once(NUKE_BASE_DIR.'header.php');
include_once(NUKE_BASE_DIR.'header.php');
$sbsearchtext = htmlspecialchars($sbsearchtext, ENT_QUOTES);
$sbsearchtext = htmlspecialchars($sbsearchtext, ENT_QUOTES);
// search form
// search form
OpenTable();
OpenTable();
showSearchBox($sbsearchtext, $where, $style, $results, $order);
showSearchBox($sbsearchtext, $where, $style, $results, $order);
Copia
Copiato
Copia
Copiato
echo "<table cellpadding=\"3\" cellspacing=\"0\"
width
=\"
90%
\"
border
=\"0\" align=\"center
\">\n";
echo "<table cellpadding=\"3\" cellspacing=\"0\"
style=\"
width
:
90%
;
border
: 0px; margin-left:auto; margin-right:auto;
\">\n";
echo "<tr><td
align
=\"
center
\"><a href=\"modules.php?name=Shout_Box&page=1\">"._SHOUTHISTORY."</a></td></tr></table>";
echo "<tr><td
style=\"text-
align
:
center
;
\"><a href=\"modules.php?name=Shout_Box&page=1\">"._SHOUTHISTORY."</a></td></tr></table>";
CloseTable();
CloseTable();
echo "<br />";
echo "<br />";
// show results
// show results
OpenTable();
OpenTable();
if ($results > 50) { $results = 50; }
if ($results > 50) { $results = 50; }
if ($results < 10) { $results = 10; }
if ($results < 10) { $results = 10; }
Copia
Copiato
Copia
Copiato
echo "<table cellpadding=\"3\" cellspacing=\"0\"
width
=\"
90%
\"
border
=\"0\" align=\"center
\">\n";
echo "<table cellpadding=\"3\" cellspacing=\"0\"
style=\"
width
:
90%
;
border
: 0px; margin-left:auto; margin-right:auto;
\">\n";
echo "<tr><td
align
=\"
center
\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr>\n";
echo "<tr><td
style=\"text-
align
:
center
;
\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr>\n";
//echo "<tr><td><table cellpadding=\"0\" width=\"100%\" cellspacing=\"0\" border=\"0\"><tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/history.gif\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr></table></td></tr>\n";
//echo "<tr><td><table cellpadding=\"0\" width=\"100%\" cellspacing=\"0\" border=\"0\"><tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/history.gif\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr></table></td></tr>\n";
// build SQL query based on user choices
// build SQL query based on user choices
//$sql = "SELECT * FROM ".$prefix."_shoutbox_shouts WHERE name='$sbsearchtext' ORDER BY id DESC LIMIT $results";
//$sql = "SELECT * FROM ".$prefix."_shoutbox_shouts WHERE name='$sbsearchtext' ORDER BY id DESC LIMIT $results";
// search by Nicknames only
// search by Nicknames only
if ($where == 'Nicknames') {
if ($where == 'Nicknames') {
$SearchArray = explode(" ",$sbsearchtext);
$SearchArray = explode(" ",$sbsearchtext);
$c = count($SearchArray);
$c = count($SearchArray);
$d = 0;
$d = 0;
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`";
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`";
if (is_array($SearchArray)) {
if (is_array($SearchArray)) {
foreach($SearchArray as $SearchPart) {
foreach($SearchArray as $SearchPart) {
$d++;
$d++;
if ($style == 'Exact') {
if ($style == 'Exact') {
$sql .= "='".$SearchPart."'";
$sql .= "='".$SearchPart."'";
} else {
} else {
$sql .= " LIKE '%".$SearchPart."%'";
$sql .= " LIKE '%".$SearchPart."%'";
}
}
if ($d < $c) { $sql .= " AND `name`"; }
if ($d < $c) { $sql .= " AND `name`"; }
}
}
}
}
} elseif ($where == 'Both') {
} elseif ($where == 'Both') {
// search by Nicknames and Shouts
// search by Nicknames and Shouts
if ($style == 'Exact') {
if ($style == 'Exact') {
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`='".$sbsearchtext."' OR `comment`='".$sbsearchtext."'";
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`='".$sbsearchtext."' OR `comment`='".$sbsearchtext."'";
} else {
} else {
$SearchArray = explode(" ", $sbsearchtext);
$SearchArray = explode(" ", $sbsearchtext);
$c = count($SearchArray);
$c = count($SearchArray);
$d = 0;
$d = 0;
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`";
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`";
foreach($SearchArray as $SearchPart) {
foreach($SearchArray as $SearchPart) {
$d++;
$d++;
$sql .= " LIKE '%".$SearchPart."%' OR comment LIKE '%".$SearchPart."%'";
$sql .= " LIKE '%".$SearchPart."%' OR comment LIKE '%".$SearchPart."%'";
if ($d < $c) { $sql .= " OR `name`"; }
if ($d < $c) { $sql .= " OR `name`"; }
}
}
}
}
} else {
} else {
// search by Shouts only
// search by Shouts only
if ($style == 'Exact') {
if ($style == 'Exact') {
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment` LIKE '%".$sbsearchtext."%'";
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment` LIKE '%".$sbsearchtext."%'";
} else {
} else {
$SearchArray = explode(" ",$sbsearchtext);
$SearchArray = explode(" ",$sbsearchtext);
$c = count($SearchArray);
$c = count($SearchArray);
$d = 0;
$d = 0;
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment`";
$sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment`";
foreach($SearchArray as $SearchPart) {
foreach($SearchArray as $SearchPart) {
$d++;
$d++;
$sql .= " LIKE '%".$SearchPart."%'";
$sql .= " LIKE '%".$SearchPart."%'";
if ($d < $c) { $sql .= " AND `comment`"; }
if ($d < $c) { $sql .= " AND `comment`"; }
}
}
}
}
}
}
if ((empty($order)) || ($order == 'newest')) { $sql .= " ORDER BY `id` DESC"; }
if ((empty($order)) || ($order == 'newest')) { $sql .= " ORDER BY `id` DESC"; }
else { $sql .= " ORDER BY `id` ASC"; }
else { $sql .= " ORDER BY `id` ASC"; }
$sql .= " LIMIT $results";
$sql .= " LIMIT $results";
// end building SQL query
// end building SQL query
Copia
Copiato
Copia
Copiato
$result =
$db->sql_
query($sql);
$result =
db
query($sql);
$numrows =
$db->sql_
numrows($result);
$numrows =
db
numrows($result);
if ($numrows > 0) {
if ($numrows > 0) {
global $conf;
global $conf;
$flag = 1;
$flag = 1;
$ThemeSel = get_theme();
$ThemeSel = get_theme();
$sql = "SELECT `menuColor1`, `menuColor2` FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$ThemeSel'";
$sql = "SELECT `menuColor1`, `menuColor2` FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$ThemeSel'";
Copia
Copiato
Copia
Copiato
$resultT =
$db->sql_
query($sql);
$resultT =
db
query($sql);
$rowColor =
$db->sql_fetchrow
($resultT);
$rowColor =
dbrow
($resultT);
$db->sql_freeresult
($resultT);
dbfree
($resultT);
Copia
Copiato
Copia
Copiato
while ($row =
$db->sql_fetchrow
($result)) {
while ($row =
dbrow
($result)) {
if ($flag == 1) { $bgcolor = $rowColor['menuColor1']; }
if ($flag == 1) { $bgcolor = $rowColor['menuColor1']; }
if ($flag == 2) { $bgcolor = $rowColor['menuColor2']; }
if ($flag == 2) { $bgcolor = $rowColor['menuColor2']; }
$comment = str_replace('src=', 'src="', $row['comment']);
$comment = str_replace('src=', 'src="', $row['comment']);
$comment = str_replace('.gif>', '.gif" alt="" />', $comment);
$comment = str_replace('.gif>', '.gif" alt="" />', $comment);
$comment = str_replace('.jpg>', '.jpg" alt="" />', $comment);
$comment = str_replace('.jpg>', '.jpg" alt="" />', $comment);
$comment = str_replace('.png>', '.png" alt="" />', $comment);
$comment = str_replace('.png>', '.png" alt="" />', $comment);
$comment = str_replace('.bmp>', '.bmp" alt="" />', $comment);
$comment = str_replace('.bmp>', '.bmp" alt="" />', $comment);
// BB code [b]word[/b] [i]word[/i] [u]word[/u]
// BB code [b]word[/b] [i]word[/i] [u]word[/u]
if ((preg_match("#[b]#i", $comment)) && (preg_match("#[/b]#i", $comment)) && (substr_count($comment,"[b]") == substr_count($comment,"[/b]"))) {
if ((preg_match("#[b]#i", $comment)) && (preg_match("#[/b]#i", $comment)) && (substr_count($comment,"[b]") == substr_count($comment,"[/b]"))) {
$comment = str_replace("[b]","<span style=\"font-weight: bold\">",$comment);
$comment = str_replace("[b]","<span style=\"font-weight: bold\">",$comment);
$comment = str_replace("[/b]","</span>",$comment);
$comment = str_replace("[/b]","</span>",$comment);
}
}
if ((preg_match("#[i]#i", $comment)) && (preg_match("#[/i]#i", $comment)) && (substr_count($comment,"[i]") == substr_count($comment,"[/i]"))) {
if ((preg_match("#[i]#i", $comment)) && (preg_match("#[/i]#i", $comment)) && (substr_count($comment,"[i]") == substr_count($comment,"[/i]"))) {
$comment = str_replace("\[i\]","<span style=\"font-style: italic\">",$comment);
$comment = str_replace("\[i\]","<span style=\"font-style: italic\">",$comment);
$comment = str_replace("\[\/i\]","</span>",$comment);
$comment = str_replace("\[\/i\]","</span>",$comment);
}
}
if ((preg_match("#[u]#i", $comment)) && (preg_match("#[/u]#i", $comment)) && (substr_count("$comment","[u]") == substr_count($comment,"[/u]"))) {
if ((preg_match("#[u]#i", $comment)) && (preg_match("#[/u]#i", $comment)) && (substr_count("$comment","[u]") == substr_count($comment,"[/u]"))) {
$comment = str_replace("[u]","<span style=\"text-decoration: underline\">",$comment);
$comment = str_replace("[u]","<span style=\"text-decoration: underline\">",$comment);
$comment = str_replace("[/u]","</span>",$comment);
$comment = str_replace("[/u]","</span>",$comment);
}
}
$sqlN = "SELECT `user_avatar`, `username` FROM `".$prefix."_users` WHERE `username`='".$row['name']."'";
$sqlN = "SELECT `user_avatar`, `username` FROM `".$prefix."_users` WHERE `username`='".$row['name']."'";
Copia
Copiato
Copia
Copiato
$nameresultN =
$db->sql_
query($sqlN);
$nameresultN =
db
query($sqlN);
$rowN =
$db->sql_fetchrow
($nameresultN);
$rowN =
dbrow
($nameresultN);
$db->sql_freeresult
($nameresultN);
dbfree
($nameresultN);
// Disallow Anonymous users from seeing links to users' accounts
// Disallow Anonymous users from seeing links to users' accounts
if ($username == "Anonymous") {
if ($username == "Anonymous") {
if (!empty($rowN['user_avatar']) && $rowN['user_avatar'] != "blank.gif" && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) {
if (!empty($rowN['user_avatar']) && $rowN['user_avatar'] != "blank.gif" && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) {
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">";
echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">";
echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">";
echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">";
$row_avatar = $rowN['user_avatar'];
$row_avatar = $rowN['user_avatar'];
$av_found = findAvatar($row_avatar);
$av_found = findAvatar($row_avatar);
echo $av_found;
echo $av_found;
echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\">";
echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\">";
echo "<strong>$row[name]:</strong> $comment";
echo "<strong>$row[name]:</strong> $comment";
if ($conf['date'] == "yes") {
if ($conf['date'] == "yes") {
if (!empty($row['timestamp'])) {
if (!empty($row['timestamp'])) {
// reads unix timestamp && formats it to the viewer's timezone
// reads unix timestamp && formats it to the viewer's timezone
if (is_user()) {
if (is_user()) {
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
echo "<br />$unixTime";
echo "<br />$unixTime";
} else {
} else {
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
echo "<br />$unixTime";
echo "<br />$unixTime";
}
}
} else {
} else {
echo "<br />".$row['date']." ".$row['time'];
echo "<br />".$row['date']." ".$row['time'];
}
}
}
}
echo "</td></tr></table>";
echo "</td></tr></table>";
echo "</td></tr>\n";
echo "</td></tr>\n";
} else {
} else {
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<strong>".$row['name'].":</strong> $comment";
echo "<strong>".$row['name'].":</strong> $comment";
if ($conf['date'] == "yes") {
if ($conf['date'] == "yes") {
if (!empty($row['timestamp'])) {
if (!empty($row['timestamp'])) {
// reads unix timestamp && formats it to the viewer's timezone
// reads unix timestamp && formats it to the viewer's timezone
if (is_user()) {
if (is_user()) {
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
echo "<br />$unixTime";
echo "<br />$unixTime";
} else {
} else {
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
echo "<br />$unixTime";
echo "<br />$unixTime";
}
}
} else {
} else {
echo "<br />".$row['date']." ".$row['time'];
echo "<br />".$row['date']." ".$row['time'];
}
}
}
}
echo "</td></tr>\n";
echo "</td></tr>\n";
}
}
} else {
} else {
// check to see if nickname is a user in the DB && not Anonymous
// check to see if nickname is a user in the DB && not Anonymous
if (is_array($rowN) && $rowN['username'] != "Anonymous") {
if (is_array($rowN) && $rowN['username'] != "Anonymous") {
if (($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) {
if (($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) {
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">";
echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">";
echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">";
echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">";
$row_avatar = $rowN['user_avatar'];
$row_avatar = $rowN['user_avatar'];
$av_found = findAvatar($row_avatar);
$av_found = findAvatar($row_avatar);
echo $av_found;
echo $av_found;
/*****[BEGIN]******************************************
/*****[BEGIN]******************************************
[ Mod: Advanced Username Color v1.0.5 ]
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
******************************************************/
echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\"><strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />";
echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\"><strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />";
/*****[END]********************************************
/*****[END]********************************************
[ Mod: Advanced Username Color v1.0.5 ]
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
******************************************************/
if ($conf['date'] == "yes") {
if ($conf['date'] == "yes") {
if (!empty($row['timestamp'])) {
if (!empty($row['timestamp'])) {
// reads unix timestamp && formats it to the viewer's timezone
// reads unix timestamp && formats it to the viewer's timezone
if (is_user()) {
if (is_user()) {
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
echo $unixTime;
echo $unixTime;
} else {
} else {
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
echo "$unixTime";
echo "$unixTime";
}
}
} else {
} else {
echo $row['date']." ".$row['time'];
echo $row['date']." ".$row['time'];
}
}
}
}
// registered users edit/delete posts
// registered users edit/delete posts
if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) {
if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) {
echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]";
echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]";
}
}
echo "</td></tr></table>";
echo "</td></tr></table>";
echo "</td></tr>\n";
echo "</td></tr>\n";
} else {
} else {
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<tr><td style=\"background-color: $bgcolor;\">";
/*****[BEGIN]******************************************
/*****[BEGIN]******************************************
[ Mod: Advanced Username Color v1.0.5 ]
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
******************************************************/
echo "<strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />";
echo "<strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />";
/*****[END]********************************************
/*****[END]********************************************
[ Mod: Advanced Username Color v1.0.5 ]
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
******************************************************/
if ($conf['date'] == "yes") {
if ($conf['date'] == "yes") {
if (!empty($row['timestamp'])) {
if (!empty($row['timestamp'])) {
// reads unix timestamp && formats it to the viewer's timezone
// reads unix timestamp && formats it to the viewer's timezone
if (is_user()) {
if (is_user()) {
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
echo $unixTime;
echo $unixTime;
} else {
} else {
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
echo $unixTime;
echo $unixTime;
}
}
} else {
} else {
echo $row['date']." ".$row['time'];
echo $row['date']." ".$row['time'];
}
}
}
}
// registered users edit/delete posts
// registered users edit/delete posts
if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) {
if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) {
echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]";
echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]";
}
}
echo "</td></tr>\n";
echo "</td></tr>\n";
}
}
} else {
} else {
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<tr><td style=\"background-color: $bgcolor;\">";
echo "<strong>$row[name]:</strong> $comment";
echo "<strong>$row[name]:</strong> $comment";
if ($conf['date'] == "yes") {
if ($conf['date'] == "yes") {
if (!empty($row['timestamp'])) {
if (!empty($row['timestamp'])) {
// reads unix timestamp && formats it to the viewer's timezone
// reads unix timestamp && formats it to the viewer's timezone
if (is_user()) {
if (is_user()) {
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
$unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']);
echo "<br />$unixTime";
echo "<br />$unixTime";
} else {
} else {
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
$unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']);
echo "<br />$unixTime";
echo "<br />$unixTime";
}
}
} else {
} else {
echo "<br />".$row['date']." ".$row['time'];
echo "<br />".$row['date']." ".$row['time'];
}
}
}
}
echo "</td></tr>\n";
echo "</td></tr>\n";
}
}
}
}
if ($flag == 1) { $flag = 2; }
if ($flag == 1) { $flag = 2; }
elseif ($flag == 2) { $flag =1; }
elseif ($flag == 2) { $flag =1; }
}
}
Copia
Copiato
Copia
Copiato
$db->sql_freeresult
($result);
dbfree
($result);
} else {
} else {
Copia
Copiato
Copia
Copiato
echo "<tr><td><table cellpadding=\"3\" cellspacing=\"0\"
border
=\"
1\"
align
=\"
center
\">\n";
echo "<tr><td><table cellpadding=\"3\" cellspacing=\"0\"
style
=\"
text-
align
:
center
; border 1px;
\">\n";
echo "<tr><td
align
=\"
center
\">"._NORESULTS."</td></tr></table></td></tr>";
echo "<tr><td
style=\"text-
align
:
center
;
\">"._NORESULTS."</td></tr></table></td></tr>";
}
}
echo "</table>";
echo "</table>";
CloseTable();
CloseTable();
include_once(NUKE_BASE_DIR.'footer.php');
include_once(NUKE_BASE_DIR.'footer.php');
}
}
function showSearchBox($sbsearchtext, $where, $style, $results, $order) {
function showSearchBox($sbsearchtext, $where, $style, $results, $order) {
echo "<form name=\"shoutform3\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n";
echo "<form name=\"shoutform3\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n";
Copia
Copiato
Copia
Copiato
echo "<table cellpadding=\"3\" cellspacing=\"0\"
width=\"95%\" border
=\"
0\"
align
=\"
center
\">\n";
echo "<table cellpadding=\"3\" cellspacing=\"0\"
style
=\"
text-
align
:
center
; border: 0px; width: 95%; margin-left:auto; margin-right:auto;
\">\n";
echo "<tr><td
align
=\"
center
\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n";
echo "<tr><td
style=\"text-
align
:
center
;
\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n";
//echo "<tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/search.jpg\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n";
//echo "<tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/search.jpg\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n";
Copia
Copiato
Copia
Copiato
echo "<tr><td colspan=\"2\"
align
=\"
center
\" nowrap=\"nowrap\" valign=\"middle\">";
echo "<tr><td colspan=\"2\"
style=\"text-
align
:
center
;
\" nowrap=\"nowrap\" valign=\"middle\">";
if (($where == 'Shouts') || (empty($where))) { $wSEL1 = " selected=\"selected\""; } else { $wSEL1 = ''; }
if (($where == 'Shouts') || (empty($where))) { $wSEL1 = " selected=\"selected\""; } else { $wSEL1 = ''; }
if ($where == 'Nicknames') { $wSEL2 = " selected=\"selected\""; } else { $wSEL2 = ''; }
if ($where == 'Nicknames') { $wSEL2 = " selected=\"selected\""; } else { $wSEL2 = ''; }
if ($where == 'Both') { $wSEL3 = " selected=\"selected\""; } else { $wSEL3 = ''; }
if ($where == 'Both') { $wSEL3 = " selected=\"selected\""; } else { $wSEL3 = ''; }
echo "<select name=\"where\">
echo "<select name=\"where\">
<option value=\"Shouts\"$wSEL1>"._SHOUTS."</option>
<option value=\"Shouts\"$wSEL1>"._SHOUTS."</option>
<option value=\"Nicknames\"$wSEL2>"._SBNICKNAMES."</option>
<option value=\"Nicknames\"$wSEL2>"._SBNICKNAMES."</option>
<option value=\"Both\"$wSEL3>"._SBBOTH."</option></select> ";
<option value=\"Both\"$wSEL3>"._SBBOTH."</option></select> ";
if (($style == 'Exact') || (empty($style))) { $sSEL1 = " selected=\"selected\""; } else { $sSEL1 = ''; }
if (($style == 'Exact') || (empty($style))) { $sSEL1 = " selected=\"selected\""; } else { $sSEL1 = ''; }
if ($style == 'Any') { $sSEL2 = " selected=\"selected\""; } else { $sSEL2 = ''; }
if ($style == 'Any') { $sSEL2 = " selected=\"selected\""; } else { $sSEL2 = ''; }
echo "<select name=\"style\">
echo "<select name=\"style\">
<option value=\"Exact\"$sSEL1>"._EXACTPHRASE."</option>
<option value=\"Exact\"$sSEL1>"._EXACTPHRASE."</option>
<option value=\"Any\"$sSEL2>"._FUZZY."</option>
<option value=\"Any\"$sSEL2>"._FUZZY."</option>
</select> ";
</select> ";
if (($results == 10) || (empty($results))) { $rSEL10 = " selected=\"selected\""; } else { $rSEL10 = ''; }
if (($results == 10) || (empty($results))) { $rSEL10 = " selected=\"selected\""; } else { $rSEL10 = ''; }
if ($results == 20) { $rSEL20 = " selected=\"selected\""; } else { $rSEL20 = ''; }
if ($results == 20) { $rSEL20 = " selected=\"selected\""; } else { $rSEL20 = ''; }
if ($results == 30) { $rSEL30 = " selected=\"selected\""; } else { $rSEL30 = ''; }
if ($results == 30) { $rSEL30 = " selected=\"selected\""; } else { $rSEL30 = ''; }
if ($results == 50) { $rSEL50 = " selected=\"selected\""; } else { $rSEL50 = ''; }
if ($results == 50) { $rSEL50 = " selected=\"selected\""; } else { $rSEL50 = ''; }
echo "<select name=\"results\">
echo "<select name=\"results\">
<option value=\"10\"$rSEL10>10 "._SBRESULTS."</option>
<option value=\"10\"$rSEL10>10 "._SBRESULTS."</option>
<option value=\"20\"$rSEL20>20 "._SBRESULTS."</option>
<option value=\"20\"$rSEL20>20 "._SBRESULTS."</option>
<option value=\"30\"$rSEL30>30 "._SBRESULTS."</option>
<option value=\"30\"$rSEL30>30 "._SBRESULTS."</option>
<option value=\"50\"$rSEL50>50 "._SBRESULTS."</option></select> ";
<option value=\"50\"$rSEL50>50 "._SBRESULTS."</option></select> ";
if (($order == 'newest') || (empty($order))) { $oSEL1 = " selected=\"selected\""; } else { $oSEL1 = ''; }
if (($order == 'newest') || (empty($order))) { $oSEL1 = " selected=\"selected\""; } else { $oSEL1 = ''; }
if ($order == 'oldest') { $oSEL2 = " selected=\"selected\""; } else { $oSEL2 = ''; }
if ($order == 'oldest') { $oSEL2 = " selected=\"selected\""; } else { $oSEL2 = ''; }
echo "<select name=\"order\">
echo "<select name=\"order\">
<option value=\"newest\"$oSEL1>"._NEWESTFIRST."</option>
<option value=\"newest\"$oSEL1>"._NEWESTFIRST."</option>
<option value=\"oldest\"$oSEL2>"._OLDESTFIRST."</option></select>";
<option value=\"oldest\"$oSEL2>"._OLDESTFIRST."</option></select>";
Copia
Copiato
Copia
Copiato
echo "</td></tr><tr><td colspan=\"2\"
align
=\"
center
\" nowrap=\"nowrap\" valign=\"middle\">";
echo "</td></tr><tr><td colspan=\"2\"
style=\"text-
align
:
center
;
\" nowrap=\"nowrap\" valign=\"middle\">";
echo "<input type=\"text\" name=\"sbsearchtext\" value=\"$sbsearchtext\" size=\"53\" maxlength=\"100\" /> ";
echo "<input type=\"text\" name=\"sbsearchtext\" value=\"$sbsearchtext\" size=\"53\" maxlength=\"100\" /> ";
echo "<input type=\"hidden\" name=\"Action\" value=\"Search\" /><input type=\"submit\" name=\"button\" value=\""._SBSEARCH."\" /></td></tr>";
echo "<input type=\"hidden\" name=\"Action\" value=\"Search\" /><input type=\"submit\" name=\"button\" value=\""._SBSEARCH."\" /></td></tr>";
echo "</table></form>";
echo "</table></form>";
}
}
function shoutDelete($page, $shoutID) {
function shoutDelete($page, $shoutID) {
Copia
Copiato
Copia
Copiato
global
$db,
$username, $prefix, $conf;
global
$username, $prefix, $conf;
if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) {
if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) {
$sql = "SELECT `name` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'";
$sql = "SELECT `name` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'";
Copia
Copiato
Copia
Copiato
$nameresult =
$db->sql_
query($sql);
$nameresult =
db
query($sql);
$row =
$db->sql_fetchrow
($nameresult);
$row =
dbrow
($nameresult);
$db->sql_freeresult
($nameresult);
dbfree
($nameresult);
if ($row['name'] == $username) {
if ($row['name'] == $username) {
$sqlD = "DELETE FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'";
$sqlD = "DELETE FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'";
Copia
Copiato
Copia
Copiato
$db->sql_
query($sqlD);
db
query($sqlD);
}
}
}
}
header("Location: modules.php?name=Shout_Box&page=$page");
header("Location: modules.php?name=Shout_Box&page=$page");
exit;
exit;
}
}
function shoutEdit($page, $shoutID, $ShoutError) {
function shoutEdit($page, $shoutID, $ShoutError) {
Copia
Copiato
Copia
Copiato
global
$db,
$prefix, $conf, $username;
global
$prefix, $conf, $username;
include_once(NUKE_BASE_DIR.'header.php');
include_once(NUKE_BASE_DIR.'header.php');
OpenTable();
OpenTable();
if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) {
if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) {
$sql = "SELECT `name`, `comment` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'";
$sql = "SELECT `name`, `comment` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'";
Copia
Copiato
Copia
Copiato
$nameresult =
$db->sql_
query($sql);
$nameresult =
db
query($sql);
$row =
$db->sql_fetchrow
($nameresult);
$row =
dbrow
($nameresult);
$db->sql_freeresult
($nameresult);
dbfree
($nameresult);
if ($row['name'] == $username) {
if ($row['name'] == $username) {
// strip out link code here (added back in later if saved)
// strip out link code here (added back in later if saved)
$ShoutComment = $row['comment'];
$ShoutComment = $row['comment'];
$ShoutComment = str_replace("[<a rel=\"nofollow\" target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("[<a rel=\"nofollow\" target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("[<a rel=\"nofollow\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("[<a rel=\"nofollow\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("[<a target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("[<a target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("[<a href=\"", "",$ShoutComment);
$ShoutComment = str_replace("[<a href=\"", "",$ShoutComment);
$ShoutComment = str_replace("\">URL</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">URL</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">FTP</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">FTP</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">IRC</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">IRC</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">TeamSpeak</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">TeamSpeak</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">AIM</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">AIM</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">Gopher</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">Gopher</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">E-Mail</a>]", "",$ShoutComment);
$ShoutComment = str_replace("\">E-Mail</a>]", "",$ShoutComment);
$i = 0;
$i = 0;
Copia
Copiato
Copia
Copiato
$ShoutNew =
''
;
$ShoutNew =
array()
;
$ShoutArray = explode(" ",$ShoutComment);
$ShoutArray = explode(" ",$ShoutComment);
foreach($ShoutArray as $ShoutPart) {
foreach($ShoutArray as $ShoutPart) {
if (preg_match("#mailto:#i", $ShoutPart)) { // find mailto:
if (preg_match("#mailto:#i", $ShoutPart)) { // find mailto:
$ShoutPart = str_replace("mailto:", "",$ShoutPart); // strip out mailto:
$ShoutPart = str_replace("mailto:", "",$ShoutPart); // strip out mailto:
$ShoutPart = str_replace("%", " ",$ShoutPart);
$ShoutPart = str_replace("%", " ",$ShoutPart);
$ShoutPart = trim($ShoutPart);
$ShoutPart = trim($ShoutPart);
// decode address to ascii
// decode address to ascii
$c = 0;
$c = 0;
$AddyArray = explode(" ",$ShoutPart);
$AddyArray = explode(" ",$ShoutPart);
foreach($AddyArray as $AddyPart) {
foreach($AddyArray as $AddyPart) {
$AddyNew[$c] = chr(hexdec($AddyPart));
$AddyNew[$c] = chr(hexdec($AddyPart));
$c++;
$c++;
}
}
$ShoutPart = implode("",$AddyNew);
$ShoutPart = implode("",$AddyNew);
$ShoutNew[$i] = "mailto:$ShoutPart"; // add mailto: back in
$ShoutNew[$i] = "mailto:$ShoutPart"; // add mailto: back in
} else { $ShoutNew[$i] = $ShoutPart; }
} else { $ShoutNew[$i] = $ShoutPart; }
$i++;
$i++;
}
}
$ShoutComment = implode(" ",$ShoutNew);
$ShoutComment = implode(" ",$ShoutNew);
// strip smilies code here (added back in later if saved)
// strip smilies code here (added back in later if saved)
Copia
Copiato
Copia
Copiato
$sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`";
Copia
Copiato
Copia
Copiato
Diff salvati
Testo originale
Apri file
<?php /*======================================================================= Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System =======================================================================*/ // ========================================== // PHP-NUKE: Shout Box // ========================== // // Copyright (c) 2003-2005 by Aric Bolf (SuperCat) // http://www.OurScripts.net // // Copyright (c) 2002 by Quiecom // http://www.Quiecom.com // // 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 // =========================================== /*****[CHANGES]********************************************************** -=[Base]=- Nuke Patched v3.1.0 08/10/2005 NukeSentinel v2.4.2 02/01/2006 -=[Mod]=- Advanced Username Color v1.0.5 10/29/2005 ************************************************************************/ if (!defined('MODULE_FILE')) { die ("You can't access this file directly..."); } $module_name = basename(dirname(__FILE__)); get_lang($module_name); $pagetitle = "- "._SHOUTHISTORY; global $db, $user, $prefix, $username, $nsnst_const, $userinfo, $cache; global $username; $username = $userinfo['username']; if (empty($username)) { $username = "Anonymous"; } include_once(NUKE_MODULES_DIR.'Shout_Box/shout.php'); global $conf; if ((($conf = $cache->load('conf', 'shoutbox')) == false) || empty($conf)) { $sql = "SELECT * FROM `".$prefix."_shoutbox_conf`"; $result = $db->sql_query($sql); $conf = $db->sql_fetchrow($result); $cache->save('conf', 'shoutbox', $conf); $db->sql_freeresult($result); } $Action = (isset($_REQUEST['Action'])) ? $_REQUEST['Action'] : ''; if ($Action == "AJAX") { die(); } //do IP test then ban if on list /*****[BEGIN]****************************************** [ Base: NukeSentinel v2.4.2 ] ******************************************************/ $uip = $nsnst_const['remote_ip']; /*****[END]******************************************** [ Base: NukeSentinel v2.4.2 ] ******************************************************/ if($conf['ipblock'] == "yes") { $sql = "SELECT * FROM ".$prefix."_shoutbox_ipblock"; $ipresult = $db->sql_query($sql); while ($badips = $db->sql_fetchrow($ipresult)) { if (preg_match("/\*/i", $badips['name'])) { // Allow for Subnet bans like 123.456.* $badipsArray = explode(".",$badips['name']); $uipArray = explode(".",$uip); $i = 0; foreach($badipsArray as $badipsPart) { if ($badipsPart == "*") { $Action = "UserBanned"; break; } if ($badipsPart != $uipArray[$i] && $badipsPart != "*") { break; } $i++; } } else { if($uip == $badips['name']) { $Action = "UserBanned"; break; } } } } //do name test then ban if on list (only applies to registered users) if($conf['nameblock'] == "yes" && $Action != "UserBanned") { $sql = "SELECT * FROM ".$prefix."_shoutbox_nameblock"; $nameresult = $db->sql_query($sql); while ($badname = $db->sql_fetchrow($nameresult)) { if($username == $badname['name']) { $Action = "UserBanned"; break; } } } function searchHistory($where, $sbsearchtext, $results, $style, $order, $page) { global $db, $prefix, $username, $userinfo, $board_config; include_once(NUKE_BASE_DIR.'header.php'); $sbsearchtext = htmlspecialchars($sbsearchtext, ENT_QUOTES); // search form OpenTable(); showSearchBox($sbsearchtext, $where, $style, $results, $order); echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"90%\" border=\"0\" align=\"center\">\n"; echo "<tr><td align=\"center\"><a href=\"modules.php?name=Shout_Box&page=1\">"._SHOUTHISTORY."</a></td></tr></table>"; CloseTable(); echo "<br />"; // show results OpenTable(); if ($results > 50) { $results = 50; } if ($results < 10) { $results = 10; } echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"90%\" border=\"0\" align=\"center\">\n"; echo "<tr><td align=\"center\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr>\n"; //echo "<tr><td><table cellpadding=\"0\" width=\"100%\" cellspacing=\"0\" border=\"0\"><tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/history.gif\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr></table></td></tr>\n"; // build SQL query based on user choices //$sql = "SELECT * FROM ".$prefix."_shoutbox_shouts WHERE name='$sbsearchtext' ORDER BY id DESC LIMIT $results"; // search by Nicknames only if ($where == 'Nicknames') { $SearchArray = explode(" ",$sbsearchtext); $c = count($SearchArray); $d = 0; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`"; if (is_array($SearchArray)) { foreach($SearchArray as $SearchPart) { $d++; if ($style == 'Exact') { $sql .= "='".$SearchPart."'"; } else { $sql .= " LIKE '%".$SearchPart."%'"; } if ($d < $c) { $sql .= " AND `name`"; } } } } elseif ($where == 'Both') { // search by Nicknames and Shouts if ($style == 'Exact') { $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`='".$sbsearchtext."' OR `comment`='".$sbsearchtext."'"; } else { $SearchArray = explode(" ", $sbsearchtext); $c = count($SearchArray); $d = 0; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`"; foreach($SearchArray as $SearchPart) { $d++; $sql .= " LIKE '%".$SearchPart."%' OR comment LIKE '%".$SearchPart."%'"; if ($d < $c) { $sql .= " OR `name`"; } } } } else { // search by Shouts only if ($style == 'Exact') { $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment` LIKE '%".$sbsearchtext."%'"; } else { $SearchArray = explode(" ",$sbsearchtext); $c = count($SearchArray); $d = 0; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment`"; foreach($SearchArray as $SearchPart) { $d++; $sql .= " LIKE '%".$SearchPart."%'"; if ($d < $c) { $sql .= " AND `comment`"; } } } } if ((empty($order)) || ($order == 'newest')) { $sql .= " ORDER BY `id` DESC"; } else { $sql .= " ORDER BY `id` ASC"; } $sql .= " LIMIT $results"; // end building SQL query $result = $db->sql_query($sql); $numrows = $db->sql_numrows($result); if ($numrows > 0) { global $conf; $flag = 1; $ThemeSel = get_theme(); $sql = "SELECT `menuColor1`, `menuColor2` FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$ThemeSel'"; $resultT = $db->sql_query($sql); $rowColor = $db->sql_fetchrow($resultT); $db->sql_freeresult($resultT); while ($row = $db->sql_fetchrow($result)) { if ($flag == 1) { $bgcolor = $rowColor['menuColor1']; } if ($flag == 2) { $bgcolor = $rowColor['menuColor2']; } $comment = str_replace('src=', 'src="', $row['comment']); $comment = str_replace('.gif>', '.gif" alt="" />', $comment); $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment); $comment = str_replace('.png>', '.png" alt="" />', $comment); $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment); // BB code [b]word[/b] [i]word[/i] [u]word[/u] if ((preg_match("#[b]#i", $comment)) && (preg_match("#[/b]#i", $comment)) && (substr_count($comment,"[b]") == substr_count($comment,"[/b]"))) { $comment = str_replace("[b]","<span style=\"font-weight: bold\">",$comment); $comment = str_replace("[/b]","</span>",$comment); } if ((preg_match("#[i]#i", $comment)) && (preg_match("#[/i]#i", $comment)) && (substr_count($comment,"[i]") == substr_count($comment,"[/i]"))) { $comment = str_replace("\[i\]","<span style=\"font-style: italic\">",$comment); $comment = str_replace("\[\/i\]","</span>",$comment); } if ((preg_match("#[u]#i", $comment)) && (preg_match("#[/u]#i", $comment)) && (substr_count("$comment","[u]") == substr_count($comment,"[/u]"))) { $comment = str_replace("[u]","<span style=\"text-decoration: underline\">",$comment); $comment = str_replace("[/u]","</span>",$comment); } $sqlN = "SELECT `user_avatar`, `username` FROM `".$prefix."_users` WHERE `username`='".$row['name']."'"; $nameresultN = $db->sql_query($sqlN); $rowN = $db->sql_fetchrow($nameresultN); $db->sql_freeresult($nameresultN); // Disallow Anonymous users from seeing links to users' accounts if ($username == "Anonymous") { if (!empty($rowN['user_avatar']) && $rowN['user_avatar'] != "blank.gif" && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo $av_found; echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>".$row['name'].":</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } else { // check to see if nickname is a user in the DB && not Anonymous if (is_array($rowN) && $rowN['username'] != "Anonymous") { if (($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo $av_found; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\"><strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo $unixTime; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "$unixTime"; } } else { echo $row['date']." ".$row['time']; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo $unixTime; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo $unixTime; } } else { echo $row['date']." ".$row['time']; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr>\n"; } } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } if ($flag == 1) { $flag = 2; } elseif ($flag == 2) { $flag =1; } } $db->sql_freeresult($result); } else { echo "<tr><td><table cellpadding=\"3\" cellspacing=\"0\" border=\"1\" align=\"center\">\n"; echo "<tr><td align=\"center\">"._NORESULTS."</td></tr></table></td></tr>"; } echo "</table>"; CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } function showSearchBox($sbsearchtext, $where, $style, $results, $order) { echo "<form name=\"shoutform3\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n"; echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"95%\" border=\"0\" align=\"center\">\n"; echo "<tr><td align=\"center\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n"; //echo "<tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/search.jpg\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n"; echo "<tr><td colspan=\"2\" align=\"center\" nowrap=\"nowrap\" valign=\"middle\">"; if (($where == 'Shouts') || (empty($where))) { $wSEL1 = " selected=\"selected\""; } else { $wSEL1 = ''; } if ($where == 'Nicknames') { $wSEL2 = " selected=\"selected\""; } else { $wSEL2 = ''; } if ($where == 'Both') { $wSEL3 = " selected=\"selected\""; } else { $wSEL3 = ''; } echo "<select name=\"where\"> <option value=\"Shouts\"$wSEL1>"._SHOUTS."</option> <option value=\"Nicknames\"$wSEL2>"._SBNICKNAMES."</option> <option value=\"Both\"$wSEL3>"._SBBOTH."</option></select> "; if (($style == 'Exact') || (empty($style))) { $sSEL1 = " selected=\"selected\""; } else { $sSEL1 = ''; } if ($style == 'Any') { $sSEL2 = " selected=\"selected\""; } else { $sSEL2 = ''; } echo "<select name=\"style\"> <option value=\"Exact\"$sSEL1>"._EXACTPHRASE."</option> <option value=\"Any\"$sSEL2>"._FUZZY."</option> </select> "; if (($results == 10) || (empty($results))) { $rSEL10 = " selected=\"selected\""; } else { $rSEL10 = ''; } if ($results == 20) { $rSEL20 = " selected=\"selected\""; } else { $rSEL20 = ''; } if ($results == 30) { $rSEL30 = " selected=\"selected\""; } else { $rSEL30 = ''; } if ($results == 50) { $rSEL50 = " selected=\"selected\""; } else { $rSEL50 = ''; } echo "<select name=\"results\"> <option value=\"10\"$rSEL10>10 "._SBRESULTS."</option> <option value=\"20\"$rSEL20>20 "._SBRESULTS."</option> <option value=\"30\"$rSEL30>30 "._SBRESULTS."</option> <option value=\"50\"$rSEL50>50 "._SBRESULTS."</option></select> "; if (($order == 'newest') || (empty($order))) { $oSEL1 = " selected=\"selected\""; } else { $oSEL1 = ''; } if ($order == 'oldest') { $oSEL2 = " selected=\"selected\""; } else { $oSEL2 = ''; } echo "<select name=\"order\"> <option value=\"newest\"$oSEL1>"._NEWESTFIRST."</option> <option value=\"oldest\"$oSEL2>"._OLDESTFIRST."</option></select>"; echo "</td></tr><tr><td colspan=\"2\" align=\"center\" nowrap=\"nowrap\" valign=\"middle\">"; echo "<input type=\"text\" name=\"sbsearchtext\" value=\"$sbsearchtext\" size=\"53\" maxlength=\"100\" /> "; echo "<input type=\"hidden\" name=\"Action\" value=\"Search\" /><input type=\"submit\" name=\"button\" value=\""._SBSEARCH."\" /></td></tr>"; echo "</table></form>"; } function shoutDelete($page, $shoutID) { global $db, $username, $prefix, $conf; if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) { $sql = "SELECT `name` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; $nameresult = $db->sql_query($sql); $row = $db->sql_fetchrow($nameresult); $db->sql_freeresult($nameresult); if ($row['name'] == $username) { $sqlD = "DELETE FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; $db->sql_query($sqlD); } } header("Location: modules.php?name=Shout_Box&page=$page"); exit; } function shoutEdit($page, $shoutID, $ShoutError) { global $db, $prefix, $conf, $username; include_once(NUKE_BASE_DIR.'header.php'); OpenTable(); if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) { $sql = "SELECT `name`, `comment` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; $nameresult = $db->sql_query($sql); $row = $db->sql_fetchrow($nameresult); $db->sql_freeresult($nameresult); if ($row['name'] == $username) { // strip out link code here (added back in later if saved) $ShoutComment = $row['comment']; $ShoutComment = str_replace("[<a rel=\"nofollow\" target=\"_blank\" href=\"", "",$ShoutComment); $ShoutComment = str_replace("[<a rel=\"nofollow\" href=\"", "",$ShoutComment); $ShoutComment = str_replace("[<a target=\"_blank\" href=\"", "",$ShoutComment); $ShoutComment = str_replace("[<a href=\"", "",$ShoutComment); $ShoutComment = str_replace("\">URL</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">FTP</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">IRC</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">TeamSpeak</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">AIM</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">Gopher</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">E-Mail</a>]", "",$ShoutComment); $i = 0; $ShoutNew = ''; $ShoutArray = explode(" ",$ShoutComment); foreach($ShoutArray as $ShoutPart) { if (preg_match("#mailto:#i", $ShoutPart)) { // find mailto: $ShoutPart = str_replace("mailto:", "",$ShoutPart); // strip out mailto: $ShoutPart = str_replace("%", " ",$ShoutPart); $ShoutPart = trim($ShoutPart); // decode address to ascii $c = 0; $AddyArray = explode(" ",$ShoutPart); foreach($AddyArray as $AddyPart) { $AddyNew[$c] = chr(hexdec($AddyPart)); $c++; } $ShoutPart = implode("",$AddyNew); $ShoutNew[$i] = "mailto:$ShoutPart"; // add mailto: back in } else { $ShoutNew[$i] = $ShoutPart; } $i++; } $ShoutComment = implode(" ",$ShoutNew); // strip smilies code here (added back in later if saved) $sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`"; $eresult = $db->sql_query($sql); while ($emoticons = $db->sql_fetchrow($eresult)) { $ShoutComment = str_replace($emoticons['image'],$emoticons['text'],$ShoutComment); } $db->sql_freeresult($eresult); echo "<form name=\"shoutedit\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n"; echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"90%\" border=\"0\" align=\"center\">\n"; echo "<tr><td align=\"center\"><span class=\"title\">"._SHOUTBOXEDIT."<br /><br /></span></td></tr>\n"; if (($ShoutError) && ($ShoutError != 'none')) { echo "<tr><td style=\"background: #FF3333;\"><strong>"._SB_NOTE.":</strong> $ShoutError</td></tr>"; } echo "<tr><td align=\"center\"><input type=\"hidden\" name=\"shoutID\" value=\"$shoutID\" /><input type=\"text\" name=\"ShoutComment\" size=\"70\" value=\"$ShoutComment\" maxlength=\"2500\" />"; echo "<input type=\"hidden\" name=\"page\" value=\"$page\" /><input type=\"hidden\" name=\"Action\" value=\"Save\" /> <input type=\"submit\" name=\"button\" value=\""._UPDATE."\" /></td></tr>"; echo "<tr><td align=\"center\"><a href=\"modules.php?name=Shout_Box&page=$page\">"._SHOUTHISTORY."</a></td></tr>"; echo "</table></form>"; } else { echo _EDITINGOTHERSDISALLOWED; } } else { echo _EDITINGDISABLEDBYADMIN; } CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } function shoutSave($page, $shoutID, $ShoutComment) { global $db, $username, $prefix, $conf; if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) { $sql = "SELECT `name` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; $nameresult = $db->sql_query($sql); $row = $db->sql_fetchrow($nameresult); $db->sql_freeresult($nameresult); if ($row['name'] == $username) { $ShoutComment = trim($ShoutComment); // remove whitespace off ends of shout $ShoutComment = preg_replace('/\s+/', ' ', $ShoutComment); // convert double spaces in middle of shout to single space $num = strlen($ShoutComment); if ($num < 1) { $ShoutError = _SHOUTTOOSHORT; } if ($num > 2500) { $ShoutError = _SHOUTTOOLONG; } if (!$ShoutComment) { $ShoutError = _NOSHOUT; } if ($ShoutComment == _SB_MESSAGE) { $ShoutError = _NOSHOUT; } $ShoutComment = str_replace(" [.] ", ".",$ShoutComment); if (preg_match("#.xxx#i", $ShoutComment) && $conf['blockxxx'] == "yes") { $ShoutError = _XXXBLOCKED; $ShoutComment = ''; } if (preg_match("#javascript:(.*)#i", $ShoutComment)) { $ShoutError = _JSINSHOUT; $ShoutComment = ''; } $ShoutComment = htmlspecialchars($ShoutComment, ENT_QUOTES); $ShoutComment = str_replace("&amp;", "&",$ShoutComment); // Scan for links in the shout. If there is, replace it with [URL] or block it if disallowed $i = 0; $ShoutNew = ''; $ShoutArray = explode(" ",$ShoutComment); if (is_array($ShoutArray)) { foreach($ShoutArray as $ShoutPart) { if (is_array($ShoutPart) == TRUE) { $ShoutPart = $ShoutPart[0]; } if (preg_match("#http://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } // fix for users adding text to the beginning of links: HACKhttp://www.website.com $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"http://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>]"; } elseif (preg_match("#ftp://#", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"ftp://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">FTP</a>]"; } elseif (preg_match("#irc://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"irc://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">IRC</a>]"; } elseif (preg_match("#teamspeak://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"teamspeak://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">TeamSpeak</a>]"; } elseif (preg_match("#aim:goim#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"aim:goim"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">AIM</a>]"; } elseif (preg_match("#gopher://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"gopher://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">Gopher</a>]"; } elseif (preg_match("#mailto:#i", $ShoutPart)) { $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"mailto:"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } // email encoding to stop harvesters $ShoutPart = bin2hex($ShoutPart); $ShoutPart = chunk_split($ShoutPart, 2, '%'); $ShoutPart = '%' . substr($ShoutPart, 0, strlen($ShoutPart) - 1); $ShoutNew[$i] = "[<a href=\"$ShoutPart\">E-Mail</a>]"; } elseif (preg_match("#www.#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"www."); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutPart = "http://" . $ShoutPart; $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>]"; } elseif (preg_match('#@#i', $ShoutPart) && preg_match('/[\.]/i', $ShoutPart)) { // \b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b // email encoding to stop harvesters $ShoutPart = bin2hex($ShoutPart); $ShoutPart = chunk_split($ShoutPart, 2, '%'); $ShoutPart = '%' . substr($ShoutPart, 0, strlen($ShoutPart) - 1); $ShoutNew[$i] = "[<a href=\"mailto:$ShoutPart\">E-Mail</a>]"; } elseif ((preg_match("/\.(us|tv|cc|ws|ca|de|jp|ro|be|fm|ms|tc|ph|dk|st|ac|gs|vg|sh|kz|as|lt|to)/i", substr($ShoutPart, -3,3))) || (preg_match("/\.(com|net|org|mil|gov|biz|pro|xxx)/i", substr($ShoutPart, -4,4))) || (preg_match("/\.(info|name|mobi)/i", substr($ShoutPart, -5,5))) || (preg_match("/\.(co\.uk|co\.za|co\.nz|co\.il)/i", substr($ShoutPart, -6,6)))) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPart = "http://" . $ShoutPart; $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>]"; } elseif (strlen(html_entity_decode($ShoutPart, ENT_QUOTES)) > 21) { $ShoutNew[$i] = htmlspecialchars(wordwrap(html_entity_decode($ShoutPart, ENT_QUOTES), 21, " ", 1), ENT_QUOTES); $ShoutNew[$i] = str_replace("[ b]", " [b]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[b ]", " [b]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ /b]", "[/b] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/ b]", "[/b] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/b ]", "[/b] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ i]", " [i]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[i ]", " [i]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ /i]", "[/i] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/ i]", "[/i] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/i ]", "[/i] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ u]", " [u]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[u ]", " [u]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ /u]", "[/u] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/ u]", "[/u] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/u ]", "[/u] ",$ShoutNew[$i]); } else { $ShoutNew[$i] = $ShoutPart; } $i++; } } if (empty($ShoutError)) { $ShoutComment = implode(" ",$ShoutNew); } //Smilies from database $ShoutArrayReplace = explode(" ",$ShoutComment); $ShoutArrayScan = $ShoutArrayReplace; $sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`"; $eresult = $db->sql_query($sql); while ($emoticons = $db->sql_fetchrow($eresult)) { $i = 0; foreach($ShoutArrayScan as $ShoutPart) { if ($ShoutPart == $emoticons['text']) { $ShoutArrayReplace[$i] = $emoticons['image']; } $i++; } } $ShoutComment = implode(" ",$ShoutArrayReplace); //look for bad words, then censor them. if($conf['censor'] == "yes") { $ShoutArrayReplace = explode(" ",$ShoutComment); $ShoutArrayScan = $ShoutArrayReplace; $sql = "SELECT * FROM `".$prefix."_shoutbox_censor`"; $cresult = $db->sql_query($sql); while ($censor = $db->sql_fetchrow($cresult)) { $i = 0; foreach($ShoutArrayScan as $ShoutPart) { $ShoutPart = strtolower($ShoutPart); $censor['text'] = strtolower($censor['text']); if ($ShoutPart == $censor['text']) { $ShoutArrayReplace[$i] = $censor['replacement']; } $i++; } } $ShoutComment = implode(" ",$ShoutArrayReplace); /* // Phrase censor - Needs work before implementing $sql = "SELECT * FROM ".$prefix."_shoutbox_emoticons"; $eresult = $db->sql_query($sql); while ($emoticons = $db->sql_fetchrow($eresult)) { $ShoutComment = str_replace($emoticons[1],$emoticons[2],$ShoutComment); } */ } if (!$ShoutError) { $sqlU = "UPDATE `".$prefix."_shoutbox_shouts` set `comment`='$ShoutComment' WHERE `id`='$shoutID'"; $db->sql_query($sqlU); } else { header("Location: modules.php?name=Shout_Box&Action=Edit&shoutID=$shoutID&page=$page&ShoutError=$ShoutError"); exit; } } } header("Location: modules.php?name=Shout_Box&page=$page"); exit; } function findAvatar($row_avatar) { global $db, $prefix; // Find avatar path // modules/Forums/images/avatars/gallery $sql = "SELECT * FROM `".$prefix."_bbconfig` WHERE `config_name`='avatar_gallery_path'"; $result = $db->sql_query($sql); $avatar_gallery_path = $db->sql_fetchrow($result); $db->sql_freeresult($result); // modules/Forums/images/avatars $sql = "SELECT * FROM ".$prefix."_bbconfig WHERE config_name='avatar_path'"; $result = $db->sql_query($sql); $avatar_path = $db->sql_fetchrow($result); $db->sql_freeresult($result); if (preg_match('#http://#i',$row_avatar) == TRUE) { // offsite avatars $AvatarFound = "<img src=\"$row_avatar\" alt=\"\" /></td>"; } else { $agp = $avatar_gallery_path['config_value'].'/'.$row_avatar; $ap = $avatar_path['config_value'].'/'.$row_avatar; if (file_exists($agp) == TRUE) { $AvatarFound = "<img src=\"".$avatar_gallery_path['config_value']."/$row_avatar\" alt=\"\" /></td>"; } elseif (file_exists($ap) == TRUE) { $AvatarFound = "<img src=\"".$avatar_path['config_value']."/$row_avatar\" alt=\"\" /></td>"; } else { $AvatarFound = "<img src=\"".$avatar_path['config_value']."/blank.gif\" alt=\"\" /></td>"; } } return $AvatarFound; } function showHistory($page) { global $db, $prefix, $username, $userinfo, $board_config; include_once(NUKE_BASE_DIR.'header.php'); global $conf; // count number of shouts in DB $sql = "SELECT id FROM ".$prefix."_shoutbox_shouts"; $result = $db->sql_query($sql); $numrows = $db->sql_numrows($result); $db->sql_freeresult($result); $shout_pages = 1; $shoutsViewed = $conf['shoutsperpage']; while ($numrows >= $shoutsViewed) { $shout_pages++; $numrows = ($numrows - $shoutsViewed); } if ($shout_pages == 0) { $shout_pages = 1; } if (!$page) { $page = 1; } if ($page < 1) { $page = 1; } if ($page > $shout_pages) { $page = $shout_pages; } if ($page > 1) { $offset = ($page * $shoutsViewed); $offset1 = ($offset - $shoutsViewed); } else { $offset1 = 0; } // search form OpenTable(); $sbsearchtext = ''; $where = ''; $style = ''; $results = ''; $order = ''; showSearchBox($sbsearchtext, $where, $style, $results, $order); CloseTable(); echo "<br />"; OpenTable(); $flag = 1; $ThemeSel = get_theme(); $sql = "SELECT `menuColor1`, `menuColor2` FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$ThemeSel'"; $result = $db->sql_query($sql); $rowColor = $db->sql_fetchrow($result); $db->sql_freeresult($result); echo "<form name=\"shoutform2\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n"; echo "<table cellpadding=\"3\" cellspacing=\"0\" width=\"90%\" border=\"0\" align=\"center\">\n"; echo "<tr><td align=\"center\"><span class=\"title\">"._SHOUTBOXHISTORY."</span></td></tr>\n"; //echo "<tr><td><table cellpadding=\"0\" width=\"100%\" cellspacing=\"0\" border=\"0\"><tr><td width=\"45%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/history.gif\" alt=\"\" /></td><td width=\"55%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SHOUTBOXHISTORY."</span></td></tr></table></td></tr>\n"; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` ORDER BY `id` DESC LIMIT ".$offset1.",$shoutsViewed"; $resultt = $db->sql_query($sql); while ($row = $db->sql_fetchrow($resultt)) { if ($flag == 1) { $bgcolor = $rowColor['menuColor1']; } if ($flag == 2) { $bgcolor = $rowColor['menuColor2']; } $comment = str_replace('src=', 'src="', $row['comment']); $comment = str_replace('.gif>', '.gif" alt="" />', $comment); $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment); $comment = str_replace('.png>', '.png" alt="" />', $comment); $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment); // BB code [b]word[/b] [i]word[/i] [u]word[/u] if ((preg_match("#[b]#i", $comment)) && (preg_match("#[/b]#i", $comment)) && (substr_count($comment,"[b]") == substr_count($comment,"[/b]"))) { $comment = str_replace("[b]","<span style=\"font-weight: bold\">",$comment); $comment = str_replace("[/b]","</span>",$comment); } if ((preg_match("#[i]#i", $comment)) && (preg_match("#[/i]#i", $comment)) && (substr_count($comment,"[i]") == substr_count($comment,"[/i]"))) { $comment = str_replace("[i]","<span style=\"font-style: italic\">",$comment); $comment = str_replace("[/i]","</span>",$comment); } if ((preg_match("#[u]#i", $comment)) && (preg_match("#[/u]#i", $comment)) && (substr_count($comment,"[u]") == substr_count($comment,"[/u]"))) { $comment = str_replace("[u]","<span style=\"text-decoration: underline\">",$comment); $comment = str_replace("[/u]","</span>",$comment); } $sqlN = "SELECT `user_avatar`, `username` FROM `".$prefix."_users` WHERE username='$row[name]'"; $nameresultN = $db->sql_query($sqlN); $rowN = $db->sql_fetchrow($nameresultN); $db->sql_freeresult($nameresultN); // Disallow Anonymous users from seeing links to users' accounts if ($username == "Anonymous") { if (!empty($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo "$av_found"; echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } else { // check to see if nickname is a user in the DB && not Anonymous if (is_array($rowN) && ($rowN['username'] != "Anonymous")) { if (!empty($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo "$av_found"; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\"><strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo $unixTime; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo $unixTime; } } else { echo $row['date']." ".$row['time']; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=".$row['name']."\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo $unixTime; } } else { echo "$row[date] $row[time]"; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr>\n"; } } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } if ($flag == 1) { $flag = 2; } elseif ($flag == 2) { $flag =1; } } echo "<tr><td align=\"center\">"; $num1 = ($page-4); if ($num1 < 1) { $num1 = 1; } $num2 = ($num1+8); if ($num2 > $shout_pages) { $num2 = $shout_pages; } $num5 = ($num2-8); if ($num5 < $num1) { $num1 = $num5; if ($num1 < 1) { $num1 = 1; } } $num3 = ($page-1); $num4 = ($page+1); $menuLinks = ''; $count = $num1; while ($count <= $shout_pages && $count <= $num2) { if ($count == $page) { $menuLinks .= "<strong>$count</strong>"; } else { $menuLinks .= "<a href=\"modules.php?name=Shout_Box&page=$count\">$count</a>"; } if ($count < $num2) { $menuLinks .= " "; } $count++; } $menuLinks .= "<br /><br />"; if ($page > 1) { $menuLinks .= "<a href=\"modules.php?name=Shout_Box&page=$num3\">"._PREVIOUS."</a> \n"; } if ($page != $shout_pages) { $menuLinks .= _PAGE." $page / <a href=\"modules.php?name=Shout_Box&page=$shout_pages\">$shout_pages</a>\n"; } else { $menuLinks .= _PAGE." $page / $shout_pages\n"; } if ($page < $shout_pages) { $menuLinks .= " <a href=\"modules.php?name=Shout_Box&page=$num4\">"._NEXT."</a>\n"; } echo "$menuLinks"; echo "</td></tr></table></form>"; // End menu build CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } function showBanned() { include_once(NUKE_BASE_DIR.'header.php'); OpenTable(); echo "<br /><p class=\"title\" align=\"center\"><strong>"._YOUAREBANNEDM."</strong></p><br />"; CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } $page = (isset($_REQUEST['page'])) ? (int)$_REQUEST['page'] : 1; $shoutID = (isset($_REQUEST['shoutID'])) ? (int)$_REQUEST['shoutID'] : ''; $where = (isset($_POST['where'])) ? $_POST['where'] : ''; $sbsearchtext = (isset($_POST['sbsearchtext'])) ? $_POST['sbsearchtext'] : ''; $results = (isset($_POST['results'])) ? (int)$_POST['results'] : 0; $order = (isset($_POST['order'])) ? $_POST['order'] : ''; $style = (isset($_POST['style'])) ? $_POST['style'] : ''; $ShoutError = (isset($_REQUEST['ShoutError'])) ? $_REQUEST['ShoutError'] : ''; $ShoutComment = (isset($_POST['ShoutComment'])) ? $_POST['ShoutComment'] : ''; switch($Action) { case "UserBanned": showBanned(); break; case "Search": searchHistory($where, $sbsearchtext, $results, $style, $order, $page); break; case "Delete": shoutDelete($page, $shoutID); break; case "Edit": if (empty($ShoutError)) { $ShoutError = 'none'; } shoutEdit($page, $shoutID, $ShoutError); break; case "Save": shoutSave($page, $shoutID, $ShoutComment); break; default: showHistory($page); break; } ?>
Testo modificato
Apri file
<?php /*======================================================================= Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System =======================================================================*/ // ========================================== // PHP-NUKE: Shout Box // ========================== // // Copyright (c) 2003-2005 by Aric Bolf (SuperCat) // http://www.OurScripts.net // // Copyright (c) 2002 by Quiecom // http://www.Quiecom.com // // 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 // =========================================== /*****[CHANGES]********************************************************** -=[Base]=- Nuke Patched v3.1.0 08/10/2005 NukeSentinel v2.4.2 02/01/2006 -=[Mod]=- Advanced Username Color v1.0.5 10/29/2005 ************************************************************************/ if (!defined('MODULE_FILE')) { die ("You can't access this file directly..."); } $module_name = basename(dirname(__FILE__)); get_lang($module_name); $pagetitle = "- "._SHOUTHISTORY; global $user, $prefix, $username, $nsnst_const, $userinfo, $cache; global $username; $username = $userinfo['username']; if (empty($username)) { $username = "Anonymous"; } include_once(NUKE_MODULES_DIR.'Shout_Box/shout.php'); global $conf; if ((($conf = $cache->load('conf', 'shoutbox')) == false) || empty($conf)) { $sql = "SELECT * FROM `".$prefix."_shoutbox_conf`"; $result = dbquery($sql); $conf = dbrow($result); $cache->save('conf', 'shoutbox', $conf); dbfree($result); } $Action = (isset($_REQUEST['Action'])) ? $_REQUEST['Action'] : ''; if ($Action == "AJAX") { die(); } //do IP test then ban if on list /*****[BEGIN]****************************************** [ Base: NukeSentinel v2.4.2 ] ******************************************************/ $uip = $nsnst_const['remote_ip']; /*****[END]******************************************** [ Base: NukeSentinel v2.4.2 ] ******************************************************/ if($conf['ipblock'] == "yes") { $sql = "SELECT * FROM ".$prefix."_shoutbox_ipblock"; $ipresult = dbquery($sql); while ($badips = dbrow($ipresult)) { if (preg_match("/\*/i", $badips['name'])) { // Allow for Subnet bans like 123.456.* $badipsArray = explode(".",$badips['name']); $uipArray = explode(".",$uip); $i = 0; foreach($badipsArray as $badipsPart) { if ($badipsPart == "*") { $Action = "UserBanned"; break; } if ($badipsPart != $uipArray[$i] && $badipsPart != "*") { break; } $i++; } } else { if($uip == $badips['name']) { $Action = "UserBanned"; break; } } } } //do name test then ban if on list (only applies to registered users) if($conf['nameblock'] == "yes" && $Action != "UserBanned") { $sql = "SELECT * FROM ".$prefix."_shoutbox_nameblock"; $nameresult = dbquery($sql); while ($badname = dbrow($nameresult)) { if($username == $badname['name']) { $Action = "UserBanned"; break; } } } function searchHistory($where, $sbsearchtext, $results, $style, $order, $page) { global $prefix, $username, $userinfo, $board_config; include_once(NUKE_BASE_DIR.'header.php'); $sbsearchtext = htmlspecialchars($sbsearchtext, ENT_QUOTES); // search form OpenTable(); showSearchBox($sbsearchtext, $where, $style, $results, $order); echo "<table cellpadding=\"3\" cellspacing=\"0\" style=\"width: 90%; border: 0px; margin-left:auto; margin-right:auto;\">\n"; echo "<tr><td style=\"text-align: center;\"><a href=\"modules.php?name=Shout_Box&page=1\">"._SHOUTHISTORY."</a></td></tr></table>"; CloseTable(); echo "<br />"; // show results OpenTable(); if ($results > 50) { $results = 50; } if ($results < 10) { $results = 10; } echo "<table cellpadding=\"3\" cellspacing=\"0\" style=\"width: 90%; border: 0px; margin-left:auto; margin-right:auto;\">\n"; echo "<tr><td style=\"text-align: center;\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr>\n"; //echo "<tr><td><table cellpadding=\"0\" width=\"100%\" cellspacing=\"0\" border=\"0\"><tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/history.gif\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHRESULTS."</span></td></tr></table></td></tr>\n"; // build SQL query based on user choices //$sql = "SELECT * FROM ".$prefix."_shoutbox_shouts WHERE name='$sbsearchtext' ORDER BY id DESC LIMIT $results"; // search by Nicknames only if ($where == 'Nicknames') { $SearchArray = explode(" ",$sbsearchtext); $c = count($SearchArray); $d = 0; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`"; if (is_array($SearchArray)) { foreach($SearchArray as $SearchPart) { $d++; if ($style == 'Exact') { $sql .= "='".$SearchPart."'"; } else { $sql .= " LIKE '%".$SearchPart."%'"; } if ($d < $c) { $sql .= " AND `name`"; } } } } elseif ($where == 'Both') { // search by Nicknames and Shouts if ($style == 'Exact') { $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`='".$sbsearchtext."' OR `comment`='".$sbsearchtext."'"; } else { $SearchArray = explode(" ", $sbsearchtext); $c = count($SearchArray); $d = 0; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `name`"; foreach($SearchArray as $SearchPart) { $d++; $sql .= " LIKE '%".$SearchPart."%' OR comment LIKE '%".$SearchPart."%'"; if ($d < $c) { $sql .= " OR `name`"; } } } } else { // search by Shouts only if ($style == 'Exact') { $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment` LIKE '%".$sbsearchtext."%'"; } else { $SearchArray = explode(" ",$sbsearchtext); $c = count($SearchArray); $d = 0; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` WHERE `comment`"; foreach($SearchArray as $SearchPart) { $d++; $sql .= " LIKE '%".$SearchPart."%'"; if ($d < $c) { $sql .= " AND `comment`"; } } } } if ((empty($order)) || ($order == 'newest')) { $sql .= " ORDER BY `id` DESC"; } else { $sql .= " ORDER BY `id` ASC"; } $sql .= " LIMIT $results"; // end building SQL query $result = dbquery($sql); $numrows = dbnumrows($result); if ($numrows > 0) { global $conf; $flag = 1; $ThemeSel = get_theme(); $sql = "SELECT `menuColor1`, `menuColor2` FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$ThemeSel'"; $resultT = dbquery($sql); $rowColor = dbrow($resultT); dbfree($resultT); while ($row = dbrow($result)) { if ($flag == 1) { $bgcolor = $rowColor['menuColor1']; } if ($flag == 2) { $bgcolor = $rowColor['menuColor2']; } $comment = str_replace('src=', 'src="', $row['comment']); $comment = str_replace('.gif>', '.gif" alt="" />', $comment); $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment); $comment = str_replace('.png>', '.png" alt="" />', $comment); $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment); // BB code [b]word[/b] [i]word[/i] [u]word[/u] if ((preg_match("#[b]#i", $comment)) && (preg_match("#[/b]#i", $comment)) && (substr_count($comment,"[b]") == substr_count($comment,"[/b]"))) { $comment = str_replace("[b]","<span style=\"font-weight: bold\">",$comment); $comment = str_replace("[/b]","</span>",$comment); } if ((preg_match("#[i]#i", $comment)) && (preg_match("#[/i]#i", $comment)) && (substr_count($comment,"[i]") == substr_count($comment,"[/i]"))) { $comment = str_replace("\[i\]","<span style=\"font-style: italic\">",$comment); $comment = str_replace("\[\/i\]","</span>",$comment); } if ((preg_match("#[u]#i", $comment)) && (preg_match("#[/u]#i", $comment)) && (substr_count("$comment","[u]") == substr_count($comment,"[/u]"))) { $comment = str_replace("[u]","<span style=\"text-decoration: underline\">",$comment); $comment = str_replace("[/u]","</span>",$comment); } $sqlN = "SELECT `user_avatar`, `username` FROM `".$prefix."_users` WHERE `username`='".$row['name']."'"; $nameresultN = dbquery($sqlN); $rowN = dbrow($nameresultN); dbfree($nameresultN); // Disallow Anonymous users from seeing links to users' accounts if ($username == "Anonymous") { if (!empty($rowN['user_avatar']) && $rowN['user_avatar'] != "blank.gif" && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo $av_found; echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>".$row['name'].":</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } else { // check to see if nickname is a user in the DB && not Anonymous if (is_array($rowN) && $rowN['username'] != "Anonymous") { if (($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo $av_found; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\"><strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo $unixTime; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "$unixTime"; } } else { echo $row['date']." ".$row['time']; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo $unixTime; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo $unixTime; } } else { echo $row['date']." ".$row['time']; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr>\n"; } } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } if ($flag == 1) { $flag = 2; } elseif ($flag == 2) { $flag =1; } } dbfree($result); } else { echo "<tr><td><table cellpadding=\"3\" cellspacing=\"0\" style=\"text-align: center; border 1px;\">\n"; echo "<tr><td style=\"text-align: center;\">"._NORESULTS."</td></tr></table></td></tr>"; } echo "</table>"; CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } function showSearchBox($sbsearchtext, $where, $style, $results, $order) { echo "<form name=\"shoutform3\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n"; echo "<table cellpadding=\"3\" cellspacing=\"0\" style=\"text-align: center; border: 0px; width: 95%; margin-left:auto; margin-right:auto;\">\n"; echo "<tr><td style=\"text-align: center;\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n"; //echo "<tr><td width=\"50%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/search.jpg\" alt=\"\" /></td><td width=\"50%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SEARCHBOX."</span></td></tr>\n"; echo "<tr><td colspan=\"2\" style=\"text-align: center;\" nowrap=\"nowrap\" valign=\"middle\">"; if (($where == 'Shouts') || (empty($where))) { $wSEL1 = " selected=\"selected\""; } else { $wSEL1 = ''; } if ($where == 'Nicknames') { $wSEL2 = " selected=\"selected\""; } else { $wSEL2 = ''; } if ($where == 'Both') { $wSEL3 = " selected=\"selected\""; } else { $wSEL3 = ''; } echo "<select name=\"where\"> <option value=\"Shouts\"$wSEL1>"._SHOUTS."</option> <option value=\"Nicknames\"$wSEL2>"._SBNICKNAMES."</option> <option value=\"Both\"$wSEL3>"._SBBOTH."</option></select> "; if (($style == 'Exact') || (empty($style))) { $sSEL1 = " selected=\"selected\""; } else { $sSEL1 = ''; } if ($style == 'Any') { $sSEL2 = " selected=\"selected\""; } else { $sSEL2 = ''; } echo "<select name=\"style\"> <option value=\"Exact\"$sSEL1>"._EXACTPHRASE."</option> <option value=\"Any\"$sSEL2>"._FUZZY."</option> </select> "; if (($results == 10) || (empty($results))) { $rSEL10 = " selected=\"selected\""; } else { $rSEL10 = ''; } if ($results == 20) { $rSEL20 = " selected=\"selected\""; } else { $rSEL20 = ''; } if ($results == 30) { $rSEL30 = " selected=\"selected\""; } else { $rSEL30 = ''; } if ($results == 50) { $rSEL50 = " selected=\"selected\""; } else { $rSEL50 = ''; } echo "<select name=\"results\"> <option value=\"10\"$rSEL10>10 "._SBRESULTS."</option> <option value=\"20\"$rSEL20>20 "._SBRESULTS."</option> <option value=\"30\"$rSEL30>30 "._SBRESULTS."</option> <option value=\"50\"$rSEL50>50 "._SBRESULTS."</option></select> "; if (($order == 'newest') || (empty($order))) { $oSEL1 = " selected=\"selected\""; } else { $oSEL1 = ''; } if ($order == 'oldest') { $oSEL2 = " selected=\"selected\""; } else { $oSEL2 = ''; } echo "<select name=\"order\"> <option value=\"newest\"$oSEL1>"._NEWESTFIRST."</option> <option value=\"oldest\"$oSEL2>"._OLDESTFIRST."</option></select>"; echo "</td></tr><tr><td colspan=\"2\" style=\"text-align: center;\" nowrap=\"nowrap\" valign=\"middle\">"; echo "<input type=\"text\" name=\"sbsearchtext\" value=\"$sbsearchtext\" size=\"53\" maxlength=\"100\" /> "; echo "<input type=\"hidden\" name=\"Action\" value=\"Search\" /><input type=\"submit\" name=\"button\" value=\""._SBSEARCH."\" /></td></tr>"; echo "</table></form>"; } function shoutDelete($page, $shoutID) { global $username, $prefix, $conf; if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) { $sql = "SELECT `name` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; $nameresult = dbquery($sql); $row = dbrow($nameresult); dbfree($nameresult); if ($row['name'] == $username) { $sqlD = "DELETE FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; dbquery($sqlD); } } header("Location: modules.php?name=Shout_Box&page=$page"); exit; } function shoutEdit($page, $shoutID, $ShoutError) { global $prefix, $conf, $username; include_once(NUKE_BASE_DIR.'header.php'); OpenTable(); if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) { $sql = "SELECT `name`, `comment` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; $nameresult = dbquery($sql); $row = dbrow($nameresult); dbfree($nameresult); if ($row['name'] == $username) { // strip out link code here (added back in later if saved) $ShoutComment = $row['comment']; $ShoutComment = str_replace("[<a rel=\"nofollow\" target=\"_blank\" href=\"", "",$ShoutComment); $ShoutComment = str_replace("[<a rel=\"nofollow\" href=\"", "",$ShoutComment); $ShoutComment = str_replace("[<a target=\"_blank\" href=\"", "",$ShoutComment); $ShoutComment = str_replace("[<a href=\"", "",$ShoutComment); $ShoutComment = str_replace("\">URL</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">FTP</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">IRC</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">TeamSpeak</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">AIM</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">Gopher</a>]", "",$ShoutComment); $ShoutComment = str_replace("\">E-Mail</a>]", "",$ShoutComment); $i = 0; $ShoutNew = array(); $ShoutArray = explode(" ",$ShoutComment); foreach($ShoutArray as $ShoutPart) { if (preg_match("#mailto:#i", $ShoutPart)) { // find mailto: $ShoutPart = str_replace("mailto:", "",$ShoutPart); // strip out mailto: $ShoutPart = str_replace("%", " ",$ShoutPart); $ShoutPart = trim($ShoutPart); // decode address to ascii $c = 0; $AddyArray = explode(" ",$ShoutPart); foreach($AddyArray as $AddyPart) { $AddyNew[$c] = chr(hexdec($AddyPart)); $c++; } $ShoutPart = implode("",$AddyNew); $ShoutNew[$i] = "mailto:$ShoutPart"; // add mailto: back in } else { $ShoutNew[$i] = $ShoutPart; } $i++; } $ShoutComment = implode(" ",$ShoutNew); // strip smilies code here (added back in later if saved) $sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`"; $eresult = dbquery($sql); while ($emoticons = dbrow($eresult)) { $ShoutComment = str_replace($emoticons['image'],$emoticons['text'],$ShoutComment); } dbfree($eresult); echo "<form name=\"shoutedit\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n"; echo "<table cellpadding=\"3\" cellspacing=\"0\" style=\"text-align: center; width: 90%; border: 0px; margin-left:auto; margin-right:auto;\">\n"; echo "<tr><td style=\"text-align: center;\"><span class=\"title\"><strong>"._SHOUTBOXEDIT."</strong><br /><br /></span></td></tr>\n"; if (($ShoutError) && ($ShoutError != 'none')) { echo "<tr><td style=\"background: #FF3333;\"><strong>"._SB_NOTE.":</strong> $ShoutError</td></tr>"; } echo "<tr><td style=\"text-align: center;\"><input type=\"hidden\" name=\"shoutID\" value=\"$shoutID\" /><input type=\"text\" name=\"ShoutComment\" size=\"70\" value=\"$ShoutComment\" maxlength=\"2500\" />"; echo "<input type=\"hidden\" name=\"page\" value=\"$page\" /><input type=\"hidden\" name=\"Action\" value=\"Save\" /> <input type=\"submit\" name=\"button\" value=\""._UPDATE."\" /></td></tr>"; echo "<tr><td style=\"text-align: center;\"><a href=\"modules.php?name=Shout_Box&page=$page\">"._SHOUTHISTORY."</a></td></tr>"; echo "</table></form>"; } else { echo _EDITINGOTHERSDISALLOWED; } } else { echo _EDITINGDISABLEDBYADMIN; } CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } function shoutSave($page, $shoutID, $ShoutComment) { global $username, $prefix, $conf; if ($conf['delyourlastpost'] == "yes" && !empty($shoutID)) { $sql = "SELECT `name` FROM `".$prefix."_shoutbox_shouts` WHERE `id`='$shoutID'"; $nameresult = dbquery($sql); $row = dbrow($nameresult); dbfree($nameresult); if ($row['name'] == $username) { $ShoutComment = trim($ShoutComment); // remove whitespace off ends of shout $ShoutComment = preg_replace('/\s+/', ' ', $ShoutComment); // convert double spaces in middle of shout to single space $num = strlen($ShoutComment); if ($num < 1) { $ShoutError = _SHOUTTOOSHORT; } if ($num > 2500) { $ShoutError = _SHOUTTOOLONG; } if (!$ShoutComment) { $ShoutError = _NOSHOUT; } if ($ShoutComment == _SB_MESSAGE) { $ShoutError = _NOSHOUT; } $ShoutComment = str_replace(" [.] ", ".",$ShoutComment); if (preg_match("#.xxx#i", $ShoutComment) && $conf['blockxxx'] == "yes") { $ShoutError = _XXXBLOCKED; $ShoutComment = ''; } if (preg_match("#javascript:(.*)#i", $ShoutComment)) { $ShoutError = _JSINSHOUT; $ShoutComment = ''; } $ShoutComment = htmlspecialchars($ShoutComment, ENT_QUOTES); $ShoutComment = str_replace("&amp;", "&",$ShoutComment); // Scan for links in the shout. If there is, replace it with [URL] or block it if disallowed $i = 0; $ShoutNew = array(); $ShoutArray = explode(" ",$ShoutComment); if (is_array($ShoutArray)) { foreach($ShoutArray as $ShoutPart) { if (is_array($ShoutPart) == TRUE) { $ShoutPart = $ShoutPart[0]; } if (preg_match("#http://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } // fix for users adding text to the beginning of links: HACKhttp://www.website.com $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"http://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>]"; } elseif (preg_match("#ftp://#", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"ftp://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">FTP</a>]"; } elseif (preg_match("#irc://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"irc://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">IRC</a>]"; } elseif (preg_match("#teamspeak://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"teamspeak://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">TeamSpeak</a>]"; } elseif (preg_match("#aim:goim#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"aim:goim"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">AIM</a>]"; } elseif (preg_match("#gopher://#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"gopher://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[<a rel=\"nofollow\" href=\"$ShoutPart\">Gopher</a>]"; } elseif (preg_match("#mailto:#i", $ShoutPart)) { $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"mailto:"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } // email encoding to stop harvesters $ShoutPart = bin2hex($ShoutPart); $ShoutPart = chunk_split($ShoutPart, 2, '%'); $ShoutPart = '%' . substr($ShoutPart, 0, strlen($ShoutPart) - 1); $ShoutNew[$i] = "[<a href=\"$ShoutPart\">E-Mail</a>]"; } elseif (preg_match("#www.#i", $ShoutPart)) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"www."); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutPart = "http://" . $ShoutPart; $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>]"; } elseif (preg_match('#@#i', $ShoutPart) && preg_match('/[\.]/i', $ShoutPart)) { // \b[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}\b // email encoding to stop harvesters $ShoutPart = bin2hex($ShoutPart); $ShoutPart = chunk_split($ShoutPart, 2, '%'); $ShoutPart = '%' . substr($ShoutPart, 0, strlen($ShoutPart) - 1); $ShoutNew[$i] = "[<a href=\"mailto:$ShoutPart\">E-Mail</a>]"; } elseif ((preg_match("/\.(us|tv|cc|ws|ca|de|jp|ro|be|fm|ms|tc|ph|dk|st|ac|gs|vg|sh|kz|as|lt|to)/i", substr($ShoutPart, -3,3))) || (preg_match("/\.(com|net|org|mil|gov|biz|pro|xxx)/i", substr($ShoutPart, -4,4))) || (preg_match("/\.(info|name|mobi)/i", substr($ShoutPart, -5,5))) || (preg_match("/\.(co\.uk|co\.za|co\.nz|co\.il)/i", substr($ShoutPart, -6,6)))) { if ($conf['urlonoff'] == "no") { $ShoutError = _URLNOTALLOWED; break; } $ShoutPart = "http://" . $ShoutPart; $ShoutNew[$i] = "[<a rel=\"nofollow\" target=\"_blank\" href=\"$ShoutPart\">URL</a>]"; } elseif (strlen(html_entity_decode($ShoutPart, ENT_QUOTES)) > 21) { $ShoutNew[$i] = htmlspecialchars(wordwrap(html_entity_decode($ShoutPart, ENT_QUOTES), 21, " ", 1), ENT_QUOTES); $ShoutNew[$i] = str_replace("[ b]", " [b]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[b ]", " [b]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ /b]", "[/b] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/ b]", "[/b] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/b ]", "[/b] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ i]", " [i]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[i ]", " [i]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ /i]", "[/i] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/ i]", "[/i] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/i ]", "[/i] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ u]", " [u]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[u ]", " [u]",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[ /u]", "[/u] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/ u]", "[/u] ",$ShoutNew[$i]); $ShoutNew[$i] = str_replace("[/u ]", "[/u] ",$ShoutNew[$i]); } else { $ShoutNew[$i] = $ShoutPart; } $i++; } } if (empty($ShoutError)) { $ShoutComment = implode(" ",$ShoutNew); } //Smilies from database $ShoutArrayReplace = explode(" ",$ShoutComment); $ShoutArrayScan = $ShoutArrayReplace; $sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`"; $eresult = dbquery($sql); while ($emoticons = dbrow($eresult)) { $i = 0; foreach($ShoutArrayScan as $ShoutPart) { if ($ShoutPart == $emoticons['text']) { $ShoutArrayReplace[$i] = $emoticons['image']; } $i++; } } $ShoutComment = implode(" ",$ShoutArrayReplace); //look for bad words, then censor them. if($conf['censor'] == "yes") { $ShoutArrayReplace = explode(" ",$ShoutComment); $ShoutArrayScan = $ShoutArrayReplace; $sql = "SELECT * FROM `".$prefix."_shoutbox_censor`"; $cresult = dbquery($sql); while ($censor = dbrow($cresult)) { $i = 0; foreach($ShoutArrayScan as $ShoutPart) { $ShoutPart = strtolower($ShoutPart); $censor['text'] = strtolower($censor['text']); if ($ShoutPart == $censor['text']) { $ShoutArrayReplace[$i] = $censor['replacement']; } $i++; } } $ShoutComment = implode(" ",$ShoutArrayReplace); /* // Phrase censor - Needs work before implementing $sql = "SELECT * FROM ".$prefix."_shoutbox_emoticons"; $eresult = dbquery($sql); while ($emoticons = dbrow($eresult)) { $ShoutComment = str_replace($emoticons[1],$emoticons[2],$ShoutComment); } */ } if (!$ShoutError) { $sqlU = "UPDATE `".$prefix."_shoutbox_shouts` set `comment`='$ShoutComment' WHERE `id`='$shoutID'"; dbquery($sqlU); } else { header("Location: modules.php?name=Shout_Box&Action=Edit&shoutID=$shoutID&page=$page&ShoutError=$ShoutError"); exit; } } } header("Location: modules.php?name=Shout_Box&page=$page"); exit; } function findAvatar($row_avatar) { global $prefix; // Find avatar path // modules/Forums/images/avatars/gallery $sql = "SELECT * FROM `".$prefix."_bbconfig` WHERE `config_name`='avatar_gallery_path'"; $result = dbquery($sql); $avatar_gallery_path = dbrow($result); dbfree($result); // modules/Forums/images/avatars $sql = "SELECT * FROM ".$prefix."_bbconfig WHERE config_name='avatar_path'"; $result = dbquery($sql); $avatar_path = dbrow($result); dbfree($result); if (preg_match('#http://#i',$row_avatar) == TRUE) { // offsite avatars $AvatarFound = "<img src=\"$row_avatar\" alt=\"\" /></td>"; } else { $agp = $avatar_gallery_path['config_value'].'/'.$row_avatar; $ap = $avatar_path['config_value'].'/'.$row_avatar; if (file_exists($agp) == TRUE) { $AvatarFound = "<img src=\"".$avatar_gallery_path['config_value']."/$row_avatar\" alt=\"\" /></td>"; } elseif (file_exists($ap) == TRUE) { $AvatarFound = "<img src=\"".$avatar_path['config_value']."/$row_avatar\" alt=\"\" /></td>"; } else { $AvatarFound = "<img src=\"".$avatar_path['config_value']."/blank.gif\" alt=\"\" /></td>"; } } return $AvatarFound; } function showHistory($page) { global $prefix, $username, $userinfo, $board_config; include_once(NUKE_BASE_DIR.'header.php'); global $conf; // count number of shouts in DB $sql = "SELECT id FROM ".$prefix."_shoutbox_shouts"; $result = dbquery($sql); $numrows = dbnumrows($result); dbfree($result); $shout_pages = 1; $shoutsViewed = $conf['shoutsperpage']; while ($numrows >= $shoutsViewed) { $shout_pages++; $numrows = ($numrows - $shoutsViewed); } if ($shout_pages == 0) { $shout_pages = 1; } if (!$page) { $page = 1; } if ($page < 1) { $page = 1; } if ($page > $shout_pages) { $page = $shout_pages; } if ($page > 1) { $offset = ($page * $shoutsViewed); $offset1 = ($offset - $shoutsViewed); } else { $offset1 = 0; } // search form OpenTable(); $sbsearchtext = ''; $where = ''; $style = ''; $results = ''; $order = ''; showSearchBox($sbsearchtext, $where, $style, $results, $order); CloseTable(); echo "<br />"; OpenTable(); $flag = 1; $ThemeSel = get_theme(); $sql = "SELECT `menuColor1`, `menuColor2` FROM `".$prefix."_shoutbox_themes` WHERE `themeName`='$ThemeSel'"; $result = dbquery($sql); $rowColor = dbrow($result); dbfree($result); echo "<form name=\"shoutform2\" method=\"post\" action=\"\" style=\"margin-bottom: 0px;\">\n"; echo "<table cellpadding=\"3\" cellspacing=\"0\" style=\"width: 90%; border: 0px; margin-left:auto; margin-right:auto;\">\n"; echo "<tr><td style=\"text-align: center;\"><span class=\"title\">"._SHOUTBOXHISTORY."</span></td></tr>\n"; //echo "<tr><td><table cellpadding=\"0\" width=\"100%\" cellspacing=\"0\" border=\"0\"><tr><td width=\"45%\" align=\"right\"><img width=\"50\" height=\"39\" src=\"modules/Shout_Box/history.gif\" alt=\"\" /></td><td width=\"55%\" align=\"left\" valign=\"middle\"><span class=\"title\">"._SHOUTBOXHISTORY."</span></td></tr></table></td></tr>\n"; $sql = "SELECT * FROM `".$prefix."_shoutbox_shouts` ORDER BY `id` DESC LIMIT ".$offset1.",$shoutsViewed"; $resultt = dbquery($sql); while ($row = dbrow($resultt)) { if ($flag == 1) { $bgcolor = $rowColor['menuColor1']; } if ($flag == 2) { $bgcolor = $rowColor['menuColor2']; } $comment = str_replace('src=', 'src="', $row['comment']); $comment = str_replace('.gif>', '.gif" alt="" />', $comment); $comment = str_replace('.jpg>', '.jpg" alt="" />', $comment); $comment = str_replace('.png>', '.png" alt="" />', $comment); $comment = str_replace('.bmp>', '.bmp" alt="" />', $comment); // BB code [b]word[/b] [i]word[/i] [u]word[/u] if ((preg_match("#[b]#i", $comment)) && (preg_match("#[/b]#i", $comment)) && (substr_count($comment,"[b]") == substr_count($comment,"[/b]"))) { $comment = str_replace("[b]","<span style=\"font-weight: bold\">",$comment); $comment = str_replace("[/b]","</span>",$comment); } if ((preg_match("#[i]#i", $comment)) && (preg_match("#[/i]#i", $comment)) && (substr_count($comment,"[i]") == substr_count($comment,"[/i]"))) { $comment = str_replace("[i]","<span style=\"font-style: italic\">",$comment); $comment = str_replace("[/i]","</span>",$comment); } if ((preg_match("#[u]#i", $comment)) && (preg_match("#[/u]#i", $comment)) && (substr_count($comment,"[u]") == substr_count($comment,"[/u]"))) { $comment = str_replace("[u]","<span style=\"text-decoration: underline\">",$comment); $comment = str_replace("[/u]","</span>",$comment); } $sqlN = "SELECT `user_avatar`, `username` FROM `".$prefix."_users` WHERE username='$row[name]'"; $nameresultN = dbquery($sqlN); $rowN = dbrow($nameresultN); dbfree($nameresultN); // Disallow Anonymous users from seeing links to users' accounts if ($username == "Anonymous") { if (!empty($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo "$av_found"; echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } else { // check to see if nickname is a user in the DB && not Anonymous if (is_array($rowN) && ($rowN['username'] != "Anonymous")) { if (!empty($rowN['user_avatar']) && ($rowN['user_avatar'] != "blank.gif") && ($rowN['user_avatar'] != "gallery/blank.gif") && (stristr($rowN['user_avatar'],'.') == TRUE)) { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\" border=\"0\">"; echo "<tr><td valign='top' style=\"background-color: $bgcolor;\">"; $row_avatar = $rowN['user_avatar']; $av_found = findAvatar($row_avatar); echo "$av_found"; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<td valign='top' width='100%' style=\"background-color: $bgcolor;\"><strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo $unixTime; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo $unixTime; } } else { echo $row['date']." ".$row['time']; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr></table>"; echo "</td></tr>\n"; } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; /*****[BEGIN]****************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ echo "<strong><a href=\"modules.php?name=Your_Account&op=userinfo&username=".$row['name']."\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />"; /*****[END]******************************************** [ Mod: Advanced Username Color v1.0.5 ] ******************************************************/ if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo $unixTime; } } else { echo "$row[date] $row[time]"; } } // registered users edit/delete posts if (($conf['delyourlastpost'] == "yes") && ($username == $row['name'])) { echo " [ <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&Action=Edit&shoutID=".$row['id']."&page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&Action=Delete&shoutID=".$row['id']."&page=$page\">"._DELETE."</a> ]"; } echo "</td></tr>\n"; } } else { echo "<tr><td style=\"background-color: $bgcolor;\">"; echo "<strong>$row[name]:</strong> $comment"; if ($conf['date'] == "yes") { if (!empty($row['timestamp'])) { // reads unix timestamp && formats it to the viewer's timezone if (is_user()) { $unixTime = EvoDate($userinfo['user_dateformat'], $row['timestamp'], $userinfo['user_timezone']); echo "<br />$unixTime"; } else { $unixTime = EvoDate($board_config['default_dateformat'], $row['timestamp'], $board_config['board_timezone']); echo "<br />$unixTime"; } } else { echo "<br />".$row['date']." ".$row['time']; } } echo "</td></tr>\n"; } } if ($flag == 1) { $flag = 2; } elseif ($flag == 2) { $flag =1; } } echo "<tr><td style=\"text-align: center;\">"; $num1 = ($page-4); if ($num1 < 1) { $num1 = 1; } $num2 = ($num1+8); if ($num2 > $shout_pages) { $num2 = $shout_pages; } $num5 = ($num2-8); if ($num5 < $num1) { $num1 = $num5; if ($num1 < 1) { $num1 = 1; } } $num3 = ($page-1); $num4 = ($page+1); $menuLinks = ''; $count = $num1; while ($count <= $shout_pages && $count <= $num2) { if ($count == $page) { $menuLinks .= "<strong>$count</strong>"; } else { $menuLinks .= "<a href=\"modules.php?name=Shout_Box&page=$count\">$count</a>"; } if ($count < $num2) { $menuLinks .= " "; } $count++; } $menuLinks .= "<br /><br />"; if ($page > 1) { $menuLinks .= "<a href=\"modules.php?name=Shout_Box&page=$num3\">"._PREVIOUS."</a> \n"; } if ($page != $shout_pages) { $menuLinks .= _PAGE." $page / <a href=\"modules.php?name=Shout_Box&page=$shout_pages\">$shout_pages</a>\n"; } else { $menuLinks .= _PAGE." $page / $shout_pages\n"; } if ($page < $shout_pages) { $menuLinks .= " <a href=\"modules.php?name=Shout_Box&page=$num4\">"._NEXT."</a>\n"; } echo "$menuLinks"; echo "</td></tr></table></form>"; // End menu build CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } function showBanned() { include_once(NUKE_BASE_DIR.'header.php'); OpenTable(); echo "<br /><p class=\"title\" style=\"text-align: center;\"><strong>"._YOUAREBANNEDM."</strong></p><br />"; CloseTable(); include_once(NUKE_BASE_DIR.'footer.php'); } $page = (isset($_REQUEST['page'])) ? (int)$_REQUEST['page'] : 1; $shoutID = (isset($_REQUEST['shoutID'])) ? (int)$_REQUEST['shoutID'] : ''; $where = (isset($_POST['where'])) ? $_POST['where'] : ''; $sbsearchtext = (isset($_POST['sbsearchtext'])) ? $_POST['sbsearchtext'] : ''; $results = (isset($_POST['results'])) ? (int)$_POST['results'] : 0; $order = (isset($_POST['order'])) ? $_POST['order'] : ''; $style = (isset($_POST['style'])) ? $_POST['style'] : ''; $ShoutError = (isset($_REQUEST['ShoutError'])) ? $_REQUEST['ShoutError'] : ''; $ShoutComment = (isset($_POST['ShoutComment'])) ? $_POST['ShoutComment'] : ''; switch($Action) { case "UserBanned": showBanned(); break; case "Search": searchHistory($where, $sbsearchtext, $results, $style, $order, $page); break; case "Delete": shoutDelete($page, $shoutID); break; case "Edit": if (empty($ShoutError)) { $ShoutError = 'none'; } shoutEdit($page, $shoutID, $ShoutError); break; case "Save": shoutSave($page, $shoutID, $ShoutComment); break; default: showHistory($page); break; } ?>
Trovare la differenza