Welcome, Guest. Please Login or Register.
May 04, 2025, 12:53:46 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Recent topics « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Recent topics  (Read 406 times)
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Recent topics
« on: May 27, 2002, 06:30:04 PM »
Reply with quote

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?
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Recent topics « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.113 seconds with 20 queries.