Martz
09-23-2001, 08:54 PM
The following code is from a hack which lists the last 5 threads which have been posted too. However I have provate forums, and they show up in this list as well. How can I modify this:
// Top 5 Thread Replys
$pop = $DB_site->query('SELECT title,threadid,lastpost,lastposter,views FROM thread ORDER BY lastpost DESC LIMIT 5');
while ($poptop = mysql_fetch_array($pop)):
++$poptopnbsp;
$popthread .= "<a href=showthread.php?s=$session[sessionhash]&threadid=$poptop[threadid]>$poptop[title]</a><br>";
$poplastposter .= "$poptop[lastposter]<br>";
$popviews .= "$poptop[views]<br>";
So that it only shows threads from forums the user can actually see?
Could I use something like:
$perms=getpermissions();
if (!$perms[ismoderator]....
but using ($perms[canviewforum]) or something similar?
:confused: sorry im a newbie, but I'm willing to give any advice a shot.
// Top 5 Thread Replys
$pop = $DB_site->query('SELECT title,threadid,lastpost,lastposter,views FROM thread ORDER BY lastpost DESC LIMIT 5');
while ($poptop = mysql_fetch_array($pop)):
++$poptopnbsp;
$popthread .= "<a href=showthread.php?s=$session[sessionhash]&threadid=$poptop[threadid]>$poptop[title]</a><br>";
$poplastposter .= "$poptop[lastposter]<br>";
$popviews .= "$poptop[views]<br>";
So that it only shows threads from forums the user can actually see?
Could I use something like:
$perms=getpermissions();
if (!$perms[ismoderator]....
but using ($perms[canviewforum]) or something similar?
:confused: sorry im a newbie, but I'm willing to give any advice a shot.