Skip to content

Commit

Permalink
Fixing a bug in searching for a users posts when using PgSQL, reporte…
Browse files Browse the repository at this point in the history
…d by delroth. #95
  • Loading branch information
reines committed Aug 9, 2010
1 parent fee7f0e commit a4fc0d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion search.php
Expand Up @@ -311,7 +311,7 @@
// If it's a search for posts by a specific user ID
else if ($action == 'show_user')
{
$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id='.$user_id.' GROUP BY t.id ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$result = $db->query('SELECT t.id FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=t.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.poster_id='.$user_id.' GROUP BY t.id'.($db_type == 'pgsql' ? ', t.last_post' : '').' ORDER BY t.last_post DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$num_hits = $db->num_rows($result);

if (!$num_hits)
Expand Down

0 comments on commit a4fc0d5

Please sign in to comment.