Zeile 3 | Zeile 3 |
---|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html
| * Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html
|
*
|
*
|
* $Id: showthread.php 2263 2006-09-26 09:24:25Z chris $
| * $Id: showthread.php 3478 2007-11-15 04:11:36Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 33 | Zeile 33 |
---|
); $query = $db->simple_select(TABLE_PREFIX."posts", "tid", "pid=".$mybb->input['pid'], $options); $post = $db->fetch_array($query);
|
); $query = $db->simple_select(TABLE_PREFIX."posts", "tid", "pid=".$mybb->input['pid'], $options); $post = $db->fetch_array($query);
|
| $pid = $mybb->input['pid'];
|
$mybb->input['tid'] = $post['tid']; }
| $mybb->input['tid'] = $post['tid']; }
|
Zeile 45 | Zeile 46 |
---|
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); $tid = $thread['tid']; $fid = $thread['fid'];
|
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); $tid = $thread['tid']; $fid = $thread['fid'];
|
| if(!$thread['username']) { $thread['username'] = $lang->guest; }
|
// Is the currently logged in user a moderator of this forum? if(is_moderator($fid) == "yes") { $ismod = true;
|
// Is the currently logged in user a moderator of this forum? if(is_moderator($fid) == "yes") { $ismod = true;
|
}
| }
|
else { $ismod = false;
| else { $ismod = false;
|
Zeile 58 | Zeile 64 |
---|
// Make sure we are looking at a real thread here. if(!$thread['tid'] || ($thread['visible'] == 0 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
// Make sure we are looking at a real thread here. if(!$thread['tid'] || ($thread['visible'] == 0 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
{
| {
|
error($lang->error_invalidthread); }
| error($lang->error_invalidthread); }
|
Zeile 81 | Zeile 87 |
---|
if($forumpermissions['canview'] != "yes" || $forumpermissions['canviewthreads'] != "yes") { error_no_permission();
|
if($forumpermissions['canview'] != "yes" || $forumpermissions['canviewthreads'] != "yes") { error_no_permission();
|
}
// Check that this forum is not password protected. check_forum_password($forum['fid'], $forum['password']);
| }
// Check if this forum is password protected and we have a valid password check_forum_password($forum['fid']);
|
// If there is no specific action, we must be looking at the thread. if(!$mybb->input['action'])
| // If there is no specific action, we must be looking at the thread. if(!$mybb->input['action'])
|
Zeile 96 | Zeile 102 |
---|
if($mybb->input['action'] == "lastpost") { if(strstr($thread['closed'], "moved|"))
|
if($mybb->input['action'] == "lastpost") { if(strstr($thread['closed'], "moved|"))
|
{
| {
|
$query = $db->query(" SELECT p.pid FROM ".TABLE_PREFIX."posts p, ".TABLE_PREFIX."threads t
| $query = $db->query(" SELECT p.pid FROM ".TABLE_PREFIX."posts p, ".TABLE_PREFIX."threads t
|
Zeile 144 | Zeile 150 |
---|
"order_dir" => "desc" ); $query = $db->simple_select(TABLE_PREFIX.'posts', 'pid', "tid={$nextthread['tid']}");
|
"order_dir" => "desc" ); $query = $db->simple_select(TABLE_PREFIX.'posts', 'pid', "tid={$nextthread['tid']}");
|
// Redirect to the proper page.
| // Redirect to the proper page.
|
$pid = $db->fetch_field($query, "pid"); header("Location:showthread.php?tid={$nextthread['tid']}&pid={$pid}#pid{$pid}"); }
| $pid = $db->fetch_field($query, "pid"); header("Location:showthread.php?tid={$nextthread['tid']}&pid={$pid}#pid{$pid}"); }
|
Zeile 157 | Zeile 163 |
---|
"limit" => 1, "limit_start" => 0, "order_by" => "lastpost",
|
"limit" => 1, "limit_start" => 0, "order_by" => "lastpost",
|
"order_dir" => "desc"
| "order_dir" => "desc"
|
); $query = $db->simple_select(TABLE_PREFIX."threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." AND visible=1 AND closed NOT LIKE 'moved|%'", $options); $nextthread = $db->fetch_array($query);
| ); $query = $db->simple_select(TABLE_PREFIX."threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." AND visible=1 AND closed NOT LIKE 'moved|%'", $options); $nextthread = $db->fetch_array($query);
|
Zeile 166 | Zeile 172 |
---|
if(!$nextthread['tid']) { error($lang->error_nonextoldest);
|
if(!$nextthread['tid']) { error($lang->error_nonextoldest);
|
} $options = array( "limit_start" => 0,
| } $options = array( "limit_start" => 0,
|
"limit" => 1, "order_by" => "dateline", "order_dir" => "desc"
| "limit" => 1, "order_by" => "dateline", "order_dir" => "desc"
|
Zeile 203 | Zeile 209 |
---|
if($thread_read) { $lastread = $thread_read;
|
if($thread_read) { $lastread = $thread_read;
|
}
| }
|
else { $lastread = 1;
| else { $lastread = 1;
|
Zeile 214 | Zeile 220 |
---|
{ $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']); if($readcookie > $forumread)
|
{ $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']); if($readcookie > $forumread)
|
{
| {
|
$lastread = $readcookie; } else
| $lastread = $readcookie; } else
|
Zeile 229 | Zeile 235 |
---|
"order_by" => "dateline", "order_dir" => "asc" );
|
"order_by" => "dateline", "order_dir" => "asc" );
|
$query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid=".$tid." AND dateline > '{$lastread}'");
| $query = $db->simple_select(TABLE_PREFIX."posts", "pid", "tid=".$tid." AND dateline > '{$lastread}'", $options);
|
$newpost = $db->fetch_array($query); if($newpost['pid']) {
| $newpost = $db->fetch_array($query); if($newpost['pid']) {
|
Zeile 239 | Zeile 245 |
---|
{ header("Location:showthread.php?action=lastpost&tid={$tid}"); }
|
{ header("Location:showthread.php?action=lastpost&tid={$tid}"); }
|
| }
if($mybb->input['pid']) { $pid = $mybb->input['pid'];
|
}
$plugins->run_hooks("showthread_start");
| }
$plugins->run_hooks("showthread_start");
|
Zeile 289 | Zeile 300 |
---|
$votesarray = explode("||~|~||", $poll['votes']); $poll['question'] = htmlspecialchars_uni($poll['question']); $polloptions = '';
|
$votesarray = explode("||~|~||", $poll['votes']); $poll['question'] = htmlspecialchars_uni($poll['question']); $polloptions = '';
|
| $totalvotes = 0;
|
for($i = 1; $i <= $poll['numoptions']; $i++) {
| for($i = 1; $i <= $poll['numoptions']; $i++) {
|
Zeile 308 | Zeile 320 |
---|
$option = $parser->parse_message($optionsarray[$i-1], $parser_options); $votes = $votesarray[$i-1];
|
$option = $parser->parse_message($optionsarray[$i-1], $parser_options); $votes = $votesarray[$i-1];
|
| $totalvotes += $votes;
|
$number = $i;
// Mark the option the user voted for.
| $number = $i;
// Mark the option the user voted for.
|
Zeile 380 | Zeile 393 |
---|
{ $pollstatus = $lang->poll_closed; }
|
{ $pollstatus = $lang->poll_closed; }
|
$lang->total_votes = sprintf($lang->total_votes, $poll['numvotes']);
| $lang->total_votes = sprintf($lang->total_votes, $totalvotes);
|
eval("\$pollbox = \"".$templates->get("showthread_poll_results")."\";"); $plugins->run_hooks("showthread_poll_results"); }
| eval("\$pollbox = \"".$templates->get("showthread_poll_results")."\";"); $plugins->run_hooks("showthread_poll_results"); }
|
Zeile 402 | Zeile 415 |
---|
}
// Create the forum jump dropdown box.
|
}
// Create the forum jump dropdown box.
|
$forumjump = build_forum_jump("", $fid, 1);
| if($mybb->settings['enableforumjump'] != "no") { $forumjump = build_forum_jump("", $fid, 1); }
|
// Mark this thread read for the currently logged in user. if($mybb->settings['threadreadcut'] && ($mybb->user['uid'] != 0))
| // Mark this thread read for the currently logged in user. if($mybb->settings['threadreadcut'] && ($mybb->user['uid'] != 0))
|
Zeile 473 | Zeile 489 |
---|
// Decide whether or not to include signatures. if($forumpermissions['canpostreplys'] != "no" && ($thread['closed'] != "yes" || is_moderator($fid) == "yes") && $mybb->settings['quickreply'] != "off" && $mybb->user['showquickreply'] != "no" && $forum['open'] != "no") {
|
// Decide whether or not to include signatures. if($forumpermissions['canpostreplys'] != "no" && ($thread['closed'] != "yes" || is_moderator($fid) == "yes") && $mybb->settings['quickreply'] != "off" && $mybb->user['showquickreply'] != "no" && $forum['open'] != "no") {
|
| // Show captcha image for guests if enabled if($mybb->settings['captchaimage'] == "on" && function_exists("imagepng") && !$mybb->user['uid']) { $randomstr = random_str(5); $imagehash = md5($randomstr); $imagearray = array( "imagehash" => $imagehash, "imagestring" => $randomstr, "dateline" => time() ); $db->insert_query(TABLE_PREFIX."captcha", $imagearray); eval("\$captcha = \"".$templates->get("post_captcha")."\";"); }
|
if($mybb->user['signature'])
|
if($mybb->user['signature'])
|
{
| {
|
$postoptionschecked['signature'] = "checked"; } if($mybb->user['emailnotify'] == "yes")
|
$postoptionschecked['signature'] = "checked"; } if($mybb->user['emailnotify'] == "yes")
|
{
| {
|
$postoptionschecked['emailnotify'] = "checked"; } mt_srand ((double) microtime() * 1000000); $posthash = md5($mybb->user['uid'].mt_rand()); eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";");
|
$postoptionschecked['emailnotify'] = "checked"; } mt_srand ((double) microtime() * 1000000); $posthash = md5($mybb->user['uid'].mt_rand()); eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";");
|
} else {
| } else {
|
$quickreply = ""; }
| $quickreply = ""; }
|
Zeile 518 | Zeile 547 |
---|
$visible = "AND (p.visible='0' OR p.visible='1')"; } else
|
$visible = "AND (p.visible='0' OR p.visible='1')"; } else
|
{
| {
|
$visible = "AND p.visible='1'"; }
| $visible = "AND p.visible='1'"; }
|
Zeile 535 | Zeile 564 |
---|
else { $where = " ORDER BY dateline ASC LIMIT 0, 1";
|
else { $where = " ORDER BY dateline ASC LIMIT 0, 1";
|
} $query = $db->query(" SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
| } $query = $db->query(" SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
|
LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid) WHERE p.tid='$tid' $visible $where ");
| LEFT JOIN ".TABLE_PREFIX."users eu ON (eu.uid=p.edituid) WHERE p.tid='$tid' $visible $where ");
|
Zeile 567 | Zeile 596 |
---|
// Build the threaded post display tree. $query = $db->query("
|
// Build the threaded post display tree. $query = $db->query("
|
SELECT u.username, u.username AS userusername, p.pid, p.replyto, p.subject, p.dateline
| SELECT p.username, p.uid, p.pid, p.replyto, p.subject, p.dateline
|
FROM ".TABLE_PREFIX."posts p
|
FROM ".TABLE_PREFIX."posts p
|
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
| |
WHERE p.tid='$tid' $visible ORDER BY p.dateline
| WHERE p.tid='$tid' $visible ORDER BY p.dateline
|
Zeile 616 | Zeile 644 |
---|
{ $page = intval($result / $perpage) + 1; }
|
{ $page = intval($result / $perpage) + 1; }
|
}
| }
|
// Recount replies if user is a moderator to take into account unapproved posts. if($ismod) {
| // Recount replies if user is a moderator to take into account unapproved posts. if($ismod) {
|
Zeile 628 | Zeile 656 |
---|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
$pages = ceil($pages);
if($mybb->input['page'] == "last")
|
{
| {
|
$page = $pages;
|
$page = $pages;
|
}
| }
|
if($page > $pages)
|
if($page > $pages)
|
{
| {
|
$page = 1; }
if($page) { $start = ($page-1) * $perpage;
|
$page = 1; }
if($page) { $start = ($page-1) * $perpage;
|
}
| }
|
else { $start = 0;
| else { $start = 0;
|
Zeile 813 | Zeile 841 |
---|
function buildtree($replyto="0", $indent="0") { global $tree, $mybb, $theme, $mybb, $pid, $tid, $templates, $parser;
|
function buildtree($replyto="0", $indent="0") { global $tree, $mybb, $theme, $mybb, $pid, $tid, $templates, $parser;
|
|
|
if($indent) { $indentsize = 13 * $indent;
| if($indent) { $indentsize = 13 * $indent;
|
Zeile 821 | Zeile 850 |
---|
{ $indentsize = 0; }
|
{ $indentsize = 0; }
|
|
|
++$indent; if(is_array($tree[$replyto])) {
| ++$indent; if(is_array($tree[$replyto])) {
|
Zeile 829 | Zeile 859 |
---|
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']); $posttime = my_date($mybb->settings['timeformat'], $post['dateline']); $post['subject'] = htmlspecialchars_uni($parser->parse_badwords($post['subject']));
|
$postdate = my_date($mybb->settings['dateformat'], $post['dateline']); $posttime = my_date($mybb->settings['timeformat'], $post['dateline']); $post['subject'] = htmlspecialchars_uni($parser->parse_badwords($post['subject']));
|
|
|
if(!$post['subject']) { $post['subject'] = "[".$lang->no_subject."]"; }
|
if(!$post['subject']) { $post['subject'] = "[".$lang->no_subject."]"; }
|
if($post['userusername']) { $post['profilelink'] = build_profile_link($post['userusername'], $post['uid']); } else { $post['profilelink'] = $post['username']; }
| $post['profilelink'] = build_profile_link($post['username'], $post['uid']);
|
if($mybb->input['pid'] == $post['pid']) { eval("\$posts .= \"".$templates->get("showthread_threaded_bitactive")."\";");
| if($mybb->input['pid'] == $post['pid']) { eval("\$posts .= \"".$templates->get("showthread_threaded_bitactive")."\";");
|
Zeile 849 | Zeile 875 |
---|
{ eval("\$posts .= \"".$templates->get("showthread_threaded_bit")."\";"); }
|
{ eval("\$posts .= \"".$templates->get("showthread_threaded_bit")."\";"); }
|
|
|
if($tree[$post['pid']]) { $posts .= buildtree($post['pid'], $indent);
| if($tree[$post['pid']]) { $posts .= buildtree($post['pid'], $indent);
|