MyBB Community Forums

Full Version: [F] Find user posts - not displaying new posts (when hitting limit) [R]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Official fix. Open search.php and find:

$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.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group
Pages: 1 2