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 5473 2011-06-23 11:12:10Z Tomm $
| * $Id$
|
*/
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 269 | 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 304 | 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 318 | 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 333 | Zeile 335 |
---|
"limit" => 1, "order_by" => "lastpost" );
|
"limit" => 1, "order_by" => "lastpost" );
|
$query = $db->simple_select('threads', '*', "fid={$thread['fid']} AND lastpost > {$thread['lastpost']} AND visible=1 AND closed NOT LIKE 'moved|%'", $options);
| $query = $db->simple_select('threads', '*', "fid={$thread['fid']} AND lastpost > {$thread['lastpost']} {$visibleonly} AND closed NOT LIKE 'moved|%'", $options);
|
$nextthread = $db->fetch_array($query);
// Are there actually next newest posts?
| $nextthread = $db->fetch_array($query);
// Are there actually next newest posts?
|
Zeile 364 | Zeile 366 |
---|
"order_by" => "lastpost", "order_dir" => "desc" );
|
"order_by" => "lastpost", "order_dir" => "desc" );
|
$query = $db->simple_select("threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." AND visible=1 AND closed NOT LIKE 'moved|%'", $options);
| $query = $db->simple_select("threads", "*", "fid=".$thread['fid']." AND lastpost < ".$thread['lastpost']." {$visibleonly} AND closed NOT LIKE 'moved|%'", $options);
|
$nextthread = $db->fetch_array($query);
// Are there actually next oldest posts?
| $nextthread = $db->fetch_array($query);
// Are there actually next oldest posts?
|
Zeile 639 | 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 656 | Zeile 658 |
---|
$thread['numratings'] = intval($thread['numratings']); }
|
$thread['numratings'] = intval($thread['numratings']); }
|
if($thread['num_ratings'])
| if($thread['numratings'])
|
{ // At least >someone< has rated this thread, was it me? // Check if we have already voted on this thread - it won't show hover effect then.
| { // At least >someone< has rated this thread, was it me? // Check if we have already voted on this thread - it won't show hover effect then.
|
Zeile 698 | Zeile 700 |
---|
{ $ignored_users[$uid] = 1; }
|
{ $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'];
|
} // 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 if($mybb->settings['threadusenetstyle'] == 1) { $defaultmode = 'threaded';
|
Zeile 742 | Zeile 726 |
---|
if($mybb->input['mode'] == 'threaded') { $isfirst = 1;
|
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'])
|
{
| {
|
$where = "AND p.pid='".$mybb->input['pid']."'"; } else
|
$where = "AND p.pid='".$mybb->input['pid']."'"; } else
|
{
| {
|
$where = " ORDER BY dateline LIMIT 0, 1"; } $query = $db->query("
| $where = " ORDER BY dateline LIMIT 0, 1"; } $query = $db->query("
|
Zeile 769 | Zeile 753 |
---|
}
// Is there actually a pid to display?
|
}
// Is there actually a pid to display?
|
if(!$showpost['pid'])
| if(!$showpost['pid'])
|
{ error($lang->error_invalidpost); }
| { error($lang->error_invalidpost); }
|
Zeile 815 | Zeile 799 |
---|
else // Linear display { if(!$mybb->settings['postsperpage'])
|
else // Linear display { 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")
|
$mybb->settings['postperpage'] = 20; } // Figure out if we need to display multiple pages. $perpage = $mybb->settings['postsperpage']; if($mybb->input['page'] != "last")
|
{
| {
|
$page = intval($mybb->input['page']); } if($mybb->input['pid'])
| $page = intval($mybb->input['page']); } if($mybb->input['pid'])
|
Zeile 899 | Zeile 883 |
---|
} else {
|
} else {
|
if($mybb->input['highlight']) { $highlight = "&highlight=".urlencode($mybb->input['highlight']); }
| if($mybb->input['highlight']) { if(is_array($mybb->input['highlight'])) { foreach($mybb->input['highlight'] as $highlight_word) { $highlight .= "&highlight[]=".urlencode($highlight_word); } } else { $highlight = "&highlight=".urlencode($mybb->input['highlight']); } }
|
if($defaultmode != "linear") {
| if($defaultmode != "linear") {
|
Zeile 987 | 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 1072 | Zeile 1066 |
---|
$last_pid = $db->fetch_field($query, "pid"); // Show captcha image for guests if enabled
|
$last_pid = $db->fetch_field($query, "pid"); // Show captcha image for guests if enabled
|
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && !$mybb->user['uid'])
| if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
{
|
{
|
$randomstr = random_str(5); $imagehash = md5(random_str(12)); $imagearray = array( "imagehash" => $imagehash, "imagestring" => $randomstr, "dateline" => TIME_NOW ); $db->insert_query("captcha", $imagearray); eval("\$captcha = \"".$templates->get("post_captcha")."\";");
| require_once MYBB_ROOT.'inc/class_captcha.php'; $post_captcha = new captcha(true, "post_captcha");
if($post_captcha->html) { $captcha = $post_captcha->html; }
|
} if($mybb->user['signature']) {
| } if($mybb->user['signature']) {
|
Zeile 1104 | 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 1117 | 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 1135 | 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 1144 | 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
|