Author |
Message |
techforce
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Feb 13, 2008
Posts: 6
|
Posted:
Wed Feb 13, 2008 4:35 pm |
|
I just installed this on Nuke 7.9 - nice !
Id like to mod it so that the private and hidden (moderator or admin) type forum posts dont get shown.
I guess a config type thing like:
$ignore_pvt = 0 // 0 to include pvt / hidden forums, 1 to ignore
Then modified code in the countdown sequence. Anyone interested to help?
I know some PHP, but am bad with the globals. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Gremmie
Former Moderator in Good Standing
![](modules/Forums/images/avatars/0cd76dcf45da5de2cf864.jpg)
Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Wed Feb 13, 2008 6:22 pm |
|
Post the block here and perhaps we can tell you how to modify the SQL. |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
techforce
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 13, 2008 9:23 pm |
|
<?php
/************************************************************************/
/* Forums Block for phpBB 2.0.0 port to PHP Nuke 5.5 */
/* ================================================= */
/* */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* Version 1, modified by Sébastien Vaast */
/* http://membres.lycos.fr/projectpluto/ */
/* */
/* */
/* Last Edited - 09 May 2002 */
/* */
/* This Block shows the last 10 topics where a message was posted, */
/* along with the username of the last poster and the day and time */
/* of the post. */
/* It will also show smileys in the topic titles thanks to the */
/* smileys.php file found in Leo Tan Block Forums version */
/* (http://www.cybercomp.d2g.com). */
/* */
/* 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. */
/************************************************************************/
/************************************************************************/
/* Modified by Gaylen Fraley http://www.ravenphpscripts.com */
/************************************************************************/
if (eregi("block-ForumsScroll.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
//include_once ('blocks/smileys.php');
global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
$count = 1;
$amount = 15;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"25\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Last $amount Forum Messages</b></center>";
$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT $amount", $dbi);
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);
$result3 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result3, $dbi);
//$topic_title = substr("$topic_title", 0,17);
//$topic_title=parseEmoticons($topic_title);
// Remove the comment below to add the counter
//$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Message: $count<br></b>";
$content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\"alt=\"\"><a href=\"forums.html?amp;file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Last post by <A HREF=\"profile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "<br><center>[ <a href=\"forums.html\"STYLE=\"text-decoration: none\">$sitename ]</center>";
//$content .= "<center><img src=\"images/banners/fatalexception-logo-88x31.gif\" border=\"0\"></center>";
$content .= "</a>";
?> |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Gremmie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 13, 2008 10:27 pm |
|
Warning, not tested, but try changing this line:
Code:
$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT $amount", $dbi);
|
to this:
Code:
$result1 = sql_query("SELECT b.topic_id, b.topic_last_post_id, b.topic_title FROM {$prefix}_bbtopics as b, {$prefix}_bbforums as f, {$prefix}_bbtopics as t WHERE b.topic_id = t.topic_id AND t.forum_id = f.forum_id AND f.auth_view = 0 ORDER BY b.topic_last_post_id DESC LIMIT $amount", $dbi);
|
If that doesn't work, try another block. There are many out there that exclude private forums. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
techforce
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Feb 13, 2008 10:49 pm |
|
Ok, thanks, not bad. Its no longer posting the private etc posts. It is however avoiding a forum which is in a group of other forums that are private, and is in fact public. Id also like it to post announcements as well as stickys, if they are as recent. I will play around with some others as you have sugguested. This will work for me for now though, thanks again
UPDATE - EDIT: Scratch that comment about it avoiding the forum - that forum is indeed hidden, so the script really works perfectly. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|