index.php

Criado O diff nunca expira
48 remoções
461 linhas
60 adições
462 linhas
<?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;


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`";
$result = $db->sql_query($sql);
$result = dbquery($sql);
$conf = $db->sql_fetchrow($result);
$conf = dbrow($result);
$cache->save('conf', 'shoutbox', $conf);
$cache->save('conf', 'shoutbox', $conf);
$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";
$ipresult = $db->sql_query($sql);
$ipresult = dbquery($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";
$nameresult = $db->sql_query($sql);
$nameresult = dbquery($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) {
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);
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&amp;page=1\">"._SHOUTHISTORY."</a></td></tr></table>";
echo "<tr><td style=\"text-align: center;\"><a href=\"modules.php?name=Shout_Box&amp;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; }


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
$result = $db->sql_query($sql);
$result = dbquery($sql);
$numrows = $db->sql_numrows($result);
$numrows = dbnumrows($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'";
$resultT = $db->sql_query($sql);
$resultT = dbquery($sql);
$rowColor = $db->sql_fetchrow($resultT);
$rowColor = dbrow($resultT);
$db->sql_freeresult($resultT);
dbfree($resultT);


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']."'";
$nameresultN = $db->sql_query($sqlN);
$nameresultN = dbquery($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']."&nbsp;".$row['time'];
echo "<br />".$row['date']."&nbsp;".$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']."&nbsp;".$row['time'];
echo "<br />".$row['date']."&nbsp;".$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&amp;op=userinfo&amp;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&amp;op=userinfo&amp;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']."&nbsp;".$row['time'];
echo $row['date']."&nbsp;".$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 " &#91; <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&amp;Action=Edit&amp;shoutID=".$row['id']."&amp;page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&amp;Action=Delete&amp;shoutID=".$row['id']."&amp;page=$page\">"._DELETE."</a> &#93;";
echo " &#91; <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&amp;Action=Edit&amp;shoutID=".$row['id']."&amp;page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&amp;Action=Delete&amp;shoutID=".$row['id']."&amp;page=$page\">"._DELETE."</a> &#93;";
}
}
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&amp;op=userinfo&amp;username=$row[name]\">" . UsernameColor($row['name']) . "</a>:</strong> $comment<br />";
echo "<strong><a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;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']."&nbsp;".$row['time'];
echo $row['date']."&nbsp;".$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 " &#91; <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&amp;Action=Edit&amp;shoutID=".$row['id']."&amp;page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&amp;Action=Delete&amp;shoutID=".$row['id']."&amp;page=$page\">"._DELETE."</a> &#93;";
echo " &#91; <a title=\""._EDIT."\" href=\"modules.php?name=Shout_Box&amp;Action=Edit&amp;shoutID=".$row['id']."&amp;page=$page\">"._EDIT."</a> | <a title=\""._DELETE."\" href=\"modules.php?name=Shout_Box&amp;Action=Delete&amp;shoutID=".$row['id']."&amp;page=$page\">"._DELETE."</a> &#93;";
}
}
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']."&nbsp;".$row['time'];
echo "<br />".$row['date']."&nbsp;".$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; }
}
}
$db->sql_freeresult($result);
dbfree($result);
} else {
} else {
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";
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";
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>&nbsp;&nbsp;";
<option value=\"Both\"$wSEL3>"._SBBOTH."</option></select>&nbsp;&nbsp;";


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>&nbsp;&nbsp;";
</select>&nbsp;&nbsp;";


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>&nbsp;&nbsp;";
<option value=\"50\"$rSEL50>50 "._SBRESULTS."</option></select>&nbsp;&nbsp;";


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>";


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\" />&nbsp;&nbsp;";
echo "<input type=\"text\" name=\"sbsearchtext\" value=\"$sbsearchtext\" size=\"53\" maxlength=\"100\" />&nbsp;&nbsp;";
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) {
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'";
$nameresult = $db->sql_query($sql);
$nameresult = dbquery($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'";
$db->sql_query($sqlD);
dbquery($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) {
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'";
$nameresult = $db->sql_query($sql);
$nameresult = dbquery($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("&#91;<a rel=\"nofollow\" target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("&#91;<a rel=\"nofollow\" target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("&#91;<a rel=\"nofollow\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("&#91;<a rel=\"nofollow\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("&#91;<a target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("&#91;<a target=\"_blank\" href=\"", "",$ShoutComment);
$ShoutComment = str_replace("&#91;<a href=\"", "",$ShoutComment);
$ShoutComment = str_replace("&#91;<a href=\"", "",$ShoutComment);
$ShoutComment = str_replace("\">URL</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">URL</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">FTP</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">FTP</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">IRC</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">IRC</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">TeamSpeak</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">TeamSpeak</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">AIM</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">AIM</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">Gopher</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">Gopher</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">E-Mail</a>&#93;", "",$ShoutComment);
$ShoutComment = str_replace("\">E-Mail</a>&#93;", "",$ShoutComment);


$i = 0;
$i = 0;
$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)
$sql = "SELECT * FROM `".$prefix."_shoutbox_emoticons`";