1 (edited by STK_sedated29 2008-10-28 15:14)

Topic: Limiting Topics?

Hello....

I have a script that pulls the latest topics & displays them on the main page of my website. In my forum, I have a section for Admins & mods only. Now, my problem is when someone posts in that forum, its displayed in the "newest topics" box along with everything else. Is there a way I can have it not pull topics from the  members only forum?

Heres my script...

<?
  $MySQL['Server'] = "localhost"; 
  $MySQL['User'] = "-----";
  $MySQL['Pass'] = "--------";
  $MySQL['Database'] = "stk_forums";

  MySQL_Connect($MySQL['Server'], $MySQL['User'], $MySQL['Pass']) OR Die("Failed to establish the connection.");
  MySQL_Select_db($MySQL['Database']);
    
  $result = mysql_query("SELECT subject, last_poster, num_views, id FROM punbb_topics ORDER BY last_post DESC LIMIT 10");
  if (!$result)
  {
  $message = "Invalid query: " . mysql_error() . "\n";
  die($message);
  }
  while ($row = mysql_fetch_assoc($result))
  {
  echo '<img border="0" src="iconset/list.gif" width="12" height="10">&nbsp;&nbsp;<font face="Verdana" style="font-size: 9pt" color="white"><a style="text-decoration: none" href="/boards/viewtopic.php?id=' . $row['id'] . '">'. $row['subject'] . '</a><br>';
  }  
  mysql_free_result($result);
?>

***EDIT***
Nevermind...

Re: Limiting Topics?

STK_sedated29 wrote:

***EDIT***
Nevermind...

Solved? :-)

Could you please post your solution to be used by other users.

Carpe diem

3

Re: Limiting Topics?

Anatoly wrote:

Could you please post your solution to be used by other users.

A join in the query to check the forum_perms table.