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 65 | Zeile 72 |
---|
if($threadprefix['prefix']) {
|
if($threadprefix['prefix']) {
|
$thread['threadprefix'] = $threadprefix['prefix'].' ';
| $thread['threadprefix'] = htmlspecialchars_uni($threadprefix['prefix']).' ';
|
$thread['displayprefix'] = $threadprefix['displaystyle'].' '; } }
| $thread['displayprefix'] = $threadprefix['displaystyle'].' '; } }
|
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 522 | Zeile 529 |
---|
else { $totpercent = "0%";
|
else { $totpercent = "0%";
|
}
| }
|
// Check if user is allowed to edit posts; if so, show "edit poll" link. if(!is_moderator($fid, 'caneditposts'))
| // Check if user is allowed to edit posts; if so, show "edit poll" link. if(!is_moderator($fid, 'caneditposts'))
|
Zeile 563 | Zeile 570 |
---|
} eval("\$pollbox = \"".$templates->get("showthread_poll")."\";"); $plugins->run_hooks("showthread_poll");
|
} eval("\$pollbox = \"".$templates->get("showthread_poll")."\";"); $plugins->run_hooks("showthread_poll");
|
}
} else {
| }
} else {
|
$pollbox = ""; }
| $pollbox = ""; }
|
Zeile 597 | Zeile 604 |
---|
else { eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");
|
else { eval("\$newreply = \"".$templates->get("showthread_newreply")."\";");
|
}
| }
|
}
|
}
|
|
|
// Create the admin tools dropdown box. if($ismod == true) {
| // Create the admin tools dropdown box. if($ismod == true) {
|
Zeile 612 | Zeile 619 |
---|
if($thread['visible'] != 1) { $approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>";
|
if($thread['visible'] != 1) { $approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>";
|
}
| }
|
else { $approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>";
| else { $approveunapprovethread = "<option value=\"unapprovethread\">".$lang->unapprove_thread."</option>";
|
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
|