sql_query($sqlV); $confV = $db->sql_fetchrow($resultV); if ($confV['Version_Num'] >= '7.6') { $preURL = 'index.php?url='; } else { $preURL = ''; } } if ($currentlang) { include_once("modules/Shout_Box/lang-block/lang-$currentlang.php"); } else { include_once("modules/Shout_Box/lang-block/lang-english.php"); } $PreviousShoutComment = $ShoutComment; include("config.php"); cookiedecode($user); $username = $cookie[1]; if ($username == "") { $username = "Anonymous"; } $sql = "select * from ".$prefix."_shoutbox_conf"; $result = $db->sql_query($sql); $conf = $db->sql_fetchrow($result); // Check if block is in center position $sql = "select bposition from ".$prefix."_blocks where blockfile='block-Shout_Box.php'"; $SBpos = $db->sql_query($sql); $SBpos = $db->sql_fetchrow($SBpos); if ($SBpos['bposition'] == 'c' || $SBpos['bposition'] == 'd') { $SBpos = 'center'; $SBborder = 1; } else { $SBpos = 'side'; $SBborder = 0; } // Find user's IP if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) { $uip = getenv("HTTP_CLIENT_IP"); } else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) { $uip = getenv("HTTP_X_FORWARDED_FOR"); } else if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) { $uip = getenv("REMOTE_ADDR"); } else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) { $uip = $_SERVER['REMOTE_ADDR']; } else { $uip = ""; } if ($uip == 'unknown') { $uip = $_SERVER['REMOTE_ADDR']; } if ($uip == "") { $uip = $_SERVER['REMOTE_ADDR']; } if ($uip == "") { $uip = "noip"; } if ($uip == 'unknown') { $uip = "noip"; } //do IP test then ban if on list if($conf['ipblock'] == "yes") { $sql = "select * from ".$prefix."_shoutbox_ipblock"; $ipresult = $db->sql_query($sql); while ($badips = $db->sql_fetchrow($ipresult)) { if (eregi("\*", $badips['name'])) { // Allow for Subnet bans like 123.456.* $badipsArray = explode(".",$badips['name']); $uipArray = explode(".",$uip); $i = 0; foreach($badipsArray as $badipsPart) { if ($badipsPart == "*") { $BannedShouter = "yes"; break; } if ($badipsPart != $uipArray[$i] AND $badipsPart != "*") { break; } $i++; } } else { if($uip == $badips['name']) { $BannedShouter = "yes"; break; } } } } //do name test then ban if on list (only applies to registered users) if ($conf['nameblock'] == "yes" AND $BannedShouter != "yes") { $sql = "select * from ".$prefix."_shoutbox_nameblock"; $nameresult = $db->sql_query($sql); while ($badname = $db->sql_fetchrow($nameresult)){ if ($username == $badname['name']) { $BannedShouter = "yes"; break; } } } if ($BannedShouter != "yes") { if ($ShoutSubmit == "ShoutPost") { // start processing shout if ($shoutuid) { $username = "$shoutuid"; } //shoutuid tests $username = trim($username); // remove whitespace off ends of nickname if($conf['anonymouspost'] == "yes") { $unum = strlen($username); if ($unum < 2) { $ShoutError = ""._NICKTOOSHORT.""; } if (!$username OR $username == ""._NAME."") { $ShoutError = ""._NONICK.""; } if (eregi(".xxx", $username) AND $conf['blockxxx'] == "yes") { $username = "Anonymous"; } if (eregi("javascript:(.*)", $username)) { $username = "Anonymous"; } $username = htmlspecialchars($username, ENT_QUOTES); $username = ereg_replace("&amp;", "&",$username); } if (!is_user($user) && ($username) && $username != "Anonymous") { $username = ereg_replace(" ", "_",$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 = ereg_replace(" [.] ", ".",$ShoutComment); if (eregi(".xxx", $ShoutComment) AND $conf['blockxxx'] == "yes") { $ShoutError = ""._XXXBLOCKED.""; $PreviousShoutComment = ""; } if (eregi("javascript:(.*)", $ShoutComment)) { $ShoutError = ""._JSINSHOUT.""; $PreviousShoutComment = ""; } $ShoutComment = htmlspecialchars($ShoutComment, ENT_QUOTES); $ShoutComment = ereg_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); foreach($ShoutArray as $ShoutPart) { if (is_array($ShoutPart) == TRUE) { $ShoutPart = $ShoutPart[0]; } if (eregi("http:\/\/", $ShoutPart)) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($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] = "[URL]"; } elseif (eregi("ftp:\/\/", $ShoutPart)) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($conf['urlonoff'] == "no"))) { $ShoutError = ""._URLNOTALLOWED.""; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"ftp://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[FTP]"; } elseif (eregi("irc:\/\/", $ShoutPart)) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($conf['urlonoff'] == "no"))) { $ShoutError = ""._URLNOTALLOWED.""; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"irc://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[IRC]"; } elseif (eregi("teamspeak:\/\/", $ShoutPart)) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($conf['urlonoff'] == "no"))) { $ShoutError = ""._URLNOTALLOWED.""; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"teamspeak://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[TeamSpeak]"; } elseif (eregi("aim:goim", $ShoutPart)) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($conf['urlonoff'] == "no"))) { $ShoutError = ""._URLNOTALLOWED.""; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"aim:goim"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[AIM]"; } elseif (eregi("gopher:\/\/", $ShoutPart)) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($conf['urlonoff'] == "no"))) { $ShoutError = ""._URLNOTALLOWED.""; break; } $ShoutPartL = strtolower($ShoutPart); $spot = strpos($ShoutPartL,"gopher://"); if ($spot > 0) { $ShoutPart = substr($ShoutPart, $spot); } $ShoutNew[$i] = "[Gopher]"; } elseif (eregi("mailto:", $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] = "[E-Mail]"; } elseif (eregi("www\.", $ShoutPart)) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($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] = "[URL]"; } elseif (eregi('@', $ShoutPart) AND eregi('\.', $ShoutPart)) { // email encoding to stop harvesters $ShoutPart = bin2hex($ShoutPart); $ShoutPart = chunk_split($ShoutPart, 2, '%'); $ShoutPart = '%' . substr($ShoutPart, 0, strlen($ShoutPart) - 1); $ShoutNew[$i] = "[E-Mail]"; } elseif ((eregi("\.(us|tv|cc|ws|ca|de|jp|ro|be|fm|ms|tc|ph|dk|st|ac|gs|vg|sh|kz|as|lt|to)", substr("$ShoutPart", -3,3))) OR (eregi("\.(com|net|org|mil|gov|biz|pro|xxx)", substr("$ShoutPart", -4,4))) OR (eregi("\.(info|name|mobi)", substr("$ShoutPart", -5,5))) OR (eregi("\.(co\.uk|co\.za|co\.nz|co\.il)", substr("$ShoutPart", -6,6)))) { if (((!is_user($user)) AND ($conf['urlanononoff'] == "no")) OR ((is_user($user)) AND ($conf['urlonoff'] == "no"))) { $ShoutError = ""._URLNOTALLOWED.""; break; } $ShoutPart = "http://" . $ShoutPart; $ShoutNew[$i] = "[URL]"; } 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 ($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); //do name test then error if on list if($conf['nameblock'] == "yes"){ $sql = "select * from ".$prefix."_shoutbox_nameblock"; $nameresult = $db->sql_query($sql); while ($badname = $db->sql_fetchrow($nameresult)){ if($username == $badname['name']) { $ShoutError = ""._BANNEDNICK.""; } } } // check for anonymous users cloning/ghosting registered users' nicknames cookiedecode($user); if (!is_user($user) && ($username) && $username != "Anonymous") { $sql = "select * from ".$prefix."_users where username='$username'"; $nameresult = $db->sql_query($sql); $row = $db->sql_fetchrow($nameresult); if ($row) { $ShoutError = ""._NOCLONINGNICKS.""; } } //look for bad words, then censor them. if($conf['censor'] == "yes") { // start Anonymous nickname censor check here. If bad, replace bad nick with 'Anonymous' if (!is_user($user) && ($username) && $username != "Anonymous") { $sql = "select * from ".$prefix."_shoutbox_censor"; $cresult = $db->sql_query($sql); while ($censor = $db->sql_fetchrow($cresult)) { if ($username != 'Anonymous') { $one = strtolower($censor['text']); $usernameL = strtolower($username); if (stristr($usernameL, $one) !== false) { $username = "Anonymous"; } } } } // Censor of posting text $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['text'],$emoticons['image'],$ShoutComment); } */ } // duplicate posting checker. stops repeated spam attacks $sql = "select * from ".$prefix."_shoutbox_shouts order by id DESC LIMIT 5"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { if ($row['comment'] == $ShoutComment) { $ShoutError = ""._DUPLICATESHOUT.""; } } if ($conf['anonymouspost'] == "no" && $username == "Anonymous") { $ShoutError = ""._ONLYREGISTERED2.""; } if (!$ShoutError) { $sql = "select * from ".$prefix."_shoutbox_date"; $resultD = $db->sql_query($sql); $rowD = $db->sql_fetchrow($resultD); // Special thanks to JRSweets for tipping me off to the timestamp option in date() if ($conf['timeOffset'] == 0) { $day = date("$rowD[date]"); $time = date("$rowD[time]"); } elseif (strstr($conf['timeOffset'], '+')) { $sbTimeMultiplier = str_replace('+', '', $conf['timeOffset']); $sbTimeOffset = $sbTimeMultiplier * 3600; $sbTimeTemp = time(); $time = date("$rowD[time]", ($sbTimeTemp + $sbTimeOffset)); $day = date("$rowD[date]", ($sbTimeTemp + $sbTimeOffset)); } else { $sbTimeMultiplier = str_replace('-', '', $conf['timeOffset']); $sbTimeOffset = $sbTimeMultiplier * 3600; $sbTimeTemp = time(); $time = date("$rowD[time]", ($sbTimeTemp - $sbTimeOffset)); $day = date("$rowD[date]", ($sbTimeTemp - $sbTimeOffset)); } $currentTime = time(); $sql = "INSERT INTO ".$prefix."_shoutbox_shouts (id,name,comment,date,time,ip,timestamp) VALUES ('0','$username','$ShoutComment','$day','$time','$uip','$currentTime')"; $db->sql_query($sql); // if v7.0 of nuke or higher, add points earned per shout $sqlVer = "select * from ".$prefix."_config"; $resultVer = $db->sql_query($sqlVer); $confVer = $db->sql_fetchrow($resultVer); if (is_user($user) AND $confVer['Version_Num'] >= '7.0' AND $conf['pointspershout'] > 0) { $sqlP = "select user_id,points from ".$prefix."_users WHERE username='$username'"; $resultP = $db->sql_query($sqlP); $userP = $db->sql_fetchrow($resultP); $userPoints = $userP['points'] + $conf['pointspershout']; $sqlP = "UPDATE ".$prefix."_users set points='$userPoints' where user_id='$userP[user_id]'"; $db->sql_query($sqlP); } $PreviousShoutComment = ""; $PreviousComment = ""; } else { if ($username != ""._NAME."") { $PreviousUsername = $username; } if ($PreviousShoutComment != ""._SB_MESSAGE."") { $PreviousComment = $PreviousShoutComment; } } } //Display Content From here on down if (!is_user($user) && ($username) && $username != "Anonymous") { $username = "Anonymous"; } $ThemeSel = get_theme(); $sql = "select * from ".$prefix."_shoutbox_theme_images WHERE themeName='$ThemeSel'"; $result = $db->sql_query($sql); $themeRow = $db->sql_fetchrow($result); if ($themeRow['blockBackgroundImage'] != '' AND file_exists("modules/Shout_Box/images/background/$themeRow[blockBackgroundImage]")) { $showBackground = 'yes'; } else { $showBackground = 'no'; } if (file_exists("modules/Shout_Box/images/up/$themeRow[blockArrowColor]") AND $themeRow['blockArrowColor'] != '') { $up_img = "modules/Shout_Box/images/up/$themeRow[blockArrowColor]"; } else { $up_img = "modules/Shout_Box/images/up/Black.gif"; } if (file_exists("modules/Shout_Box/images/down/$themeRow[blockArrowColor]") AND $themeRow['blockArrowColor'] != '') { $down_img = "modules/Shout_Box/images/down/$themeRow[blockArrowColor]"; } else { $down_img = "modules/Shout_Box/images/down/Black.gif"; } if (file_exists("modules/Shout_Box/images/pause/$themeRow[blockArrowColor]") AND $themeRow['blockArrowColor'] != '') { $pause_img = "modules/Shout_Box/images/pause/$themeRow[blockArrowColor]"; } else { $pause_img = "modules/Shout_Box/images/pause/Black.gif"; } $sql = "select * from ".$prefix."_shoutbox_shouts order by id DESC LIMIT $conf[number]"; $result = $db->sql_query($sql); // Top half // shout error reporting $top_content = ""; if ($ShoutError) { $top_content .= "
"._SB_NOTE.": $ShoutError
"; } // table that holds the scrolling area if ($showBackground == 'yes') { $top_content .= "
\n"; } else { $top_content .= "
\n"; } // end top content // table of the actual scrolling content if ($showBackground == 'yes') { $mid_content = ""; } else { $mid_content = "
"; } $flag = 1; $ThemeSel = get_theme(); $sql = "select * from ".$prefix."_shoutbox_themes WHERE themeName='$ThemeSel'"; $resultT = $db->sql_query($sql); $rowColor = $db->sql_fetchrow($resultT); if (is_user($user)) { $username = $cookie[1]; if ($username != '') { $sqlF = "SELECT user_timezone, user_dateformat from ".$prefix."_users WHERE username='$username'"; $resultF = $db->sql_query($sqlF); $userSetup = $db->sql_fetchrow($resultF); } } $sql = "select * from ".$prefix."_shoutbox_date"; $resultD = $db->sql_query($sql); $rowD = $db->sql_fetchrow($resultD); // Sticky shouts $sql = "select * from ".$prefix."_shoutbox_sticky where stickySlot=0"; $stickyResult = $db->sql_query($sql); $stickyRow0 = $db->sql_fetchrow($stickyResult); $sql = "select * from ".$prefix."_shoutbox_sticky where stickySlot=1"; $stickyResult = $db->sql_query($sql); $stickyRow1 = $db->sql_fetchrow($stickyResult); if ($stickyRow0) { if ($showBackground == 'yes') { $mid_content .= ""; } if ($stickyRow1) { if ($showBackground == 'yes') { $mid_content .= ""; } // end sticky shouts $i = 0; while ($row = $db->sql_fetchrow($result)) { if ($flag == 1) { $bgcolor = $rowColor['blockColor1']; } if ($flag == 2) { $bgcolor = $rowColor['blockColor2']; } if ($showBackground == 'yes') { $tempContent[$i] = ""; if ($flag == 1) { $flag = 2; } elseif ($flag == 2) { $flag = 1; } $i++; } // Reversing the posts if ($conf['reversePosts'] == "no") { for ($j = 0; $j < $conf['number']; $j++) { $mid_content .= $tempContent[$j]; } } else { for ($j = $conf['number']; $j >= 0; $j = $j - 1) { $mid_content .= $tempContent[$j]; } } // You may not remove or edit this copyright!!! Doing so violates the GPL license. $mid_content .= "
"; } else { if ($flag == 1) { $flag = 2; } elseif ($flag == 2) { $flag = 1; } $mid_content .= "
"; } $mid_content .= ""._SB_ADMIN.": $stickyRow0[comment]"; if ($conf['date'] == "yes") { if (is_user($user)) { // add time adjustment for following user's timezone $displayTime = $userSetup['user_timezone'] - $conf['serverTimezone']; $displayTime = $displayTime * 3600; $newTimestamp = $stickyRow0['timestamp'] + $displayTime; $unixTime = date("$userSetup[user_dateformat]", $newTimestamp); $mid_content .= "
$unixTime"; } else { $unixDay = date("$rowD[date]", $stickyRow0['timestamp']); $unixTime = date("$rowD[time]", $stickyRow0['timestamp']); $mid_content .= "
$unixDay $unixTime"; } } $mid_content .= "
"; } else { if ($flag == 1) { $flag = 2; } elseif ($flag == 2) { $flag = 1; } $mid_content .= "
"; } $mid_content .= ""._SB_ADMIN.": $stickyRow1[comment]"; if ($conf['date'] == "yes") { if (is_user($user)) { // add time adjustment for following user's timezone $displayTime = $userSetup['user_timezone'] - $conf['serverTimezone']; $displayTime = $displayTime * 3600; $newTimestamp = $stickyRow1['timestamp'] + $displayTime; $unixTime = date("$userSetup[user_dateformat]", $newTimestamp); $mid_content .= "
$unixTime"; } else { $unixDay = date("$rowD[date]", $stickyRow1['timestamp']); $unixTime = date("$rowD[time]", $stickyRow1['timestamp']); $mid_content .= "
$unixDay $unixTime"; } } $mid_content .= "
"; } else { $tempContent[$i] = "
"; } $ShoutComment = str_replace('src=', 'src="', $row['comment']); $ShoutComment = str_replace('.gif>', '.gif" alt="" />', $ShoutComment); $ShoutComment = str_replace('.jpg>', '.jpg" alt="" />', $ShoutComment); $ShoutComment = str_replace('.png>', '.png" alt="" />', $ShoutComment); $ShoutComment = str_replace('.bmp>', '.bmp" alt="" />', $ShoutComment); $ShoutComment = str_replace("http:", "".$preURL."http:", $ShoutComment); $ShoutComment = str_replace("ftp:", "".$preURL."ftp:", $ShoutComment); // BB code [b]word[/b] [i]word[/i] [u]word[/u] if ((eregi("[b]", $ShoutComment)) AND (eregi("[/b]", $ShoutComment)) AND (substr_count("$ShoutComment","[b]") == substr_count("$ShoutComment","[/b]"))) { $ShoutComment = eregi_replace("\[b\]","","$ShoutComment"); $ShoutComment = eregi_replace("\[\/b\]","","$ShoutComment"); } if ((eregi("[i]", $ShoutComment)) AND (eregi("[/i]", $ShoutComment)) AND (substr_count("$ShoutComment","[i]") == substr_count("$ShoutComment","[/i]"))) { $ShoutComment = eregi_replace("\[i\]","","$ShoutComment"); $ShoutComment = eregi_replace("\[\/i\]","","$ShoutComment"); } if ((eregi("[u]", $ShoutComment)) AND (eregi("[/u]", $ShoutComment)) AND (substr_count("$ShoutComment","[u]") == substr_count("$ShoutComment","[/u]"))) { $ShoutComment = eregi_replace("\[u\]","","$ShoutComment"); $ShoutComment = eregi_replace("\[\/u\]","","$ShoutComment"); } if ($username == "Anonymous") { $tempContent[$i] .= "$row[name]: $ShoutComment"; } else { // check to see if nickname is a user in the DB $sqlN = "select * from ".$prefix."_users where username='$row[name]'"; $nameresultN = $db->sql_query($sqlN); $rowN = $db->sql_fetchrow($nameresultN); if (($rowN) AND ($row['name'] != "Anonymous")) { $tempContent[$i] .= "$row[name]: $ShoutComment"; } else { $tempContent[$i] .= "$row[name]: $ShoutComment"; } } if ($conf['date'] == "yes") { if ($row['timestamp'] != '') { // reads unix timestamp and formats it to the viewer's timezone if (is_user($user)) { // time adjustment for following user's timezone $displayTime = $userSetup['user_timezone'] - $conf['serverTimezone']; $displayTime = $displayTime * 3600; $newTimestamp = $row['timestamp'] + $displayTime; $unixTime = date("$userSetup[user_dateformat]", $newTimestamp); $tempContent[$i] .= "
$unixTime"; } else { // adjustmet for timezone offset $displayTime = $conf['timeOffset'] * 3600; $newTimestamp = $row['timestamp'] + $displayTime; $unixDay = date("$rowD[date]", $newTimestamp); $unixTime = date("$rowD[time]", $newTimestamp); $tempContent[$i] .= "
$unixDay $unixTime"; } } else { $tempContent[$i] .= "
$row[date] $row[time]"; } } $tempContent[$i] .= "
Shout Box ©
"; // end copyright. // end mid content // start bottom content $bottom_content $bottom_content = "
\n"; // bottom half if ($conf['anonymouspost'] == "no" && $username == "Anonymous") { $bottom_content .= "
"._SHOUTHISTORY.""; $bottom_content .= " \"\""; $bottom_content .= " \"\""; $bottom_content .= " \"\""; $bottom_content .= "

"._ONLYREGISTERED." "._SHOUTLOGIN." "._OR." "._CREATEANACCT.".
"; } else { $bottom_content .= "
"; $bottom_content .= ""; $bottom_content .= "\n"; // Start smilie Drop-Down Code $messageDefinition = ""._SB_MESSAGE.""; if (eregi("MSIE(.*)", $_SERVER['HTTP_USER_AGENT']) || eregi("Konqueror/3(.*)", $_SERVER['HTTP_USER_AGENT']) || (eregi("Opera(.*)", $_SERVER['HTTP_USER_AGENT']))) { $ShoutNameWidth = $conf['textWidth']; $ShoutTextWidth = $conf['textWidth']; } else { // Firefox, Mozilla, NS, and any others. $ShoutNameWidth = $conf['textWidth'] - 4; $ShoutTextWidth = $conf['textWidth'] - 4; } if ($conf['anonymouspost'] == "yes" && $username == "Anonymous") { if ($PreviousUsername) { $boxtext = $PreviousUsername; } else { $boxtext = ""._NAME.""; } $bottom_content .= "\n"; } if ($PreviousComment) { $boxtext = $PreviousComment; } else { $boxtext = ""._SB_MESSAGE.""; } $bottom_content .= ""; $bottom_content .= "\n"; $bottom_content .= "
"._SHOUTHISTORY.""; $bottom_content .= " \"\""; $bottom_content .= " \"\""; $bottom_content .= " \"\""; $bottom_content .= "
"; $bottom_content .= "
 
"; $bottom_content .= "
 

"; $sql = "select distinct image from ".$prefix."_shoutbox_emoticons"; $nameresult1 = $db->sql_query($sql); $flag = 1; $second = 0; while ($return = $db->sql_fetchrow($nameresult1)){ $sql = "select * from ".$prefix."_shoutbox_emoticons where image='$return[0]' limit 1"; $nameresult = $db->sql_query($sql); while ($emoticons = $db->sql_fetchrow($nameresult)){ $emoticons[3] = str_replace('>', '', $emoticons['image']); $emoticons[3] = str_replace('src=', 'src="', $emoticons[3]); $bottom_content .= "$emoticons[3]\" border=\"0\" alt=\"\" /> "; if ($flag == $conf['smiliesPerRow']) { $bottom_content .="

\n"; $flag = 1; continue; } $flag++; } } $bottom_content .= "
\n"; } } else { $top_content = "

"; $mid_content = ""._YOUAREBANNED.""; $bottom_content = "

"; } $sql = "select * from ".$prefix."_shoutbox_conf"; $resultsize = $db->sql_query($sql); $rowsize = $db->sql_fetchrow($resultsize); $ShoutMarqueeheight = $rowsize['height']; } switch($ShoutSubmit) { default: ShoutBox($ShoutSubmit, $prefix, $ShoutComment, $db, $user, $cookie, $shoutuid); break; } ?> \n"; $content .= "$bottom_content\n"; ?>