-
SQL question (PHPNuke block)
Hello - PHP-type newbie here: I have a question regarding an SQL statement in PHP (PostNuke forums module)
This function basically prints the titles of the most recent forum posts in a little block on the homepage.
Is there a way I can get the SQL to filter out certain forums from having thier headlines posted in this block? I was thinking this might work below - (my changes are adding the "AND NOT forum_id='8'") Does anyone know if this is the correct syntax?
It does not seem to work....
================================================== =============
$sql = "SELECT forum_id, topic_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_time DESC LIMIT 10";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$forum_id = $row[forum_id];
$topic_id = $row[topic_id];
$topic_title = $row[topic_title];
$sql2 = "SELECT auth_view, auth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'AND NOT forum_id='8'
$result2 = $db->sql_query($sql2);
$row2 = $db->sql_fetchrow($result);
$auth_view = $row2[auth_view];
$auth_read = $row2[auth_read];
if (($auth_view != 2) OR ($auth_read != 2)) {
$content .= "<img src=\"images/arrow.gif\" border=\"0\" alt=\"\" title=\"\" width=\"9\" height=\"9\">&<a href=\"modules.php?name=Forums&file=viewtopic&t=$t opic_id\">$topic_title</a><br>";
}
}
================================================== =============
See the output at www.oldwarriors.org (right side, look for "Forums Ramblings"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|