Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
utssace
Worker
Worker



Joined: Feb 18, 2006
Posts: 155
Location: Virginia

PostPosted: Sat Jul 08, 2006 6:59 pm Reply with quote

I am using the stock Forums block with PhpNuke 7.8. The script below shows all recent forum posts. I don't want to show private topic posts. How can I edit this to exclude private posts: Thanks

Code:
<?php


/************************************************************************/
/* PHP-NUKE: Web Portal System                                          */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2005 by Francisco Burzi                                */
/* http://phpnuke.org                                                   */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/

if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}

global $prefix, $db, $sitename;

$sql = "SELECT t.forum_id, topic_id, topic_title, auth_view, auth_read FROM ".$prefix."_bbtopics AS t, ".$prefix."_bbforums AS f WHERE f.forum_id=t.forum_id ORDER BY topic_time DESC LIMIT 8";
$result = $db->sql_query($sql);
$content = "<br>";
while (list($forum_id, $topic_id, $topic_title, $auth_view, $auth_read) = $db->sql_fetchrow($result)) {
    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&amp;file=viewtopic&amp;t=$topic_id\">$topic_title</a><br>";
    }
}

$content .= "<br><center><a href=\"forums.html\"><b>$sitename Forums</b></a><br><br></center>";

$db->sql_freeresult($result);

?>
 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Wed Jul 12, 2006 7:31 am Reply with quote

Well, I am confused because it looks like that block is already excluding private forums.

I guess you could try changing the "< 2" to "< 1", but what is there should work.

You could also try Raven's Collapsing Forums Block, set to view ALL forums and then put in its "exclude list" the forums that you do not want to show posts from.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©