") { $tags--; } elseif ($chr == " ") { $chars = 0; } elseif (!$tags) { $chars++; } if (!$tags && $chars == 40) { $chr .= " "; $chars = 0; } $res .= $chr; } return $res; } add_to_title($locale['global_200'].$locale['SB_archive']); opentable($locale['SB_archive']); if (iMEMBER || $shout_settings['guest_shouts'] == "1") { include_once INCLUDES."bbcode_include.php"; if (isset($_POST['post_archive_shout'])) { $flood = false; if (iMEMBER) { $archive_shout_name = $userdata['user_id']; } elseif ($shout_settings['guest_shouts'] == "1") { $archive_shout_name = trim(stripinput($_POST['archive_shout_name'])); $archive_shout_name = preg_replace("(^[+0-9\s]*)", "", $archive_shout_name); if (isnum($archive_shout_name)) { $archive_shout_name = ""; } include_once INCLUDES."captchas/securimage/securimage.php"; $securimage = new Securimage(); if (!isset($_POST['captcha_code']) || $securimage->check($_POST['captcha_code']) == false) { redirect($link); } } $archive_shout_message = str_replace("\n", " ", $_POST['archive_shout_message']); $archive_shout_message = preg_replace("/^(.{255}).*$/", "$1", $archive_shout_message); $archive_shout_message = trim(stripinput(censorwords($archive_shout_message))); if (iMEMBER && (isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) { $comment_updated = false; if ((iADMIN && checkrights("S")) || (iMEMBER && dbcount("(shout_id)", DB_SHOUTBOX, "shout_id='".$_GET['shout_id']."' AND shout_name='".$userdata['user_id']."' AND shout_hidden='0'"))) { if ($archive_shout_message) { $result = dbquery("UPDATE ".DB_SHOUTBOX." SET shout_message='$archive_shout_message' WHERE shout_id='".$_GET['shout_id']."'".(iADMIN ? "" : " AND shout_name='".$userdata['user_id']."'")); } } redirect(FUSION_SELF); } elseif ($archive_shout_name && $archive_shout_message) { require_once INCLUDES."flood_include.php"; if (!flood_control("shout_datestamp", DB_SHOUTBOX, "shout_ip='".USER_IP."'")) { $result = dbquery("INSERT INTO ".DB_SHOUTBOX." (shout_name, shout_message, shout_datestamp, shout_ip, shout_ip_type) VALUES ('$archive_shout_name', '$archive_shout_message', '".time()."', '".USER_IP."', '".USER_IP_TYPE."')"); } redirect(FUSION_SELF); } } if (iMEMBER && (isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) { $esresult = dbquery( "SELECT ts.shout_id, ts.shout_name, ts.shout_message, tu.user_id, tu.user_name FROM ".DB_SHOUTBOX." ts LEFT JOIN ".DB_USERS." tu ON ts.shout_name=tu.user_id WHERE ts.shout_id='".$_GET['shout_id']."' AND shout_hidden='0'" ); if (dbrows($esresult)) { $esdata = dbarray($esresult); if ((iADMIN && checkrights("S")) || (iMEMBER && $esdata['shout_name'] == $userdata['user_id'] && isset($esdata['user_name']))) { if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['shout_id']) && isnum($_GET['shout_id']))) { $edit_url = "?action=edit&shout_id=".$esdata['shout_id']; } else { $edit_url = ""; } $archive_shout_link = FUSION_SELF.$edit_url; $archive_shout_message = $esdata['shout_message']; } } else { $archive_shout_link = FUSION_SELF; $archive_shout_message = ""; } } else { $archive_shout_link = FUSION_SELF; $archive_shout_message = ""; } echo "
\n