} } if (!isset($preview)) { $tpl->set_var("preview", ""); } $tpl->parse("PREVIEW", "message"); if (isset($error) || isset($preview)) { /* PREVIEW - edit */ foreach ($errors as $n => $e) { if (!isset($error[$e])) { $tpl->set_var($e, ""); } } /* generate post form for new message */ require_once "postform.inc"; render_postform($tpl, "edit", $user, $nmsg, $imgpreview); $tpl->set_var("accept", ""); } else { /* POST */ $tpl->set_var(array("error" => "", "form" => "")); /* overwrite with latest email record */ if (!empty($nmsg['email'])) { $nmsg['email'] = $user->email; } /* compose new set of flags */ $flagset[] = "NewStyle"; if (isset($flags['StateLocked'])) { $flagset[] = 'StateLocked'; } if (empty($nmsg['message']) && strlen($nmsg['message']) == 0) { $flagset[] = "NoText";
$tpl->set_var("CLASS", "trow0"); } else { $tpl->set_var("CLASS", "row0"); } } $tpl->set_var("THREAD", $threadmsg); $tpl->set_var("THREADLINKS", $threadlinks); /* create a new message based on current for postform */ $nmsg['msg'] = $nmsg['subject'] = $nmsg['urltext'] = $nmsg['video'] = ""; $nmsg['aid'] = $msg['aid']; $nmsg['pmid'] = $msg['mid']; /* new pmid is current message */ $nmsg['tid'] = $msg['tid']; $nmsg['ip'] = $remote_addr; if (preg_match("/^Re:/i", $msg['subject'], $sregs)) { $nmsg['subject'] = $msg['subject']; } /* else $nmsg['subject'] = "Re: " . $msg['subject']; */ render_postform($tpl, "post", $user, $nmsg); $tpl->parse("MESSAGE", "message"); $meta_robots = false; if ($robots_meta_tag) { $meta_robots = 'noindex'; if (isset($forum['option']['ExternallySearchable'])) { $meta_robots = 'follow,index'; } } print generate_page($msg['subject'], $tpl->parse("CONTENT", "showmessage"), false, $meta_robots);
} while ($thread = $sth->fetch()); $sth->closeCursor(); } if (!process_tthreads(true)) { $tpl->set_var("tracked_threads", ""); } if (!$tthreadsshown) { $tpl->set_var("update_all", ""); } if (!$numshown) { $tpl->set_var($table_block, "<font size=\"+1\">No messages in this forum</font><br>"); } /* $row = db_query_first("select count(*) from f_visits where UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(tstamp) <= 15 * 60 and aid != 0"); $active_users = $row ? $row[0] : 0; $row = db_query_first("select count(*) from f_visits where UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(tstamp) <= 15 * 60 and aid = 0"); $active_guests = $row ? $row[0] : 0; */ $tpl->set_var(array("ACTIVE_USERS" => $active_users, "ACTIVE_GUESTS" => $active_guests)); unset($thread); require_once "postform.inc"; render_postform($tpl, "post", $user); $meta_robots = false; if ($robots_meta_tag) { $meta_robots = 'noindex'; if (isset($forum['option']['ExternallySearchable'])) { $meta_robots = 'follow,index'; } } print generate_page($forum['name'], $tpl->parse("content", "showforum"), false, $meta_robots); // vim: sw=2
$tpl->set_var("preview", ""); } else { $tpl->set_var("owner", ""); } if (isset($error)) { foreach ($errors as $n => $e) { if (!isset($error[$e])) { $tpl->set_var($e, ""); } } } else { $tpl->set_var("error", ""); } if (!$accepted || isset($preview)) { require_once "postform.inc"; render_postform($tpl, "post", $user, $msg, $imgpreview); $tpl->set_var(array("accept" => "", "duplicate" => "")); } else { require_once "postmessage.inc"; /* sets $msg['mid'] to the new message id */ if (postmessage($user, $forum['fid'], $msg, $_POST) == true) { $tpl->set_var("duplicate", ""); } require_once "mailfrom.inc"; $sql = "select * from f_tracking where fid = ? and tid = ? and options = 'SendEmail' and aid != ?"; $sth = db_query($sql, array($forum['fid'], $msg['tid'], $user->aid)); $track = $sth->fetch(); if ($track) { $iid = mid_to_iid($thread['mid']); if (!isset($iid)) { throw new RuntimeException("no iid for thread mid " . $thread['mid']);