Zeile 204 | Zeile 204 |
---|
if($mybb->input['action'] == "newpost") { // First, figure out what time the thread or forum were last read
|
if($mybb->input['action'] == "newpost") { // First, figure out what time the thread or forum were last read
|
| $lastread = $cutoff = 0;
|
$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");
|
Zeile 269 | Zeile 270 |
---|
$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options); $newpost = $db->fetch_array($query);
|
$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options); $newpost = $db->fetch_array($query);
|
if($newpost['pid'] && $lastread)
| if($newpost && $lastread)
|
{ $highlight = ''; if($mybb->get_input('highlight'))
| { $highlight = ''; if($mybb->get_input('highlight'))
|
Zeile 333 | Zeile 334 |
---|
$nextthread = $db->fetch_array($query);
// Are there actually next newest posts?
|
$nextthread = $db->fetch_array($query);
// Are there actually next newest posts?
|
if(!$nextthread['tid'])
| if(!$nextthread)
|
{ error($lang->error_nonextnewest); }
| { error($lang->error_nonextnewest); }
|
Zeile 363 | Zeile 364 |
---|
$nextthread = $db->fetch_array($query);
// Are there actually next oldest posts?
|
$nextthread = $db->fetch_array($query);
// Are there actually next oldest posts?
|
if(!$nextthread['tid'])
| if(!$nextthread)
|
{ error($lang->error_nonextoldest); }
| { error($lang->error_nonextoldest); }
|
Zeile 617 | Zeile 618 |
---|
// Decide what poll status to show depending on the status of the poll and whether or not the user voted already. if(isset($alreadyvoted) || isset($showresults) || isset($nopermission)) {
|
// Decide what poll status to show depending on the status of the poll and whether or not the user voted already. if(isset($alreadyvoted) || isset($showresults) || isset($nopermission)) {
|
if($alreadyvoted)
| $undovote = '';
if(isset($alreadyvoted))
|
{ $pollstatus = $lang->already_voted;
|
{ $pollstatus = $lang->already_voted;
|
$undovote = '';
| |
if($mybb->usergroup['canundovotes'] == 1) { eval("\$undovote = \"".$templates->get("showthread_poll_undovote")."\";"); } }
|
if($mybb->usergroup['canundovotes'] == 1) { eval("\$undovote = \"".$templates->get("showthread_poll_undovote")."\";"); } }
|
elseif($nopermission)
| elseif(isset($nopermission))
|
{ $pollstatus = $lang->no_voting_permission; }
| { $pollstatus = $lang->no_voting_permission; }
|
Zeile 665 | Zeile 667 |
---|
}
// Create the forum jump dropdown box.
|
}
// Create the forum jump dropdown box.
|
| $forumjump = '';
|
if($mybb->settings['enableforumjump'] != 0) { $forumjump = build_forum_jump("", $fid, 1);
| if($mybb->settings['enableforumjump'] != 0) { $forumjump = build_forum_jump("", $fid, 1);
|
Zeile 797 | Zeile 800 |
---|
}
// Can this user perform searches? If so, we can show them the "Search thread" form
|
}
// Can this user perform searches? If so, we can show them the "Search thread" form
|
| $search_thread='';
|
if($forumpermissions['cansearch'] != 0) { eval("\$search_thread = \"".$templates->get("showthread_search")."\";");
| if($forumpermissions['cansearch'] != 0) { eval("\$search_thread = \"".$templates->get("showthread_search")."\";");
|
Zeile 819 | Zeile 823 |
---|
$defaultmode = $mybb->user['threadmode']; } else if($mybb->settings['threadusenetstyle'] == 1)
|
$defaultmode = $mybb->user['threadmode']; } else if($mybb->settings['threadusenetstyle'] == 1)
|
{
| {
|
$defaultmode = 'threaded';
|
$defaultmode = 'threaded';
|
}
| }
|
else
|
else
|
{
| {
|
$defaultmode = 'linear';
|
$defaultmode = 'linear';
|
}
| }
|
// If mode is unset, set the default mode if(!isset($mybb->input['mode'])) { $mybb->input['mode'] = $defaultmode;
|
// If mode is unset, set the default mode if(!isset($mybb->input['mode'])) { $mybb->input['mode'] = $defaultmode;
|
}
| }
|
// Threaded or linear display? $threadexbox = ''; if($mybb->get_input('mode') == 'threaded')
| // Threaded or linear display? $threadexbox = ''; if($mybb->get_input('mode') == 'threaded')
|
Zeile 844 | Zeile 848 |
---|
if($mybb->input['pid']) { $where = "AND p.pid='".$mybb->input['pid']."'";
|
if($mybb->input['pid']) { $where = "AND p.pid='".$mybb->input['pid']."'";
|
}
| }
|
else { $where = " ORDER BY dateline, pid LIMIT 0, 1";
| else { $where = " ORDER BY dateline, pid LIMIT 0, 1";
|
Zeile 857 | Zeile 861 |
---|
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' $visibleonly_p $where
|
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' $visibleonly_p $where
|
");
| ");
|
$showpost = $db->fetch_array($query);
|
$showpost = $db->fetch_array($query);
|
| // Is there actually a pid to display? if(!$showpost) { error($lang->error_invalidpost); }
|
// Choose what pid to display. if(!$mybb->input['pid']) { $mybb->input['pid'] = $showpost['pid'];
|
// Choose what pid to display. if(!$mybb->input['pid']) { $mybb->input['pid'] = $showpost['pid'];
|
}
// Is there actually a pid to display? if(!$showpost['pid']) { error($lang->error_invalidpost); }
| }
|
$attachcache = array(); if($mybb->settings['enableattachments'] == 1 && $thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts')) {
| $attachcache = array(); if($mybb->settings['enableattachments'] == 1 && $thread['attachmentcount'] > 0 || is_moderator($fid, 'caneditposts')) {
|
Zeile 880 | Zeile 884 |
---|
while($attachment = $db->fetch_array($query)) { $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
|
while($attachment = $db->fetch_array($query)) { $attachcache[$attachment['pid']][$attachment['aid']] = $attachment;
|
} }
$multipage = '';
| } }
$multipage = '';
|
// Build the threaded post display tree. $query = $db->query("
| // Build the threaded post display tree. $query = $db->query("
|
Zeile 895 | Zeile 899 |
---|
"); $postsdone = array(); while($post = $db->fetch_array($query))
|
"); $postsdone = array(); while($post = $db->fetch_array($query))
|
{
| {
|
if(empty($postsdone[$post['pid']])) { if($post['pid'] == $mybb->input['pid'] || ($isfirst && !$mybb->input['pid']))
| if(empty($postsdone[$post['pid']])) { if($post['pid'] == $mybb->input['pid'] || ($isfirst && !$mybb->input['pid']))
|
Zeile 920 | Zeile 924 |
---|
if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) { $mybb->settings['postsperpage'] = 20;
|
if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1) { $mybb->settings['postsperpage'] = 20;
|
}
| }
|
// Figure out if we need to display multiple pages. $page = 1;
| // Figure out if we need to display multiple pages. $page = 1;
|
Zeile 993 | Zeile 997 |
---|
if($mybb->get_input('page') == "last") { $page = $pages;
|
if($mybb->get_input('page') == "last") { $page = $pages;
|
}
| }
|
if($page > $pages || $page <= 0) { $page = 1;
| if($page > $pages || $page <= 0) { $page = 1;
|
Zeile 1019 | Zeile 1023 |
---|
if($mybb->get_input('highlight')) { $highlight = "?highlight=".urlencode($mybb->get_input('highlight'));
|
if($mybb->get_input('highlight')) { $highlight = "?highlight=".urlencode($mybb->get_input('highlight'));
|
}
| }
|
if($defaultmode != "linear") { if($mybb->get_input('highlight'))
|
if($defaultmode != "linear") { if($mybb->get_input('highlight'))
|
{
| {
|
$threadmode = "&mode=linear"; } else { $threadmode = "?mode=linear";
|
$threadmode = "&mode=linear"; } else { $threadmode = "?mode=linear";
|
} } } else
| } } } else
|
{ if(!empty($mybb->input['highlight'])) {
| { if(!empty($mybb->input['highlight'])) {
|
Zeile 1045 | Zeile 1049 |
---|
} } else
|
} } else
|
{
| {
|
$highlight = "&highlight=".urlencode($mybb->get_input('highlight')); } }
| $highlight = "&highlight=".urlencode($mybb->get_input('highlight')); } }
|
Zeile 1070 | Zeile 1074 |
---|
if(empty($pid)) { $pid = $getid['pid'];
|
if(empty($pid)) { $pid = $getid['pid'];
|
}
| }
|
// Gather a comma separated list of post IDs $pids .= "$comma'{$getid['pid']}'"; $comma = ",";
| // Gather a comma separated list of post IDs $pids .= "$comma'{$getid['pid']}'"; $comma = ",";
|
Zeile 1120 | Zeile 1124 |
---|
$plugins->run_hooks("showthread_linear"); } $lang->thread_toggle = $lang->{$thread_toggle};
|
$plugins->run_hooks("showthread_linear"); } $lang->thread_toggle = $lang->{$thread_toggle};
|
|
|
// Show the similar threads table if wanted. $similarthreads = ''; if($mybb->settings['showsimilarthreads'] != 0) { $own_perm = '';
|
// Show the similar threads table if wanted. $similarthreads = ''; if($mybb->settings['showsimilarthreads'] != 0) { $own_perm = '';
|
if($forumpermissions['canonlyviewownthreads'] == 1)
| if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1)
|
{ $own_perm = " AND t.uid={$mybb->user['uid']}";
|
{ $own_perm = " AND t.uid={$mybb->user['uid']}";
|
}
| }
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 1139 | Zeile 1143 |
---|
FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid), plainto_tsquery ('".$db->escape_string($thread['subject'])."') AS query WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query{$own_perm}
|
FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid), plainto_tsquery ('".$db->escape_string($thread['subject'])."') AS query WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query{$own_perm}
|
ORDER BY t.lastpost DESC
| ORDER BY t.lastpost DESC
|
OFFSET 0 LIMIT {$mybb->settings['similarlimit']} "); break;
| OFFSET 0 LIMIT {$mybb->settings['similarlimit']} "); break;
|
Zeile 1172 | Zeile 1176 |
---|
else { $icon = " ";
|
else { $icon = " ";
|
} if(!$similar_thread['username'])
| } if(!$similar_thread['username'])
|
{ $similar_thread['username'] = $similar_thread['profilelink'] = htmlspecialchars_uni($similar_thread['threadusername']); }
| { $similar_thread['username'] = $similar_thread['profilelink'] = htmlspecialchars_uni($similar_thread['threadusername']); }
|
Zeile 1191 | Zeile 1195 |
---|
{ $similar_thread['threadprefix'] = $prefix['displaystyle'].' '; }
|
{ $similar_thread['threadprefix'] = $prefix['displaystyle'].' '; }
|
| } else { $similar_thread['threadprefix'] = '';
|
}
$similar_thread['subject'] = $parser->parse_badwords($similar_thread['subject']);
| }
$similar_thread['subject'] = $parser->parse_badwords($similar_thread['subject']);
|
Zeile 1316 | Zeile 1324 |
---|
{ eval("\$viewnotes = \"".$templates->get("showthread_threadnotes_viewnotes")."\";"); $thread['notes'] = my_substr($thread['notes'], 0, 200)."... {$viewnotes}";
|
{ eval("\$viewnotes = \"".$templates->get("showthread_threadnotes_viewnotes")."\";"); $thread['notes'] = my_substr($thread['notes'], 0, 200)."... {$viewnotes}";
|
| }
if(!isset($collapsedthead['threadnotes'])) { $collapsedthead['threadnotes'] = ''; } if(!isset($collapsedimg['threadnotes'])) { $collapsedimg['threadnotes'] = ''; } if(!isset($collapsed['threadnotes_e'])) { $collapsed['threadnotes_e'] = '';
|
}
$expaltext = (in_array("threadnotes", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse; eval("\$threadnotesbox = \"".$templates->get("showthread_threadnotes")."\";");
|
}
$expaltext = (in_array("threadnotes", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse; eval("\$threadnotesbox = \"".$templates->get("showthread_threadnotes")."\";");
|
}
| }
|
if(is_moderator($forum['fid'], "canusecustomtools") && (!empty($forum_stats[-1]['modtools']) || !empty($forum_stats[$forum['fid']]['modtools']))) { $gids = explode(',', $mybb->user['additionalgroups']);
| if(is_moderator($forum['fid'], "canusecustomtools") && (!empty($forum_stats[-1]['modtools']) || !empty($forum_stats[$forum['fid']]['modtools']))) { $gids = explode(',', $mybb->user['additionalgroups']);
|
Zeile 1332 | Zeile 1353 |
---|
{ case "pgsql": case "sqlite":
|
{ case "pgsql": case "sqlite":
|
foreach($gids as $gid) { $gid = (int)$gid;
| foreach($gids as $gid) { $gid = (int)$gid;
|
$gidswhere .= " OR ','||groups||',' LIKE '%,{$gid},%'"; } $query = $db->simple_select("modtools", 'tid, name, type', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND (groups='' OR ','||groups||',' LIKE '%,-1,%'{$gidswhere})");
| $gidswhere .= " OR ','||groups||',' LIKE '%,{$gid},%'"; } $query = $db->simple_select("modtools", 'tid, name, type', "(','||forums||',' LIKE '%,$fid,%' OR ','||forums||',' LIKE '%,-1,%' OR forums='') AND (groups='' OR ','||groups||',' LIKE '%,-1,%'{$gidswhere})");
|
Zeile 1384 | Zeile 1405 |
---|
if(is_moderator($forum['fid'], "candeleteposts")) { eval("\$inlinemoddelete = \"".$templates->get("showthread_inlinemoderation_delete")."\";");
|
if(is_moderator($forum['fid'], "candeleteposts")) { eval("\$inlinemoddelete = \"".$templates->get("showthread_inlinemoderation_delete")."\";");
|
}
| }
|
if(is_moderator($forum['fid'], "canmanagethreads")) {
| if(is_moderator($forum['fid'], "canmanagethreads")) {
|
Zeile 1409 | Zeile 1430 |
---|
// Build thread moderation dropdown if(!empty($customthreadtools))
|
// Build thread moderation dropdown if(!empty($customthreadtools))
|
{
| {
|
eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";");
|
eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";");
|
}
| }
|
$openclosethread = $stickunstickthread = $deletethread = $threadnotes = $managethread = $adminpolloptions = $approveunapprovethread = $softdeletethread = '';
if(is_moderator($forum['fid'], "canopenclosethreads")) {
|
$openclosethread = $stickunstickthread = $deletethread = $threadnotes = $managethread = $adminpolloptions = $approveunapprovethread = $softdeletethread = '';
if(is_moderator($forum['fid'], "canopenclosethreads")) {
|
| if($thread['closed']) { $lang->open_close_thread = $lang->open_thread; } else { $lang->open_close_thread = $lang->close_thread; }
|
eval("\$openclosethread = \"".$templates->get("showthread_moderationoptions_openclose")."\";"); }
if(is_moderator($forum['fid'], "canstickunstickthreads")) {
|
eval("\$openclosethread = \"".$templates->get("showthread_moderationoptions_openclose")."\";"); }
if(is_moderator($forum['fid'], "canstickunstickthreads")) {
|
| if($thread['sticky']) { $lang->stick_unstick_thread = $lang->unstick_thread; } else { $lang->stick_unstick_thread = $lang->stick_thread; }
|
eval("\$stickunstickthread = \"".$templates->get("showthread_moderationoptions_stickunstick")."\";"); }
| eval("\$stickunstickthread = \"".$templates->get("showthread_moderationoptions_stickunstick")."\";"); }
|
Zeile 1519 | Zeile 1556 |
---|
}
// Get users viewing this thread
|
}
// Get users viewing this thread
|
| $usersbrowsing='';
|
if($mybb->settings['browsingthisthread'] != 0) { $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
| if($mybb->settings['browsingthisthread'] != 0) { $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
|
Zeile 1551 | Zeile 1589 |
---|
$doneusers[$user['uid']] = $user['time'];
$invisiblemark = '';
|
$doneusers[$user['uid']] = $user['time'];
$invisiblemark = '';
|
if($user['invisible'] == 1 && $mybb->usergroup['canbeinvisible'] == 1)
| if($user['invisible'] == 1)
|
{ $invisiblemark = "*"; ++$inviscount;
| { $invisiblemark = "*"; ++$inviscount;
|