Zeile 6 | Zeile 6 |
---|
* 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 4081 2008-08-08 01:47:02Z Tikitiki $
| * $Id: showthread.php 4276 2008-11-23 03:01:33Z Tikitiki $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 16 | Zeile 16 |
---|
$templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage"; $templatelist .= ",postbit_editedby,showthread_similarthreads,showthread_similarthreads_bit,postbit_iplogged_show,postbit_iplogged_hiden,showthread_quickreply"; $templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,showthread_multipage,postbit_reputation,postbit_quickdelete,postbit_attachments,thumbnails_thumbnail,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_attachments_images_image,postbit_attachments_images,postbit_posturl";
|
$templatelist .= ",multipage_prevpage,multipage_nextpage,multipage_page_current,multipage_page,multipage_start,multipage_end,multipage"; $templatelist .= ",postbit_editedby,showthread_similarthreads,showthread_similarthreads_bit,postbit_iplogged_show,postbit_iplogged_hiden,showthread_quickreply"; $templatelist .= ",forumjump_advanced,forumjump_special,forumjump_bit,showthread_multipage,postbit_reputation,postbit_quickdelete,postbit_attachments,thumbnails_thumbnail,postbit_attachments_attachment,postbit_attachments_thumbnails,postbit_attachments_images_image,postbit_attachments_images,postbit_posturl";
|
$templatelist .= ",postbit_inlinecheck,showthread_inlinemoderation,postbit_attachments_thumbnails_thumbnail,postbit_quickquote,postbit_qqmessage,postbit_seperator,postbit_groupimage,postbit_multiquote,showthread_search,postbit_warn,postbit_warninglevel,showthread_moderationoptions_custom_tool,showthread_moderationoptions_custom,showthread_inlinemoderation_custom_tool,showthread_inlinemoderation_custom,postbit_classic,showthread_classic_header";
| $templatelist .= ",postbit_inlinecheck,showthread_inlinemoderation,postbit_attachments_thumbnails_thumbnail,postbit_quickquote,postbit_qqmessage,postbit_seperator,postbit_groupimage,postbit_multiquote,showthread_search,postbit_warn,postbit_warninglevel,showthread_moderationoptions_custom_tool,showthread_moderationoptions_custom,showthread_inlinemoderation_custom_tool,showthread_inlinemoderation_custom,postbit_classic,showthread_classic_header,showthread_poll_resultbit,showthread_poll_results";
|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
| require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
Zeile 118 | Zeile 118 |
---|
$query = $db->simple_select("threadsread", "dateline", "uid='{$mybb->user['uid']}' AND tid='{$thread['tid']}'"); $thread_read = $db->fetch_field($query, "dateline");
|
$query = $db->simple_select("threadsread", "dateline", "uid='{$mybb->user['uid']}' AND tid='{$thread['tid']}'"); $thread_read = $db->fetch_field($query, "dateline");
|
// Get forum read date $forumread = my_get_array_cookie("forumread", $fid);
// If last visit is greater than forum read, change forum read date if($mybb->user['lastvisit'] > $forumread)
| if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
|
{
|
{
|
$forumread = $mybb->user['lastvisit'];
| $query = $db->simple_select("forumsread", "dateline", "fid='{$fid}' AND uid='{$mybb->user['uid']}'"); $forum_read = $db->fetch_field($query, "dateline"); $read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff; } } else { $forum_read = my_get_array_cookie("forumread", $fid);
|
}
|
}
|
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $thread['lastpost'] > $forumread)
| if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $thread['lastpost'] > $forum_read)
|
{ $cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($thread['lastpost'] > $cutoff)
| { $cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($thread['lastpost'] > $cutoff)
|
Zeile 141 | Zeile 149 |
---|
} } }
|
} } }
|
|
|
if(!$lastread)
|
if(!$lastread)
|
{
| {
|
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
|
$readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
|
if($readcookie > $forumread) {
| if($readcookie > $forum_read) {
|
$lastread = $readcookie;
|
$lastread = $readcookie;
|
}
| }
|
else {
|
else {
|
$lastread = $forumread;
| $lastread = $forum_read;
|
} }
|
} }
|
|
|
// Next, find the proper pid to link to. $options = array( "limit_start" => 0,
| // Next, find the proper pid to link to. $options = array( "limit_start" => 0,
|
Zeile 164 | Zeile 174 |
---|
$newpost = $db->fetch_array($query); if($newpost['pid']) {
|
$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 {
|
Zeile 199 | Zeile 209 |
---|
$query = $db->simple_select('posts', 'pid', "tid={$tid}", $options); $pid = $db->fetch_field($query, "pid"); }
|
$query = $db->simple_select('posts', 'pid', "tid={$tid}", $options); $pid = $db->fetch_field($query, "pid"); }
|
header("Location:".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");
| header("Location: ".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");
|
exit;
|
exit;
|
}
| }
|
// Jump to the next newest posts. if($mybb->input['action'] == "nextnewest")
| // Jump to the next newest posts. if($mybb->input['action'] == "nextnewest")
|
Zeile 218 | Zeile 228 |
---|
if(!$nextthread['tid']) { error($lang->error_nonextnewest);
|
if(!$nextthread['tid']) { error($lang->error_nonextnewest);
|
}
| }
|
$options = array( "limit_start" => 0, "limit" => 1,
| $options = array( "limit_start" => 0, "limit" => 1,
|
Zeile 226 | Zeile 236 |
---|
"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.
| // Redirect to the proper page.
|
$pid = $db->fetch_field($query, "pid");
|
$pid = $db->fetch_field($query, "pid");
|
header("Location:".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");
| header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");
|
}
// Jump to the next oldest posts. if($mybb->input['action'] == "nextoldest")
|
}
// Jump to the next oldest posts. if($mybb->input['action'] == "nextoldest")
|
{ $options = array( "limit" => 1, "limit_start" => 0,
| { $options = array( "limit" => 1, "limit_start" => 0,
|
"order_by" => "lastpost", "order_dir" => "desc" );
| "order_by" => "lastpost", "order_dir" => "desc" );
|
Zeile 246 | Zeile 256 |
---|
// Are there actually next oldest posts? if(!$nextthread['tid'])
|
// Are there actually next oldest posts? if(!$nextthread['tid'])
|
{
| {
|
error($lang->error_nonextoldest); } $options = array(
| error($lang->error_nonextoldest); } $options = array(
|
Zeile 259 | Zeile 269 |
---|
// Redirect to the proper page. $pid = $db->fetch_field($query, "pid");
|
// Redirect to the proper page. $pid = $db->fetch_field($query, "pid");
|
header("Location:".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");
| header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}");
|
}
if($mybb->input['pid'])
| }
if($mybb->input['pid'])
|
Zeile 275 | Zeile 285 |
---|
if($thread['firstpost'] == 0) { update_first_post($tid);
|
if($thread['firstpost'] == 0) { update_first_post($tid);
|
}
| }
|
// Does this thread have a poll? if($thread['poll']) {
| // Does this thread have a poll? if($thread['poll']) {
|
Zeile 494 | Zeile 504 |
---|
{ $modoptions = " "; $inlinemod = "";
|
{ $modoptions = " "; $inlinemod = "";
|
}
| }
|
// Increment the thread view. if($mybb->settings['delayedthreadviews'] == 1) {
| // Increment the thread view. if($mybb->settings['delayedthreadviews'] == 1) {
|
Zeile 520 | Zeile 530 |
---|
} else {
|
} else {
|
$thread['averagerating'] = intval(round($thread['totalratings']/$thread['numratings'], 2)); $thread['width'] = $thread['averagerating']*20;
| $thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2)); $thread['width'] = intval($thread['averagerating'])*20;
|
$thread['numratings'] = intval($thread['numratings']); }
| $thread['numratings'] = intval($thread['numratings']); }
|
Zeile 717 | Zeile 727 |
---|
$page = 1; } $upper = $start+$perpage;
|
$page = 1; } $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 = "?highlight=".urlencode($mybb->input['highlight']); } else { $highlight = "&highlight=".urlencode($mybb->input['highlight']); } }
|
|
|
$multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED));
| $multipage = multipage($postcount, $perpage, $page, str_replace("{tid}", $tid, THREAD_URL_PAGED.$highlight));
|
if($postcount > $perpage) { eval("\$threadpages = \"".$templates->get("showthread_multipage")."\";");
| if($postcount > $perpage) { eval("\$threadpages = \"".$templates->get("showthread_multipage")."\";");
|