".$fdata['forum_name']."";
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_views=thread_views+1 WHERE thread_id='$thread_id'");
if (iMEMBER && $can_post && isset($_POST['postquickreply'])) {
$flood = false;
$message = stripinput(censorwords($_POST['message']));
if ($message != "") {
$result = dbquery("SELECT MAX(post_datestamp) AS last_post FROM ".$db_prefix."posts WHERE post_author='".$userdata['user_id']."'");
if (dbrows($result) > 0) {
$data = dbarray($result);
if ((time() - $data['last_post']) < $settings['flood_interval']) {
$flood = true;
$result = dbquery("INSERT INTO ".$db_prefix."flood_control (flood_ip, flood_timestamp) VALUES ('".USER_IP."', '".time()."')");
if (dbcount("(flood_ip)", "flood_control", "flood_ip='".USER_IP."'") > 4) {
$result = dbquery("UPDATE ".$db_prefix."users SET user_status='1' WHERE user_id='".$userdata['user_id']."'");
}
fallback("viewforum.php?forum_id=$forum_id");
}
}
if (!$flood) {
$sig = ($userdata['user_sig'] ? '1' :'0');
$smileys = isset($_POST['disable_smileys']) ? "0" : "1";
$subject = "RE: ".$tdata['thread_subject'];
$result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'");
$result = dbquery("UPDATE ".$db_prefix."threads SET thread_lastpost='".time()."', thread_lastuser='".$userdata['user_id']."' WHERE thread_id='$thread_id'");
$result = dbquery("INSERT INTO ".$db_prefix."posts (forum_id, thread_id, post_subject, post_message, post_showsig, post_smileys, post_author, post_datestamp, post_ip, post_edituser, post_edittime) VALUES ('$forum_id', '$thread_id', '$subject', '$message', '$sig', '$smileys', '".$userdata['user_id']."', '".time()."', '".USER_IP."', '0', '0')");
$newpost_id = mysql_insert_id();
$result = dbquery("UPDATE ".$db_prefix."users SET user_posts=user_posts+1 WHERE user_id='".$userdata['user_id']."'");
redirect("postify.php?post=reply&error=0&forum_id=$forum_id&thread_id=$thread_id&post_id=$newpost_id");
}
}
}
opentable($locale['500']);
echo "\n";
if (iMEMBER && $can_post) {
echo "\n";
}
echo "\n";
$rows = dbcount("(thread_id)", "posts", "thread_id='$thread_id'");
if (isset($pid) && isNum($pid)) {
$reply_count = dbcount("(post_id)", "posts", "thread_id='".$tdata['thread_id']."' AND post_id<='".$pid."'");
if ($reply_count > $posts_per_page) $rowstart = ((ceil($reply_count / $posts_per_page)-1)*$posts_per_page);
}
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows > $posts_per_page) {
echo "
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
\n";
}
echo "\n";
if ($rows != 0) {
$result = dbquery(
"SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name FROM ".$db_prefix."posts p
LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='$thread_id' ORDER BY post_datestamp LIMIT $rowstart,$posts_per_page"
);
$numrows = dbrows($result);
while ($data = dbarray($result)) {
$message = $data['post_message'];
if ($data['post_showsig']) { $message = $message."\n\n
".$data['user_sig']; }
if ($data['post_smileys']) { $message = parsesmileys($message); }
$message = parseubb($message);
$message = nl2br($message);
if ($data['post_edittime'] != "0") {
$edituser = "".$data['edit_name']."";
$edittime = showdate("forumdate", $data['post_edittime']);
}
$is_mod = in_array($data['user_id'], $forum_mods) && $data['user_level'] < "102" ? true : false;
echo "\n";
}
}
echo "
".$locale['501']." |
".$data['post_subject']." |
".$data['user_name']."
".($is_mod ? $locale['userf1'] : getuserlevel($data['user_level']))."
\n";
if ($data['user_avatar'] != "") {
echo "
\n";
$height = "185";
} else {
$height = "70";
}
echo "".$locale['502']." ".$data['user_posts']." \n";
if ($data['user_location']) echo "".$locale['503']." ".$data['user_location']." \n";
echo "".$locale['504']." ".showdate("%d.%m.%y", $data['user_joined'])." |
".$locale['505'].showdate("forumdate", $data['post_datestamp'])." |
\n";
if (iMEMBER && $can_post) {
if (!$tdata['thread_locked']) {
if ($userdata['user_id'] == $data['post_author'] || iMOD || iSUPERADMIN) {
echo "\n";
}
echo "\n";
if (iMOD || iSUPERADMIN && $data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "\n";
} else {
if (iMOD || iSUPERADMIN) {
echo "\n";
if ($data['post_ip'] != "0.0.0.0" && file_exists(THEME."forum/ip.gif")) echo "\n";
}
}
}
echo " |
|
$message";
if ($data['attach_id']) {
if (in_array($data['attach_ext'], $imagetypes) && @getimagesize(FORUM."attachments/".$data['attach_name'])) {
echo " \n".$data['user_name'].$locale['506']."
\n";
} else {
echo " \n".$data['user_name'].$locale['507']." \n".$data['attach_name']."";
}
}
if ($data['post_edittime'] != "0") {
echo " \n".$locale['508'].$edituser.$locale['509']."$edittime";
}
echo " |
\n";
if ($data['user_aim'] && file_exists(THEME."forum/aim.gif")) {
echo " ";
}
if ($data['user_icq']) {
echo " ";
}
if ($data['user_msn']) {
echo " ";
}
if ($data['user_yahoo']) {
echo " ";
}
if ($data['user_web']) {
if (!strstr($data['user_web'], "http://")) { $urlprefix = "http://"; } else { $urlprefix = ""; }
echo " ";
}
echo "
|
\n";
if ($rows > $posts_per_page) {
echo "
".makePageNav($rowstart,$posts_per_page,$rows,3,FUSION_SELF."?forum_id=$forum_id&thread_id=$thread_id&")."
\n";
}
echo "\n\n";
$forum_list = ""; $current_cat = "";
$result = dbquery(
"SELECT f.forum_id, f.forum_name, f2.forum_name AS forum_cat_name
FROM ".$db_prefix."forums f
INNER JOIN ".$db_prefix."forums f2 ON f.forum_cat=f2.forum_id
WHERE ".groupaccess('f.forum_access')." AND f.forum_cat!='0' ORDER BY f2.forum_order ASC, f.forum_order ASC"
);
while ($data = dbarray($result)) {
if ($data['forum_cat_name'] != $current_cat) {
if ($current_cat != "") $forum_list .= "\n";
$current_cat = $data['forum_cat_name'];
$forum_list .= "\n";
echo "\n";
if (iMEMBER && $can_post) {
if (iMOD || iSUPERADMIN) {
echo "\n";
}
}
echo "".$locale['540']."
|
|
\n";
if (iMEMBER) {
echo "\n\n";
if ($settings['thread_notify']) {
echo "\n";
}
if ($can_post) {
echo "\n";
}
echo "\n";
if (dbcount("(thread_id)", "thread_notify", "thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'")) {
$result = dbquery("UPDATE ".$db_prefix."thread_notify SET notify_datestamp='".time()."', notify_status='1' WHERE thread_id='$thread_id' AND notify_user='".$userdata['user_id']."'");
$notify_link = "".$locale['515']."";
} else {
$notify_link = "".$locale['516']."";
}
echo "$notify_link | ";
if (!$tdata['thread_locked']) {
echo "\n";
}
echo "\n";
echo " |
\n";
}
closetable();
tablebreak();
if (iMEMBER && $can_post && !$tdata['thread_locked']) {
opentable($locale['512']);
echo "\n";
closetable();
}
echo "\n";
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>