Jedi~
Eric
Beta Tester
YaBB God
    
Posts: 1284

|
 |
Recent topics
« on: May 27, 2002, 06:30:04 PM » |
|
So I tried to make my own version of a recent topics (not posts mind you), since the query from SSI.php gave all kinds of errors, this is what I came up with:
function recentt() { global $db_prefix, $scripturl, $block, $settings;
$display = 10; $request = mysql_query("SELECT m.smiliesEnabled,m.posterTime,m.ID_MEMBER,m.ID_MSG,m.subject,m.body,m.ID_TOPIC,t.ID_BOARD,b.name as bname,c.name as cname,m.posterName,t.numReplies FROM {$db_prefix}messages as m,{$db_prefix}topics as t,{$db_prefix}boards as b,{$db_prefix}categories as c WHERE (m.ID_TOPIC = t.ID_TOPIC AND t.ID_BOARD = b.ID_BOARD AND b.ID_CAT=c.ID_CAT AND (FIND_IN_SET('$settings[7]',c.memberGroups)!=0 OR c.memberGroups='' OR '$settings[7]'='Administrator' OR '$settings[7]'='Global Moderator')) ORDER BY m.posterTime DESC");
$display = ($display - 1); $ids = array(); while ($curr_thread = mysql_fetch_array($request)) { if (!in_array($curr_thread[ID_TOPIC], $ids)) { if (!array_key_exists($display, $ids)) { $block[contents] = $block[contents]."<a href=\"$scripturl?board=$curr_thread[ID_BOARD];action=display;threadid=$curr_thread[ID_TOPIC]\">$curr_thread[subject]</a><BR>"; $ids[] = $curr_thread[ID_TOPIC];
} } } } Problem is that it apparently doesn't check for the value in the array, I tried printing out the values of the array and it's in there, but it's not checking to see if it's in there with my if statement, any ideas?
|