".$locale['422']." $subject
".$udata['user_name']."
".($is_mod ? $locale['userf1'] : getuserlevel($udata['user_level']))."

\n"; if ($udata['user_avatar']) { echo "

\n"; $height = "200"; } else { $height = "60"; } echo "".$locale['423']." ".$udata['user_posts']."
\n"; if ($udata['user_location']) echo "".$locale['424']." ".$udata['user_location']."
\n"; echo "".$locale['425']." ".showdate("%d.%m.%y", $udata['user_joined'])."
".$locale['426'].showdate("forumdate", $pdata['post_datestamp'])."
$previewmessage

".$locale['427'].$userdata['user_name'].$locale['428'].showdate("forumdate", time())."
\n"; closetable(); tablebreak(); } if (isset($_POST['savechanges'])) { if (isset($_POST['delete'])) { $result = dbquery("DELETE FROM ".$db_prefix."posts WHERE post_id='$post_id' AND thread_id='$thread_id'"); $result = dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE post_id='$post_id'"); if (dbrows($result) != 0) { $attach = dbarray($result); unlink(FORUM."attachments/".$attach['attach_name']); $result2 = dbquery("DELETE FROM ".$db_prefix."forum_attachments WHERE post_id='$post_id'"); } $posts = dbcount("(post_id)", "posts", "thread_id='$thread_id'"); if ($posts == 0) { $result = dbquery("DELETE FROM ".$db_prefix."threads WHERE thread_id='$thread_id' AND forum_id='$forum_id'"); $result = dbquery("DELETE FROM ".$db_prefix."thread_notify WHERE thread_id='$thread_id'"); } // update forum_lastpost and forum_lastuser if post_datestamp matches $result = dbquery("SELECT * FROM ".$db_prefix."forums WHERE forum_id='$forum_id' AND forum_lastuser='".$pdata['post_author']."' AND forum_lastpost='".$pdata['post_datestamp']."'"); if (dbrows($result)) { $result = dbquery("SELECT forum_id,post_author,post_datestamp FROM ".$db_prefix."posts WHERE forum_id='$forum_id' ORDER BY post_datestamp DESC LIMIT 1"); if (dbrows($result)) { $pdata2 = dbarray($result); $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".$pdata2['post_datestamp']."', forum_lastuser='".$pdata2['post_author']."' WHERE forum_id='$forum_id'"); } else { $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='0', forum_lastuser='0' WHERE forum_id='$forum_id'"); } } // update thread_lastpost and thread_lastuser if thread post > 0 and post_datestamp matches if ($posts > 0) { $result = dbquery("SELECT * FROM ".$db_prefix."threads WHERE thread_id='$thread_id' AND thread_lastpost='".$pdata['post_datestamp']."' AND thread_lastuser='".$pdata['post_author']."'"); if (dbrows($result)) { $result = dbquery("SELECT thread_id,post_author,post_datestamp FROM ".$db_prefix."posts WHERE thread_id='$thread_id' ORDER BY post_datestamp DESC LIMIT 1"); $pdata2 = dbarray($result); $result = dbquery("UPDATE ".$db_prefix."threads SET thread_lastpost='".$pdata2['post_datestamp']."', thread_lastuser='".$pdata2['post_author']."' WHERE thread_id='$thread_id'"); } } opentable($locale['407']); echo "

\n".$locale['445']."

\n"; if ($posts > 0) echo "".$locale['447']." |\n"; echo "".$locale['448']." | ".$locale['449']."

\n
\n"; closetable(); } else { $error = 0; $smileys = isset($_POST['disable_smileys']) ? "0" : "1"; $subject = trim(stripinput(censorwords($_POST['subject']))); $message = trim(stripinput(censorwords($_POST['message']))); if (iMEMBER) { if ($subject != "" && $message != "") { $result = dbquery("UPDATE ".$db_prefix."posts SET post_subject='$subject', post_message='$message', post_smileys='$smileys', post_edituser='".$userdata['user_id']."', post_edittime='".time()."' WHERE post_id='$post_id'"); $data = dbarray(dbquery("SELECT * FROM ".$db_prefix."posts WHERE thread_id='$thread_id' ORDER BY post_id ASC LIMIT 1")); if ($data['post_id'] == $post_id) { $result = dbquery("UPDATE ".$db_prefix."threads SET thread_subject='$subject' WHERE thread_id='$thread_id'"); } if (isset($_POST['delete_attach'])) { $result = dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE post_id='$post_id'"); if (dbrows($result) != 0) { $adata = dbarray($result); unlink(FORUM."attachments/".$adata['attach_name']); $result = dbquery("DELETE FROM ".$db_prefix."forum_attachments WHERE post_id='$post_id'"); } } $attach = $_FILES['attach']; if ($attach['name'] != "" && !empty($attach['name']) && is_uploaded_file($attach['tmp_name'])) { $attachname = substr($attach['name'], 0, strrpos($attach['name'], ".")); $attachext = strtolower(strrchr($attach['name'],".")); if (preg_match("/^[-0-9A-Z_\[\]]+$/i", $attachname) && $attach['size'] <= $settings['attachmax']) { $attachtypes = explode(",", $settings['attachtypes']); if (in_array($attachext, $attachtypes)) { $attachname = attach_exists(strtolower($attach['name'])); move_uploaded_file($attach['tmp_name'], FORUM."attachments/".$attachname); chmod(FORUM."attachments/".$attachname,0644); if (in_array($attachext, $imagetypes) && (!@getimagesize(FORUM."attachments/".$attachname) || !@verify_image(FORUM."attachments/".$attachname))) { unlink(FORUM."attachments/".$attachname); $error = 1; } if (!$error) $result = dbquery("INSERT INTO ".$db_prefix."forum_attachments (thread_id, post_id, attach_name, attach_ext, attach_size) VALUES ('$thread_id', '$post_id', '$attachname', '$attachext', '".$attach['size']."')"); } else { @unlink($attach['tmp_name']); $error = 1; } } else { @unlink($attach['tmp_name']); $error = 2; } } } else { $error = 3; } } else { $error = 4; } redirect("postify.php?post=edit&error=$error&forum_id=$forum_id&thread_id=$thread_id&post_id=$post_id"); } } else { if (!isset($_POST['previewchanges'])) { $subject = $pdata['post_subject']; $message = $pdata['post_message']; $disable_smileys_check = ($pdata['post_smileys'] == "0" ? " checked" : ""); $del_check = ""; } opentable($locale['408']); echo "
\n"; if ($settings['attachments'] == "1") { echo "\n\n\n\n"; } echo "
".$locale['460']."
".$locale['461']."
 
  ".$locale['462']."
  ".displaysmileys("message")."
".$locale['463']." ".$locale['483']."
".$locale['482']."
".$locale['464']."\n"; $result = dbquery("SELECT * FROM ".$db_prefix."forum_attachments WHERE post_id='$post_id'"); if (dbrows($result)) { $adata = dbarray($result); echo "".$locale['484']."\n"; echo "".$adata['attach_name']."\n"; } else { echo "
\n"; echo "".sprintf($locale['466'], parsebytesize($settings['attachmax']), str_replace(',', ' ', $settings['attachtypes'])).""; } echo "
\n"; closetable(); } ?>