Zeile 88 | Zeile 88 |
---|
else { $ismod = false;
|
else { $ismod = false;
|
| }
$forumpermissions = forum_permissions($thread['fid']);
// Does the user have permission to view this thread? if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1) { error_no_permission(); }
if($forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid']) { error_no_permission();
|
}
// Make sure we are looking at a real thread here.
| }
// Make sure we are looking at a real thread here.
|
Zeile 117 | Zeile 130 |
---|
if($ismod == true) { $threadcount += $forum_threads['unapprovedthreads'];
|
if($ismod == true) { $threadcount += $forum_threads['unapprovedthreads'];
|
| }
// Limit to only our own threads $uid_only = ''; if($forumpermissions['canonlyviewownthreads'] == 1) { $uid_only = " AND uid = '".$mybb->user['uid']."'";
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $uid_only", array('limit' => 1)); $threadcount = $db->fetch_field($query, "threads");
|
}
// If we have 0 threads double check there aren't any "moved" threads if($threadcount == 0) {
|
}
// If we have 0 threads double check there aren't any "moved" threads if($threadcount == 0) {
|
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly", array('limit' => 1));
| $query = $db->simple_select("threads", "COUNT(tid) AS threads", "fid = '$fid' $visibleonly $uid_only", array('limit' => 1));
|
$threadcount = $db->fetch_field($query, "threads");
|
$threadcount = $db->fetch_field($query, "threads");
|
}
| }
|
$stickybit = " OR sticky=1"; if($thread['sticky'] == 1)
| $stickybit = " OR sticky=1"; if($thread['sticky'] == 1)
|
Zeile 139 | Zeile 162 |
---|
$query = $db->query(" SELECT COUNT(tid) as threads FROM ".TABLE_PREFIX."threads
|
$query = $db->query(" SELECT COUNT(tid) as threads FROM ".TABLE_PREFIX."threads
|
WHERE fid = '$fid' AND (lastpost >= '".intval($thread['lastpost'])."'{$stickybit}) {$visibleonly}
| WHERE fid = '$fid' AND (lastpost >= '".intval($thread['lastpost'])."'{$stickybit}) {$visibleonly} {$uid_only}
|
GROUP BY lastpost ORDER BY lastpost DESC "); break; default:
|
GROUP BY lastpost ORDER BY lastpost DESC "); break; default:
|
$query = $db->simple_select("threads", "COUNT(tid) as threads", "fid = '$fid' AND (lastpost >= '".intval($thread['lastpost'])."'{$stickybit}) {$visibleonly}", array('order_by' => 'lastpost', 'order_dir' => 'desc'));
| $query = $db->simple_select("threads", "COUNT(tid) as threads", "fid = '$fid' AND (lastpost >= '".intval($thread['lastpost'])."'{$stickybit}) {$visibleonly} {$uid_only}", array('order_by' => 'lastpost', 'order_dir' => 'desc'));
|
}
$thread_position = $db->fetch_field($query, "threads");
| }
$thread_position = $db->fetch_field($query, "threads");
|
Zeile 154 | Zeile 177 |
---|
// Build the navigation. build_forum_breadcrumb($fid, array('num_threads' => $threadcount, 'current_page' => $thread_page)); add_breadcrumb($thread['displayprefix'].$thread['subject'], get_thread_link($thread['tid']));
|
// Build the navigation. build_forum_breadcrumb($fid, array('num_threads' => $threadcount, 'current_page' => $thread_page)); add_breadcrumb($thread['displayprefix'].$thread['subject'], get_thread_link($thread['tid']));
|
// Does the user have permission to view this thread? $forumpermissions = forum_permissions($forum['fid']);
if($forumpermissions['canview'] != 1 || $forumpermissions['canviewthreads'] != 1) { error_no_permission(); }
if($forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid']) { error_no_permission(); }
| |
// Check if this forum is password protected and we have a valid password check_forum_password($forum['fid']);
|
// 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']) { $mybb->input['action'] = "thread"; }
|
// If there is no specific action, we must be looking at the thread. if(!$mybb->input['action']) { $mybb->input['action'] = "thread"; }
|
| |
// Jump to the unread posts. if($mybb->input['action'] == "newpost")
| // Jump to the unread posts. if($mybb->input['action'] == "newpost")
|
Zeile 194 | Zeile 203 |
---|
if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
} }
| } }
|
else { $forum_read = my_get_array_cookie("forumread", $fid);
| else { $forum_read = my_get_array_cookie("forumread", $fid);
|
Zeile 228 | Zeile 237 |
---|
else { $lastread = $forum_read;
|
else { $lastread = $forum_read;
|
} }
| } }
|
if($cutoff && $lastread < $cutoff) {
| if($cutoff && $lastread < $cutoff) {
|
Zeile 248 | Zeile 257 |
---|
if($newpost['pid'] && $lastread) {
|
if($newpost['pid'] && $lastread) {
|
header("Location: ".htmlspecialchars_decode(get_post_link($newpost['pid'], $tid))."#pid{$newpost['pid']}");
| $highlight = ''; if($mybb->input['highlight']) { $string = "&"; if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1)) { $string = "?"; }
$highlight = $string."highlight=".$mybb->input['highlight']; }
header("Location: ".htmlspecialchars_decode(get_post_link($newpost['pid'], $tid)).$highlight."#pid{$newpost['pid']}");
|
} else {
| } else {
|
Zeile 636 | Zeile 657 |
---|
else { $visible = "AND p.visible='1'";
|
else { $visible = "AND p.visible='1'";
|
}
| }
|
// Can this user perform searches? If so, we can show them the "Search thread" form if($forumpermissions['cansearch'] != 0) {
| // Can this user perform searches? If so, we can show them the "Search thread" form if($forumpermissions['cansearch'] != 0) {
|
Zeile 647 | Zeile 668 |
---|
// Fetch the ignore list for the current user if they have one $ignored_users = array(); if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")
|
// Fetch the ignore list for the current user if they have one $ignored_users = array(); if($mybb->user['uid'] > 0 && $mybb->user['ignorelist'] != "")
|
{
| {
|
$ignore_list = explode(',', $mybb->user['ignorelist']); foreach($ignore_list as $uid) { $ignored_users[$uid] = 1; } }// Which thread mode is our user using by default?
|
$ignore_list = explode(',', $mybb->user['ignorelist']); foreach($ignore_list as $uid) { $ignored_users[$uid] = 1; } }// Which thread mode is our user using by default?
|
if(!empty($mybb->user['threadmode'])) { $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; } // Which thread mode is our user using by default?
| if(!empty($mybb->user['threadmode'])) { $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; } // Which thread mode is our user using by default?
|
if(!empty($mybb->user['threadmode'])) { $defaultmode = $mybb->user['threadmode'];
| if(!empty($mybb->user['threadmode'])) { $defaultmode = $mybb->user['threadmode'];
|
Zeile 721 | Zeile 742 |
---|
if(!$mybb->input['pid']) { $mybb->input['pid'] = $showpost['pid'];
|
if(!$mybb->input['pid']) { $mybb->input['pid'] = $showpost['pid'];
|
}
| }
|
// Is there actually a pid to display? if(!$showpost['pid']) {
| // Is there actually a pid to display? if(!$showpost['pid']) {
|
Zeile 772 | Zeile 793 |
---|
if(!$mybb->settings['postsperpage']) { $mybb->settings['postperpage'] = 20;
|
if(!$mybb->settings['postsperpage']) { $mybb->settings['postperpage'] = 20;
|
}
| }
|
// Figure out if we need to display multiple pages. $perpage = $mybb->settings['postsperpage']; if($mybb->input['page'] != "last")
| // Figure out if we need to display multiple pages. $perpage = $mybb->settings['postsperpage']; if($mybb->input['page'] != "last")
|
Zeile 1148 | Zeile 1169 |
---|
if($user['invisible'] == 1) { $invisiblemark = "*";
|
if($user['invisible'] == 1) { $invisiblemark = "*";
|
++$inviscount;
| if($user['uid'] != $mybb->user['uid']) { ++$inviscount; }
|
} else
|
} else
|
{
| {
|
$invisiblemark = ''; }
| $invisiblemark = ''; }
|
Zeile 1165 | Zeile 1190 |
---|
} } }
|
} } }
|
}
| } $invisonline = ''; $onlinesep2 = $onlinesep = ''; if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1) { if($onlinemembers) { $onlinesep = $lang->comma; }
$invisonline = $lang->sprintf($lang->users_browsing_thread_invis, $inviscount); }
|
if($guestcount)
|
if($guestcount)
|
{
| { if($onlinemembers) { $onlinesep2 = $lang->comma; }
|
$guestsonline = $lang->sprintf($lang->users_browsing_thread_guests, $guestcount);
|
$guestsonline = $lang->sprintf($lang->users_browsing_thread_guests, $guestcount);
|
} if($guestcount && $onlinemembers) { $onlinesep = $lang->comma; } $invisonline = ''; if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1)) { $invisonline = $lang->sprintf($lang->users_browsing_thread_invis, $inviscount); } if($invisonline != '' && $guestcount) { $onlinesep2 = $lang->comma; }
| }
|
eval("\$usersbrowsing = \"".$templates->get("showthread_usersbrowsing")."\";"); }
| eval("\$usersbrowsing = \"".$templates->get("showthread_usersbrowsing")."\";"); }
|