Zeile 1 | Zeile 1 |
---|
<?php /** * MyBB 1.4
|
<?php /** * MyBB 1.4
|
* Copyright � 2008 MyBB Group, All Rights Reserved
| * Copyright © 2008 MyBB Group, All Rights Reserved
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: showthread.php 4276 2008-11-23 03:01:33Z Tikitiki $
| * $Id: showthread.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 131 | Zeile 131 |
---|
} else {
|
} else {
|
$forum_read = my_get_array_cookie("forumread", $fid);
| $forum_read = intval(my_get_array_cookie("forumread", $fid));
|
} if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $thread['lastpost'] > $forum_read)
| } if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $thread['lastpost'] > $forum_read)
|
Zeile 152 | Zeile 152 |
---|
if(!$lastread) {
|
if(!$lastread) {
|
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
| $readcookie = $threadread = intval(my_get_array_cookie("threadread", $thread['tid']));
|
if($readcookie > $forum_read) { $lastread = $readcookie;
| if($readcookie > $forum_read) { $lastread = $readcookie;
|
Zeile 170 | Zeile 170 |
---|
"order_by" => "dateline", "order_dir" => "asc" );
|
"order_by" => "dateline", "order_dir" => "asc" );
|
| $lastread = intval($lastread);
|
$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}'", $options); $newpost = $db->fetch_array($query); if($newpost['pid'])
|
$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}'", $options); $newpost = $db->fetch_array($query); if($newpost['pid'])
|
{
| {
|
header("Location: ".htmlspecialchars_decode(get_post_link($newpost['pid'], $tid))."#pid{$newpost['pid']}");
|
header("Location: ".htmlspecialchars_decode(get_post_link($newpost['pid'], $tid))."#pid{$newpost['pid']}");
|
} else {
| } else {
|
// show them to the last post $mybb->input['action'] = "lastpost"; }
| // show them to the last post $mybb->input['action'] = "lastpost"; }
|
Zeile 185 | Zeile 187 |
---|
// Jump to the last post. if($mybb->input['action'] == "lastpost")
|
// Jump to the last post. if($mybb->input['action'] == "lastpost")
|
{
| {
|
if(my_strpos($thread['closed'], "moved|")) { $query = $db->query("
| if(my_strpos($thread['closed'], "moved|")) { $query = $db->query("
|
Zeile 236 | Zeile 238 |
---|
"order_dir" => "desc" ); $query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);
|
"order_dir" => "desc" ); $query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);
|
// Redirect to the proper page. $pid = $db->fetch_field($query, "pid"); header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");
| // Redirect to the proper page. $pid = $db->fetch_field($query, "pid"); header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");
|
}
// Jump to the next oldest posts.
| }
// Jump to the next oldest posts.
|
Zeile 407 | Zeile 409 |
---|
} else {
|
} else {
|
$edit_poll = "| <a href=\"polls.php?action=editpoll&pid={$poll['pid']}\">{$lang->edit_poll}</a>";
| $edit_poll = " | <a href=\"polls.php?action=editpoll&pid={$poll['pid']}\">{$lang->edit_poll}</a>";
|
}
// Decide what poll status to show depending on the status of the poll and whether or not the user voted already.
| }
// Decide what poll status to show depending on the status of the poll and whether or not the user voted already.
|
Zeile 531 | Zeile 533 |
---|
else { $thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2));
|
else { $thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2));
|
$thread['width'] = intval($thread['averagerating'])*20;
| $thread['width'] = intval(round($thread['averagerating']))*20;
|
$thread['numratings'] = intval($thread['numratings']); }
| $thread['numratings'] = intval($thread['numratings']); }
|
Zeile 575 | Zeile 577 |
---|
} }
|
} }
|
// Which thread mode is our user using? if(!isset($mybb->input['mode']))
| // Which thread mode is our user using by default? if(!empty($mybb->user['threadmode']))
|
{
|
{
|
if(!empty($mybb->user['threadmode'])) // Take user's default preference first (if there is one) and run with it { $mybb->input['mode'] = $mybb->user['threadmode']; } else if($mybb->settings['threadusenetstyle'] == 1) { $mybb->input['mode'] = 'threaded'; } else { $mybb->input['mode'] = 'linear'; }
| $defaultmode = $mybb->user['threadmode']; } else if($mybb->settings['threadusenetstyle'] == 1) { $defaultmode = 'threaded'; } else { $defaultmode = 'linear'; } // If mode is unset, set the default mode if(!isset($mybb->input['mode'])) { $mybb->input['mode'] = $defaultmode;
|
}
// Threaded or linear display? if($mybb->input['mode'] == 'threaded') { $isfirst = 1;
|
}
// Threaded or linear display? if($mybb->input['mode'] == 'threaded') { $isfirst = 1;
|
|
|
// Are we linked to a specific pid? if($mybb->input['pid']) {
| // Are we linked to a specific pid? if($mybb->input['pid']) {
|
Zeile 729 | Zeile 734 |
---|
$upper = $start+$perpage; // Work out if we have terms to highlight
|
$upper = $start+$perpage; // Work out if we have terms to highlight
|
$highlight = ""; if($mybb->input['highlight']) { if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))
| $highlight = ""; $threadmode = ""; if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1)) { if($mybb->input['highlight']) { $highlight = "?highlight=".urlencode($mybb->input['highlight']); } if($defaultmode != "linear")
|
{
|
{
|
$highlight = "?highlight=".urlencode($mybb->input['highlight']);
| if($mybb->input['highlight']) { $threadmode = "&mode=linear"; } else { $threadmode = "?mode=linear"; }
|
}
|
}
|
else { $highlight = "&highlight=".urlencode($mybb->input['highlight']); } }
| } else { if($mybb->input['highlight']) { $highlight = "&highlight=".urlencode($mybb->input['highlight']); } if($defaultmode != "linear") { $threadmode = "&mode=linear"; } }
|
|
|
$multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED.$highlight));
| $multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED.$highlight.$threadmode));
|
if($postcount > $perpage) { eval("\$threadpages = \"".$templates->get("showthread_multipage")."\";");
| if($postcount > $perpage) { eval("\$threadpages = \"".$templates->get("showthread_multipage")."\";");
|
Zeile 912 | Zeile 938 |
---|
{ $postoptionschecked['emailnotify'] = 'checked="checked"'; }
|
{ $postoptionschecked['emailnotify'] = 'checked="checked"'; }
|
mt_srand((double) microtime() * 1000000); $posthash = md5($mybb->user['uid'].mt_rand());
| $posthash = md5($mybb->user['uid'].random_str());
|
eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";"); }
| eval("\$quickreply = \"".$templates->get("showthread_quickreply")."\";"); }
|