", " ", "\n"); $replace = array(""", "'", "\", """, "'", "<", ">", " ", " "); $shout_message = str_replace($search, $replace, replace_naughty(trim($shout_message))); $shout_message = str_replace("\n", "
", $shout_message); if(!empty($shout_name) && !empty($shout_message)) { dbquery("INSERT INTO ".TABLEPREFIX."fanfiction_shoutbox(`shout_name`, `shout_message`, `shout_datestamp`) VALUES('$shout_name', '$shout_message', '".time()."')"); } } if(isMEMBER || !empty($blocks['shoutbox']['guestshouts'])) { $content = "
\n
\n"; if(!isMEMBER) $content .= "
"; else $content .= "
"._NAME.": ".USERPENNAME."
"; if(!isMEMBER && $captcha) $content .= "
"; $content .= "
"; } if(isset($blocks['shoutbox']['shoutlimit'])) $shoutlimit = $blocks['shoutbox']['shoutlimit']; else $shoutlimit = 10; if(!empty($blocks['shoutbox']['shoutdate'])) $shoutdate = $blocks['shoutbox']['shoutdate']; else $shoutdate = $dateformat." ".$timeformat; $shouts = dbquery("SELECT shouts.*, "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_shoutbox as shouts LEFT JOIN "._AUTHORTABLE." ON "._UIDFIELD." = shouts.shout_name ORDER BY shout_datestamp DESC"); $totalshouts = dbnumrows($shouts); $shouts = dbquery("SELECT shouts.*, "._PENNAMEFIELD." as penname FROM ".TABLEPREFIX."fanfiction_shoutbox as shouts LEFT JOIN "._AUTHORTABLE." ON "._UIDFIELD." = shouts.shout_name ORDER BY shout_datestamp DESC LIMIT 0, ".$shoutlimit); $content .= "
"; if(dbnumrows($shouts) != 0) { while($shout = dbassoc($shouts)) { if(isNumber($shout['shout_name']) && isset($shout['penname'])) $shoutname = "".$shout['penname'].""; else if(isset($shout['shout_name'])) $shoutname = $shout['shout_name']; else $shout = _GUEST; // Just in case. $content .= "$shoutname
".date("$shoutdate", $shout['shout_datestamp']); if(isADMIN) $content .= " ["._EDIT."]"; $content .= "
\n".stripslashes($shout['shout_message'])."
"; } } else $content .= write_message(_NOSHOUTS); $content .= "
"; if($totalshouts > $shoutlimit) $content .= write_message(""._SHOUTARCHIVE.""); ?>