/*--------------------------------------------+
| PHP-Fusion 5 - Content Management System |
|---------------------------------------------|
| author: Nick Jones (Digitanium) © 2002-2005 |
| web: http://www.php-fusion.co.uk |
| email: nick@php-fusion.co.uk |
|---------------------------------------------|
| Released under the terms and conditions of |
| the GNU General Public License (Version 2) |
+--------------------------------------------*/
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
openside(LAN_120);
if (isset($_POST['post_shout'])) {
if (iMEMBER) {
$shout_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1") {
$shout_name = stripinput($_POST['shout_name']);
$shout_name = stripinput($_POST['shout_name']);
$users_result = dbquery("SELECT user_name FROM ".$fusion_prefix."users WHERE user_name='".$shout_name."'");
$users_data = dbarray($users_result);
$users_rows = dbrows($users_result);
if ($users_rows!=0) {
setcookie("USER_SBEXISTS",$users_data['user_name']);
} else {
setcookie("USER_SBEXISTS","___null___");
}
if (is_numeric($shout_name)) $shout_name="";
}
$shout_message = str_replace("\n", " ", $_POST['shout_message']);
$shout_message = preg_replace("/^(.{255}).*$/", "$1", $shout_message);
$shout_message = preg_replace("/([^\s]{25})/", "$1\n", $shout_message);
$shout_message = stripinput(censorwords($shout_message));
$shout_message = str_replace("\n", "
", $shout_message);
if ($shout_name != "" && $shout_message != "" && $users_rows==0) {
$result = dbquery("INSERT INTO ".$fusion_prefix."shoutbox VALUES('', '$shout_name', '$shout_message', '".time()."', '".FUSION_IP."')");
}
header("Location:".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""));
}
if (iMEMBER || $settings['guestposts'] == "1") {
echo "