2009-05-25, 07:31 PM
(This post was last modified: 2009-05-25, 07:42 PM by Ryan Gordon.)
Official fix. Open search.php and find:
replace with
Also find both instances of:
replace with
A developer may commit this fix at their convenience.
$tids = array();
$pids = array();
// Make sure the posts we're viewing we have permission to view.
$query = $db->simple_select("posts", "pid, tid", "pid IN(".$db->escape_string($search['posts']).") AND {$p_unapproved_where} {$limitsql}");
replace with
$post_cache_options = array('limit' => intval($mybb->settings['searchhardlimit']));
if(strpos($sortfield, 'p.') !== false)
{
$post_cache_options['order_by'] = str_replace('p.', '', $sortfield);
$post_cache_options['order_dir'] = $order;
}
$tids = array();
$pids = array();
// Make sure the posts we're viewing we have permission to view.
$query = $db->simple_select("posts", "pid, tid", "pid IN(".$db->escape_string($search['posts']).") AND {$p_unapproved_where}", $post_cache_options);
Also find both instances of:
$pids = '';
$comma = '';
$query = $db->simple_select("posts", "pid", "{$where_sql} {$limitsql}");
replace with
$options = array(
'limit' => intval($mybb->settings['searchhardlimit']),
'order_by' => 'dateline',
'order_dir' => 'desc',
);
$pids = '';
$comma = '';
$query = $db->simple_select("posts", "pid", "{$where_sql}", $options);
A developer may commit this fix at their convenience.