Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: showthread.php 5639 2011-10-26 09:16:47Z Tomm $
| * $Id: showthread.php 5758 2012-03-09 15:26:44Z Tomm $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 80 | Zeile 80 |
---|
}
$visibleonly = "AND visible='1'";
|
}
$visibleonly = "AND visible='1'";
|
| $visibleonly2 = "AND p.visible='1' AND t.visible='1'";
|
// Is the currently logged in user a moderator of this forum? if(is_moderator($fid)) { $visibleonly = " AND (visible='1' OR visible='0')";
|
// Is the currently logged in user a moderator of this forum? if(is_moderator($fid)) { $visibleonly = " AND (visible='1' OR visible='0')";
|
| $visibleonly2 = "AND (p.visible='1' OR p.visible='0') AND (t.visible='1' OR t.visible='0')";
|
$ismod = true; } else
| $ismod = true; } else
|
Zeile 122 | Zeile 124 |
---|
// Forumdisplay cache $forum_stats = $cache->read("forumsdisplay");
|
// Forumdisplay cache $forum_stats = $cache->read("forumsdisplay");
|
if(!is_array($forum_stats)) { // Attempt to rebuild it? $forum_stats = $cache->read("forumdisplay", true);
if(!is_array($forum_stats)) { $forum_stats = array(); } }
| |
$breadcrumb_multipage = array(); if($mybb->settings['showforumpagesbreadcrumb'])
| $breadcrumb_multipage = array(); if($mybb->settings['showforumpagesbreadcrumb'])
|
Zeile 212 | Zeile 203 |
---|
{ $mybb->input['action'] = "thread"; }
|
{ $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 244 | Zeile 235 |
---|
if($thread_read) { $lastread = $thread_read;
|
if($thread_read) { $lastread = $thread_read;
|
}
| }
|
else { // Set $lastread to zero to make sure 'lastpost' is invoked in the last IF
| else { // Set $lastread to zero to make sure 'lastpost' is invoked in the last IF
|
Zeile 259 | Zeile 250 |
---|
if($readcookie > $forum_read) { $lastread = $readcookie;
|
if($readcookie > $forum_read) { $lastread = $readcookie;
|
}
| }
|
else { $lastread = $forum_read;
| else { $lastread = $forum_read;
|
Zeile 280 | Zeile 271 |
---|
);
$lastread = intval($lastread);
|
);
$lastread = intval($lastread);
|
$query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}'", $options);
| $query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options);
|
$newpost = $db->fetch_array($query); if($newpost['pid'] && $lastread)
| $newpost = $db->fetch_array($query); if($newpost['pid'] && $lastread)
|
Zeile 315 | Zeile 306 |
---|
SELECT p.pid FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON(p.tid=t.tid)
|
SELECT p.pid FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON(p.tid=t.tid)
|
WHERE t.fid='".$thread['fid']."' AND t.closed NOT LIKE 'moved|%'
| WHERE t.fid='".$thread['fid']."' AND t.closed NOT LIKE 'moved|%' {$visibleonly2}
|
ORDER BY p.dateline DESC LIMIT 1 ");
| ORDER BY p.dateline DESC LIMIT 1 ");
|
Zeile 329 | Zeile 320 |
---|
'limit_start' => 0, 'limit' => 1 );
|
'limit_start' => 0, 'limit' => 1 );
|
$query = $db->simple_select('posts', 'pid', "tid={$tid}", $options);
| $query = $db->simple_select('posts', 'pid', "tid={$tid} {$visibleonly}", $options);
|
$pid = $db->fetch_field($query, "pid"); } header("Location: ".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");
| $pid = $db->fetch_field($query, "pid"); } header("Location: ".htmlspecialchars_decode(get_post_link($pid, $tid))."#pid{$pid}");
|
Zeile 512 | Zeile 503 |
---|
else { eval("\$polloptions .= \"".$templates->get("showthread_poll_option")."\";");
|
else { eval("\$polloptions .= \"".$templates->get("showthread_poll_option")."\";");
|
} } }
| } } }
|
// If there are any votes at all, all votes together will be 100%; if there are no votes, all votes together will be 0%. if($poll['totvotes'])
| // If there are any votes at all, all votes together will be 100%; if there are no votes, all votes together will be 0%. if($poll['totvotes'])
|
Zeile 650 | Zeile 641 |
---|
// Work out the thread rating for this thread. $rating = '';
|
// Work out the thread rating for this thread. $rating = '';
|
if($forum['allowtratings'] != 0)
| if($mybb->settings['allowthreadratings'] != 0 && $forum['allowtratings'] != 0)
|
{ $rated = 0; $lang->load("ratethread");
| { $rated = 0; $lang->load("ratethread");
|
Zeile 893 | Zeile 884 |
---|
else { if($mybb->input['highlight'])
|
else { if($mybb->input['highlight'])
|
{
| {
|
if(is_array($mybb->input['highlight'])) { foreach($mybb->input['highlight'] as $highlight_word)
| if(is_array($mybb->input['highlight'])) { foreach($mybb->input['highlight'] as $highlight_word)
|
Zeile 990 | Zeile 981 |
---|
SELECT t.*, t.username AS threadusername, u.username 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
|
SELECT t.*, t.username AS threadusername, u.username 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 AND ts_rank_cd(to_tsvector('english',t.subject), query ) >= '{$mybb->settings['similarityrating']}'
| WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query
|
ORDER BY t.lastpost DESC OFFSET 0 LIMIT {$mybb->settings['similarlimit']} ");
| ORDER BY t.lastpost DESC OFFSET 0 LIMIT {$mybb->settings['similarlimit']} ");
|
Zeile 1105 | Zeile 1096 |
---|
// If the user is a moderator, show the moderation tools. if($ismod) {
|
// If the user is a moderator, show the moderation tools. if($ismod) {
|
if($forum_stats[-1]['modtools'] || $forum_stats[$forum['fid']]['modtools'])
| $customthreadtools = $customposttools = '';
if(is_moderator($forum['fid'], "canusecustomtools") && ($forum_stats[-1]['modtools'] || $forum_stats[$forum['fid']]['modtools']))
|
{
|
{
|
$customthreadtools = $customposttools = '';
| |
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 1118 | Zeile 1109 |
---|
default: $query = $db->simple_select("modtools", "tid, name, type", "CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums=''"); }
|
default: $query = $db->simple_select("modtools", "tid, name, type", "CONCAT(',',forums,',') LIKE '%,$fid,%' OR CONCAT(',',forums,',') LIKE '%,-1,%' OR forums=''"); }
|
|
|
while($tool = $db->fetch_array($query)) { if($tool['type'] == 'p')
| while($tool = $db->fetch_array($query)) { if($tool['type'] == 'p')
|
Zeile 1136 | Zeile 1127 |
---|
{ eval("\$customposttools = \"".$templates->get("showthread_inlinemoderation_custom")."\";"); }
|
{ eval("\$customposttools = \"".$templates->get("showthread_inlinemoderation_custom")."\";"); }
|
}
| }
|
eval("\$inlinemod = \"".$templates->get("showthread_inlinemoderation")."\";");
| eval("\$inlinemod = \"".$templates->get("showthread_inlinemoderation")."\";");
|
Zeile 1145 | Zeile 1136 |
---|
{ eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";"); }
|
{ eval("\$customthreadtools = \"".$templates->get("showthread_moderationoptions_custom")."\";"); }
|
|
|
eval("\$moderationoptions = \"".$templates->get("showthread_moderationoptions")."\";"); }
|
eval("\$moderationoptions = \"".$templates->get("showthread_moderationoptions")."\";"); }
|
|
|
$lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']); // Subscription status
| $lang->newthread_in = $lang->sprintf($lang->newthread_in, $forum['name']); // Subscription status
|