Zeile 50 | Zeile 50 |
---|
// Get the thread details from the database. $thread = get_thread($mybb->input['tid']);
|
// Get the thread details from the database. $thread = get_thread($mybb->input['tid']);
|
| if(!$thread || substr($thread['closed'], 0, 6) == "moved|") { error($lang->error_invalidthread); }
|
// Get thread prefix if there is one. $thread['threadprefix'] = '';
| // Get thread prefix if there is one. $thread['threadprefix'] = '';
|
Zeile 63 | Zeile 68 |
---|
$thread['threadprefix'] = $threadprefix['prefix'].' '; $thread['displayprefix'] = $threadprefix['displaystyle'].' '; }
|
$thread['threadprefix'] = $threadprefix['prefix'].' '; $thread['displayprefix'] = $threadprefix['displaystyle'].' '; }
|
}
if(substr($thread['closed'], 0, 6) == "moved|") { $thread['tid'] = 0;
| |
}
$reply_subject = $parser->parse_badwords($thread['subject']);
| }
$reply_subject = $parser->parse_badwords($thread['subject']);
|
Zeile 102 | Zeile 102 |
---|
}
// Make sure we are looking at a real thread here.
|
}
// Make sure we are looking at a real thread here.
|
if(!$thread || ($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
| if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
|
{ error($lang->error_invalidthread); }
| { error($lang->error_invalidthread); }
|
Zeile 284 | Zeile 284 |
---|
"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. $pid = $db->fetch_field($query, "pid"); header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}"); exit; }
| // Redirect to the proper page. $pid = $db->fetch_field($query, "pid"); header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}"); exit; }
|
// Jump to the next oldest posts. if($mybb->input['action'] == "nextoldest") {
| // Jump to the next oldest posts. if($mybb->input['action'] == "nextoldest") {
|
Zeile 305 | Zeile 305 |
---|
// 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 320 | Zeile 320 |
---|
$pid = $db->fetch_field($query, "pid"); header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}"); exit;
|
$pid = $db->fetch_field($query, "pid"); header("Location: ".htmlspecialchars_decode(get_post_link($pid, $nextthread['tid']))."#pid{$pid}"); exit;
|
}
| }
|
if(!empty($mybb->input['pid'])) { $pid = $mybb->input['pid']; }
|
if(!empty($mybb->input['pid'])) { $pid = $mybb->input['pid']; }
|
|
|
// Forumdisplay cache $forum_stats = $cache->read("forumsdisplay");
| // Forumdisplay cache $forum_stats = $cache->read("forumsdisplay");
|
Zeile 335 | Zeile 335 |
---|
{ // How many pages are there? if(!$mybb->settings['threadsperpage'])
|
{ // How many pages are there? if(!$mybb->settings['threadsperpage'])
|
{
| {
|
$mybb->settings['threadsperpage'] = 20; }
| $mybb->settings['threadsperpage'] = 20; }
|
Zeile 395 | Zeile 395 |
---|
"current_page" => $thread_page ); }
|
"current_page" => $thread_page ); }
|
|
|
// Build the navigation. build_forum_breadcrumb($fid, $breadcrumb_multipage); add_breadcrumb($thread['displayprefix'].$thread['subject'], get_thread_link($thread['tid']));
|
// Build the navigation. build_forum_breadcrumb($fid, $breadcrumb_multipage); add_breadcrumb($thread['displayprefix'].$thread['subject'], get_thread_link($thread['tid']));
|
|
|
$plugins->run_hooks("showthread_start");
// Show the entire thread (taking into account pagination).
| $plugins->run_hooks("showthread_start");
// Show the entire thread (taking into account pagination).
|
Zeile 408 | Zeile 408 |
---|
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 645 | Zeile 645 |
---|
else { $db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
|
else { $db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'");
|
}
| }
|
++$thread['views'];
// Work out the thread rating for this thread.
| ++$thread['views'];
// Work out the thread rating for this thread.
|
Zeile 659 | Zeile 659 |
---|
$thread['width'] = 0; $thread['averagerating'] = 0; $thread['numratings'] = 0;
|
$thread['width'] = 0; $thread['averagerating'] = 0; $thread['numratings'] = 0;
|
}
| }
|
else { $thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2)); $thread['width'] = intval(round($thread['averagerating']))*20; $thread['numratings'] = intval($thread['numratings']);
|
else { $thread['averagerating'] = floatval(round($thread['totalratings']/$thread['numratings'], 2)); $thread['width'] = intval(round($thread['averagerating']))*20; $thread['numratings'] = intval($thread['numratings']);
|
}
| }
|
if($thread['numratings']) {
| if($thread['numratings']) {
|
Zeile 673 | Zeile 673 |
---|
// Check if we have already voted on this thread - it won't show hover effect then. $query = $db->simple_select("threadratings", "uid", "tid='{$tid}' AND uid='{$mybb->user['uid']}'"); $rated = $db->fetch_field($query, 'uid');
|
// Check if we have already voted on this thread - it won't show hover effect then. $query = $db->simple_select("threadratings", "uid", "tid='{$tid}' AND uid='{$mybb->user['uid']}'"); $rated = $db->fetch_field($query, 'uid');
|
}
| }
|
$not_rated = ''; if(!$rated) {
| $not_rated = ''; if(!$rated) {
|
Zeile 688 | Zeile 688 |
---|
if($ismod) { $visible = "AND (p.visible='0' OR p.visible='1')";
|
if($ismod) { $visible = "AND (p.visible='0' OR p.visible='1')";
|
}
| }
|
else { $visible = "AND p.visible='1'";
| else { $visible = "AND p.visible='1'";
|
Zeile 703 | Zeile 703 |
---|
// 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) {
| $ignore_list = explode(',', $mybb->user['ignorelist']); foreach($ignore_list as $uid) {
|
Zeile 762 | Zeile 762 |
---|
}
// Is there actually a pid to display?
|
}
// Is there actually a pid to display?
|
if(!$showpost['pid']) { error($lang->error_invalidpost);
| if(!$showpost['pid']) { error($lang->error_invalidpost);
|
} $attachcache = array();
| } $attachcache = array();
|
Zeile 809 | Zeile 809 |
---|
{ $threadexbox = ''; if(!$mybb->settings['postsperpage'])
|
{ $threadexbox = ''; if(!$mybb->settings['postsperpage'])
|
{
| {
|
$mybb->settings['postperpage'] = 20; }
| $mybb->settings['postperpage'] = 20; }
|
Zeile 867 | Zeile 867 |
---|
if(isset($mybb->input['page']) && $mybb->input['page'] == "last") { $page = $pages;
|
if(isset($mybb->input['page']) && $mybb->input['page'] == "last") { $page = $pages;
|
}
| }
|
if($page > $pages || $page <= 0)
|
if($page > $pages || $page <= 0)
|
{ $page = 1; }
| { $page = 1; }
|
if($page)
|
if($page)
|
{
| {
|
$start = ($page-1) * $perpage; } else { $start = 0; $page = 1;
|
$start = ($page-1) * $perpage; } else { $start = 0; $page = 1;
|
}
| }
|
$upper = $start+$perpage; // Work out if we have terms to highlight
| $upper = $start+$perpage; // Work out if we have terms to highlight
|
Zeile 912 | Zeile 912 |
---|
if(!empty($mybb->input['highlight'])) { if(is_array($mybb->input['highlight']))
|
if(!empty($mybb->input['highlight'])) { if(is_array($mybb->input['highlight']))
|
{
| {
|
foreach($mybb->input['highlight'] as $highlight_word) { $highlight .= "&highlight[]=".urlencode($highlight_word);
| foreach($mybb->input['highlight'] as $highlight_word) { $highlight .= "&highlight[]=".urlencode($highlight_word);
|
Zeile 941 | Zeile 941 |
---|
$comma = ''; $query = $db->simple_select("posts p", "p.pid", "p.tid='$tid' $visible", array('order_by' => 'p.dateline', 'limit_start' => $start, 'limit' => $perpage)); while($getid = $db->fetch_array($query))
|
$comma = ''; $query = $db->simple_select("posts p", "p.pid", "p.tid='$tid' $visible", array('order_by' => 'p.dateline', 'limit_start' => $start, 'limit' => $perpage)); while($getid = $db->fetch_array($query))
|
{
| {
|
// Set the ID of the first post on page to $pid if it doesn't hold any value // to allow this value to be used for Thread Mode/Linear Mode links // and ensure the user lands on the correct page after changing view mode
| // Set the ID of the first post on page to $pid if it doesn't hold any value // to allow this value to be used for Thread Mode/Linear Mode links // and ensure the user lands on the correct page after changing view mode
|
Zeile 986 | Zeile 986 |
---|
ORDER BY p.dateline "); while($post = $db->fetch_array($query))
|
ORDER BY p.dateline "); while($post = $db->fetch_array($query))
|
{
| {
|
if($thread['firstpost'] == $post['pid'] && $thread['visible'] == 0) { $post['visible'] = 0; } $posts .= build_postbit($post); $post = '';
|
if($thread['firstpost'] == $post['pid'] && $thread['visible'] == 0) { $post['visible'] = 0; } $posts .= build_postbit($post); $post = '';
|
}
| }
|
$plugins->run_hooks("showthread_linear"); }
| $plugins->run_hooks("showthread_linear"); }
|
Zeile 1001 | Zeile 1001 |
---|
$similarthreads = ''; if($mybb->settings['showsimilarthreads'] != 0) {
|
$similarthreads = ''; if($mybb->settings['showsimilarthreads'] != 0) {
|
| $own_perm = ''; if($forumpermissions['canonlyviewownthreads'] == 1) { $own_perm = " AND t.uid={$mybb->user['uid']}"; }
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 1008 | Zeile 1014 |
---|
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
| 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 OFFSET 0 LIMIT {$mybb->settings['similarlimit']} ");
| ORDER BY t.lastpost DESC OFFSET 0 LIMIT {$mybb->settings['similarlimit']} ");
|
Zeile 1018 | Zeile 1024 |
---|
SELECT t.*, t.username AS threadusername, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
SELECT t.*, t.username AS threadusername, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') >= '{$mybb->settings['similarityrating']}'
| WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%'{$own_perm} AND MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') >= '{$mybb->settings['similarityrating']}'
|
ORDER BY t.lastpost DESC LIMIT 0, {$mybb->settings['similarlimit']} ");
| ORDER BY t.lastpost DESC LIMIT 0, {$mybb->settings['similarlimit']} ");
|