View Single Post
  #2  
Old 17th Dec 03, 09:24 AM
robinwilson16 robinwilson16 is offline
Administrator
 
Join Date: Jul 2001
Location: UK
Posts: 903
robinwilson16 will become famous soon enoughrobinwilson16 will become famous soon enough
Think I've found it:

Code:
mysql_query("SELECT `id`, `read_perms` FROM {$ipb_table_prefix}forums"); while($r = mysql_fetch_row()) { $perms = explode(",", $r['read_perms']); if(in_array($member['group_id'], $perms) { $forums[$r['id']] = "t.forum_id = {$r['id']}"; } } $forum_string = implode(" OR ", $forums); mysql_query("SELECT DISTINCT t.tid, t.title, t.last_poster_name, t.last_poster_id, t.starter_id, t.starter_name, t.forum_id, f.read_perms FROM ".$ipb_table_prefix."topics t INNER JOIN ".$ipb_table_prefix."forums f ON t.forum_id = f.id where {$forum_string} ORDER BY t.last_post DESC LIMIT ".$ipb_limit, $ipb_db_connection);
Reply With Quote