Zeile 44 | Zeile 44 |
---|
); $query = $db->simple_select("posts", "tid", "pid=".$mybb->input['pid'], $options); $post = $db->fetch_array($query);
|
); $query = $db->simple_select("posts", "tid", "pid=".$mybb->input['pid'], $options); $post = $db->fetch_array($query);
|
| if(empty($post)) { // post does not exist --> show error message error($lang->error_invalidpost); }
|
$mybb->input['tid'] = $post['tid']; } }
| $mybb->input['tid'] = $post['tid']; } }
|
Zeile 276 | Zeile 283 |
---|
if(!$nextthread['tid']) { error($lang->error_nonextnewest);
|
if(!$nextthread['tid']) { error($lang->error_nonextnewest);
|
} $options = array( "limit_start" => 0, "limit" => 1, "order_by" => "dateline", "order_dir" => "desc" );
| } $options = array( "limit_start" => 0, "limit" => 1, "order_by" => "dateline", "order_dir" => "desc" );
|
$query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);
// Redirect to the proper page.
| $query = $db->simple_select('posts', 'pid', "tid='{$nextthread['tid']}'", $options);
// Redirect to the proper page.
|
Zeile 334 | Zeile 341 |
---|
if($mybb->settings['showforumpagesbreadcrumb']) { // How many pages are there?
|
if($mybb->settings['showforumpagesbreadcrumb']) { // How many pages are there?
|
if(!$mybb->settings['threadsperpage'])
| if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
|
{ $mybb->settings['threadsperpage'] = 20; }
| { $mybb->settings['threadsperpage'] = 20; }
|
Zeile 641 | Zeile 648 |
---|
if($mybb->settings['delayedthreadviews'] == 1) { $db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
|
if($mybb->settings['delayedthreadviews'] == 1) { $db->shutdown_query("INSERT INTO ".TABLE_PREFIX."threadviews (tid) VALUES('{$tid}')");
|
}
| }
|
else
|
else
|
{
| {
|
$db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'"); } ++$thread['views'];
| $db->shutdown_query("UPDATE ".TABLE_PREFIX."threads SET views=views+1 WHERE tid='{$tid}'"); } ++$thread['views'];
|
Zeile 655 | Zeile 662 |
---|
$rated = 0; $lang->load("ratethread"); if($thread['numratings'] <= 0)
|
$rated = 0; $lang->load("ratethread"); if($thread['numratings'] <= 0)
|
{
| {
|
$thread['width'] = 0; $thread['averagerating'] = 0; $thread['numratings'] = 0;
| $thread['width'] = 0; $thread['averagerating'] = 0; $thread['numratings'] = 0;
|
Zeile 698 | Zeile 705 |
---|
if($forumpermissions['cansearch'] != 0) { eval("\$search_thread = \"".$templates->get("showthread_search")."\";");
|
if($forumpermissions['cansearch'] != 0) { eval("\$search_thread = \"".$templates->get("showthread_search")."\";");
|
}
| }
|
// 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'] != "")
|
Zeile 744 | Zeile 751 |
---|
else { $where = " ORDER BY dateline LIMIT 0, 1";
|
else { $where = " ORDER BY dateline LIMIT 0, 1";
|
}
| }
|
$query = $db->query(" SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM ".TABLE_PREFIX."posts p
| $query = $db->query(" SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM ".TABLE_PREFIX."posts p
|
Zeile 759 | Zeile 766 |
---|
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 808 | Zeile 815 |
---|
else // Linear display { $threadexbox = '';
|
else // Linear display { $threadexbox = '';
|
if(!$mybb->settings['postsperpage'])
| if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
|
{
|
{
|
$mybb->settings['postperpage'] = 20;
| $mybb->settings['postsperpage'] = 20;
|
} // Figure out if we need to display multiple pages.
| } // Figure out if we need to display multiple pages.
|
Zeile 1001 | Zeile 1008 |
---|
$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 1021 |
---|
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 1031 |
---|
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']} ");
|
Zeile 1034 | Zeile 1047 |
---|
if($similar_thread['icon'] > 0 && $icon_cache[$similar_thread['icon']]) { $icon = $icon_cache[$similar_thread['icon']];
|
if($similar_thread['icon'] > 0 && $icon_cache[$similar_thread['icon']]) { $icon = $icon_cache[$similar_thread['icon']];
|
| $icon['path'] = htmlspecialchars_uni($icon['path']); $icon['name'] = htmlspecialchars_uni($icon['name']);
|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else
| $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else
|