Author |
Message |
Dvalin444
Client

Joined: Feb 19, 2005
Posts: 34
|
Posted:
Sun Apr 10, 2005 10:54 am |
|
Hello,
I have a scrolling forum posts block, but I dont want it to show posts made in the hidden admin and moderator forums. Is there any way that I could keep those posts from showing up? Thanks for you help! |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun Apr 10, 2005 3:58 pm |
|
Download my Collapsing Forum block to see how I do that and just use the code (or the methodology) in yours. |
Last edited by Raven on Sat May 21, 2005 10:13 pm; edited 1 time in total |
|
|
 |
Dvalin444

|
Posted:
Sun Apr 10, 2005 4:07 pm |
|
I'm sorry, but I still cant figure out which line I'm supposed to use to make it not appear.  |
|
|
|
 |
Dvalin444

|
Posted:
Sun Apr 10, 2005 4:25 pm |
|
Here is the code that I'm using now, how should I edit it?
Code:<?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://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=\"modules.php?name=Forums&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=\"forum-userprofile-.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>";
?>
|
|
|
|
|
 |
Dvalin444

|
Posted:
Tue Apr 12, 2005 5:16 pm |
|
Can anyone help?  |
|
|
|
 |
ring_c
Involved


Joined: Dec 28, 2003
Posts: 276
Location: Israel
|
Posted:
Tue Apr 19, 2005 8:21 am |
|
I have the same question. Am trying to hide a specific forum (not one that is read only), either in your Raven's block-ForumsScroll.php or in Maty Scripts's block-phpBB_Forums.php, with no go (I'm not a programer).
Would appreciate any help. |
|
|
|
 |
TeKKiE
Hangin' Around

Joined: May 11, 2005
Posts: 48
|
Posted:
Sat May 14, 2005 11:07 am |
|
I believe it's $hidereadonly=1 or something of this nature. I'll look at mine and update this post in a bit. |
|
|
|
 |
TeKKiE

|
Posted:
Sat May 14, 2005 11:30 am |
|
Here is my block. It doesn't display hidden forums.
Code:<?php
/************************************************************************/
/* Forums Block for phpBB 2.0.0 port to PHP Nuke 6.5b6+ */
/* ==================================================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* Version 1, modified by Sébastien Vaast */
/* http://membres.lycos.fr/projectpluto/ */
/* */
/* Updated by Tom Nitzschner 22/06/2002 to add the scrolling text */
/* */
/* Updated by Paul Laudanski 14 Jan 2003 */
/* NukeCops.com | ComputerCops.biz */
/* */
/* Last Edited - 14 Jan 2003 */
/* */
/* 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. */
/************************************************************************/
// Hacks for newer PHP-Nuke versions by mmv3.com
// 09/02/05 - the UK way
if (eregi("block-Forums.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
require_once("mainfile.php");
$HideViewReadOnly = 1;
function parseEmoticons ($text) {
$emoticons = array();
$emoticons[] = array(":)", "<img src='modules/Forums/images/smiles/icon_smile.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":D", "<img src='modules/Forums/images/smiles/icon_biggrin.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":(", "<img src='modules/Forums/images/smiles/icon_sad.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(" ", "<img src='modules/Forums/images/smiles/icon_eek.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":?", "<img src='modules/Forums/images/smiles/icon_confused.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array("8)", "<img src='modules/Forums/images/smiles/icon_cool.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":lol:", "<img src='modules/Forums/images/smiles/icon_lol.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":x", "<img src='modules/Forums/images/smiles/icon_mad.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":P", "<img src='modules/Forums/images/smiles/icon_razz.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":oops:", "<img src='modules/Forums/images/smiles/icon_redface.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":cry:", "<img src='modules/Forums/images/smiles/icon_cry.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":evil:", "<img src='modules/Forums/images/smiles/icon_evil.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":twisted:", "<img src='modules/Forums/images/smiles/icon_twisted.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":roll:", "<img src='modules/Forums/images/smiles/icon_twisted.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":wink:", "<img src='modules/Forums/images/smiles/icon_wink.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":!", "<img src='modules/Forums/images/smiles/icon_exclaim.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":?", "<img src='modules/Forums/images/smiles/icon_question.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":idea:", "<img src='modules/Forums/images/smiles/icon_idea.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":arrow:", "<img src='modules/Forums/images/smiles/icon_arrow.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":o", "<img src='modules/Forums/images/smiles/icon_surprised.gif' alt='' align='absmiddle' BORDER=0>");
foreach ($emoticons as $emoticon) {
$text = str_replace($emoticon[0],$emoticon[1],$text);
}
return $text;
}
global $prefix, $db, $sitename, $user, $cookie, $group_id, $user_prefix;
$count = 1;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"20\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Last 20 Forum Messages</b></center>";
$result1 = $db->sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 20");
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id) = $db->sql_fetchrow($result1)) {
$result2 = $db->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'");
list($topic_id, $poster_id, $post_time)=$db->sql_fetchrow($result2);
$result3 = $db->sql_query("SELECT username, user_id FROM ".$user_prefix."_users where user_id='$poster_id'");
$row8 = $db->sql_fetchrow($result3);
$username = $row8['username'];
$user_id = $row8['user_id'];
$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=\"forums.html?file=profile&mode=viewprofile&u=$user_id\"STYLE=\"text-decoration: none\"> $username </a> in <a href=\"forums.html?amp;file=viewforum&f=$forum_id\">$forum_name</a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "<br><center>[ <a href=\"forums.html\"STYLE=\"text-decoration: none\">$sitename ]</center>";
?>
|
Please note this line in particular to hide the hidden forums posts from world...
Code:$HideViewReadOnly = 1;
|
Hope it works for you. |
|
|
|
 |
Dvalin444

|
Posted:
Sat May 14, 2005 3:43 pm |
|
THANK YOU SO MUCH! This is perfect! I cant thank you enough.  |
|
|
|
 |
ring_c

|
Posted:
Sat May 14, 2005 3:58 pm |
|
I actually need a way to hide a non r/o forum.
Is that optional anywhere? |
|
|
|
 |
Raven

|
Posted:
Sat May 14, 2005 4:44 pm |
|
You should have a line like this in your blockCode:$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);
|
Modify it to exclude the forum ID's that you want to hideCode:$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_bbtopics where forum_id NOT IN(5,26,27) ORDER BY topic_last_post_id DESC LIMIT $amount", $dbi);
|
|
|
|
|
 |
TeKKiE

|
Posted:
Sun May 15, 2005 5:32 pm |
|
Glad a newb like me could help  |
|
|
|
 |
suzy
New Member


Joined: Apr 10, 2005
Posts: 16
|
Posted:
Sat May 21, 2005 10:06 pm |
|
|
|
 |
scott11
New Member


Joined: Jun 03, 2005
Posts: 23
|
Posted:
Fri Jun 10, 2005 4:25 pm |
|
this block OK for 7.5...tried to center the text in the block but to no avail, any suggestions please |
|
|
|
 |
Steptoe
Involved


Joined: Oct 09, 2004
Posts: 293
|
Posted:
Sat Jun 11, 2005 4:29 pm |
|
My scrolling forum block came with not showing hidden sections of the forums. PhP nuke 7.5
Is it possible to make it show these only when the member is logged in.
ie
1/if visitor = cant see member section or admin section, cam see public
2/if member= logged it shows the membner section and public section
3/if Admin logged in its shows both admin and member and publicCode:<?php
/************************************************************************/
/* Forums Block for phpBB 2.0.0-6 port to PHP Nuke 6.5+ */
/* ==================================================== */
/* Copyright (c) 2003-2004 by Telli (telli@codezwiz.com) */
/* http://codezwiz.com */
/* Last Edited - 20 Aug 2004 */
/* */
/* 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). */
/************************************************************************/
if (eregi("block-Forums_Scroll.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
///define("_BBFORUM_TOTTOPICS","Topics ");
///define("_BBFORUM_TOTPOSTS","Posts ");
///define("_BBFORUM_TOTVIEWS","Views ");
///define("_BBFORUM_TOTREPLIES","Replies ");
///define("_BBFORUM_TOTMEMBERS","Members");
///define("_BBFORUM_FORUM","Forums");
///define("_BBFORUM_SEARCH","Search");
include_once ('blocks/smileys.php');
$cz_theme = get_theme();
global $prefix, $user_prefix, $db, $dbi, $sitename, $user, $cookie, $group_id;
$count = 1;
$content = "<table class=\"row1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">
<tr>
</table>";
$content .= "<table class=\"row1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">
<tr>
<td class=\"row1\" width=\"100%\">";
$content .= "<A name= \"scrollingCode\"></A><MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"100\" scrollamount= \"2\" scrolldelay= \"1\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .= "<br>";
$result1 = $db->sql_query("SELECT
t.topic_id, t.topic_last_post_id, t.topic_title,
f.forum_name, f.forum_id,
u.username, u.user_id,
p.poster_id, FROM_UNIXTIME(p.post_time,'%b %d, %Y at %T') as post_time
FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f
LEFT JOIN ".$prefix."_bbposts p ON (p.post_id = t.topic_last_post_id)
LEFT JOIN ".$prefix."_users u ON (u.user_id = p.poster_id)
WHERE t.forum_id=f.forum_id AND f.auth_view=0
ORDER BY t.topic_last_post_id DESC
/*this edits # of mess in block */
LIMIT 10");
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result1)) {
$topic_title=parseEmoticons($topic_title);
$content .= "<img src=\"themes/$cz_theme/forums/images/icon_minipost.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 class=\"content\"><i>Last post by <A HREF=\"forums.html?file=profile&mode=viewprofile&u=$poster_id\"STYLE=\"text-decoration: none\"> $username </a> in <a href=\"forums.html?amp;file=viewforum&f=$forum_id\">$forum_name</a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "</marquee></td></tr></table>";
$content .= "<table class=\"row1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">
<tr>
</tr></table>";
?>
|
|
|
|
|
 |
ShosMeister
New Member


Joined: Jun 08, 2005
Posts: 18
Location: Harpers Ferry, WV
|
Posted:
Mon Jun 13, 2005 12:00 pm |
|
It looks like most of this is resolved, but, mine seems so much simpler. Not sure if it will work for you but thought I'd put it out there:
Code:$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 10", $dbi);
|
The key is the f.auth_view=0. |
_________________
Old Programmers Never Die ... They Just Lose Their Bits |
|
|
 |
Steptoe

|
Posted:
Thu Jun 23, 2005 5:56 am |
|
Im dont realy understand the above...I cant get it to work in my block,
can one of u recode it for me please.
I want it to show the hidden members forums if there is a new post there,only if a member is logged in, remaining hidden for visitors.but still always shows the rest of the posts
When I hover over the link to the hiden members forum, it comes up as
site/forums-11.html is that the id code?
Code:<?php
/* Copyright (c) 2003-2004 by Telli (telli@codezwiz.com) */
/* http://codezwiz.com
/************************************************************************/
/* Forums Block for phpBB 2.0.0-6 port to PHP Nuke 6.5+ */
/* ==================================================== */
/* Copyright (c) 2003-2004 by Telli (telli@codezwiz.com) */
/* http://codezwiz.com */
/* Last Edited - 20 Aug 2004 */
/* */
/* 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). */
/************************************************************************/
if (eregi("block-Forums_Scroll.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
///define("_BBFORUM_TOTTOPICS","Topics ");
///define("_BBFORUM_TOTPOSTS","Posts ");
///define("_BBFORUM_TOTVIEWS","Views ");
///define("_BBFORUM_TOTREPLIES","Replies ");
///define("_BBFORUM_TOTMEMBERS","Members");
///define("_BBFORUM_FORUM","Forums");
///define("_BBFORUM_SEARCH","Search");
include_once ('blocks/smileys.php');
$cz_theme = get_theme();
global $prefix, $user_prefix, $db, $dbi, $sitename, $user, $cookie, $group_id;
$count = 1;
$content = "<table class=\"row1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">
<tr>
</table>";
$content .= "<table class=\"row1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">
<tr>
<td class=\"row1\" width=\"100%\">";
$content .= "<A name= \"scrollingCode\"></A><MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"100\" scrollamount= \"2\" scrolldelay= \"1\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .= "<br>";
$result1 = $db->sql_query("SELECT
t.topic_id, t.topic_last_post_id, t.topic_title,
f.forum_name, f.forum_id,
u.username, u.user_id,
p.poster_id, FROM_UNIXTIME(p.post_time,'%b %d, %Y at %T') as post_time
FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f
LEFT JOIN ".$prefix."_bbposts p ON (p.post_id = t.topic_last_post_id)
LEFT JOIN ".$prefix."_users u ON (u.user_id = p.poster_id)
WHERE t.forum_id=f.forum_id AND f.auth_view=0
ORDER BY t.topic_last_post_id DESC
/*this edits # of mess in block */
LIMIT 10");
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result1)) {
$topic_title=parseEmoticons($topic_title);
$content .= "<img src=\"themes/$cz_theme/forums/images/icon_minipost.gif\" border=\"0\" alt=\"\"><a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font class=\"content\"><i>Last post by <A HREF=\"forum-userprofile-.html$poster_id\"STYLE=\"text-decoration: none\"> $username </a> in <a href=\"modules.php?name=Forums&file=viewforum&f=$forum_id\">$forum_name</a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "</marquee></td></tr></table>";
$content .= "<table class=\"row1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">
<tr>
</tr></table>";
?>
|
Cheers
Steps |
|
|
|
 |
ShosMeister

|
Posted:
Tue Nov 08, 2005 10:50 am |
|
I'm trying to get my modified scrolling block uploaded. It will do what I think you want:
It will scroll any messages that the individual user has access to read/view even if the message is in a hidden/private forum. |
|
|
|
 |
Steptoe

|
Posted:
Tue Nov 08, 2005 12:16 pm |
|
Can u post your code? I will give it a shot on our site. |
|
|
|
 |
ShosMeister

|
Posted:
Fri Nov 11, 2005 7:09 am |
|
I'm having a time trying to upload the file here. In the meantime, anyone that wants it can e-mail me and I'll send it to you. |
|
|
|
 |
Steptoe

|
Posted:
Fri Nov 11, 2005 1:07 pm |
|
|
|
 |
bfnuke
Hangin' Around

Joined: Feb 01, 2006
Posts: 43
|
Posted:
Tue Feb 14, 2006 8:42 am |
|
I have modified this even more to allow the block to hide "registered" forums from visitors, but to have them visible once you login. It also will handle the admin as well.
Also added the ability to change how many posts are listed via variable (howmany).
Code:
<?php
/************************************************************************/
/* Forums Block for phpBB 2.0.0 port to PHP Nuke 6.5b6+ */
/* ==================================================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi (fbc@mandrakesoft.com) */
/* http://phpnuke.org */
/* */
/* Version 1, modified by S�bastien Vaast */
/* http://membres.lycos.fr/projectpluto/ */
/* */
/* Updated by Tom Nitzschner 22/06/2002 to add the scrolling text */
/* */
/* Updated by Paul Laudanski 14 Jan 2003 */
/* NukeCops.com | ComputerCops.biz */
/* */
/* Last Edited - 14 Jan 2003 */
/* */
/* This Block shows the last x 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. */
/************************************************************************/
// Hacks for newer PHP-Nuke versions by mmv3.com
// 09/02/05 - the UK way
//
//Modified to hide visitor, show registered and admin
//2006/02/14 - bfnuke
if (eregi("block-Forums.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
require_once("mainfile.php");
function parseEmoticons ($text) {
$emoticons = array();
$emoticons[] = array(":)", "<img src='modules/Forums/images/smiles/icon_smile.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":D", "<img src='modules/Forums/images/smiles/icon_biggrin.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":(", "<img src='modules/Forums/images/smiles/icon_sad.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array("Shocked", "<img src='modules/Forums/images/smiles/icon_eek.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":?", "<img src='modules/Forums/images/smiles/icon_confused.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array("8)", "<img src='modules/Forums/images/smiles/icon_cool.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":lol:", "<img src='modules/Forums/images/smiles/icon_lol.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":x", "<img src='modules/Forums/images/smiles/icon_mad.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":P", "<img src='modules/Forums/images/smiles/icon_razz.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":oops:", "<img src='modules/Forums/images/smiles/icon_redface.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":cry:", "<img src='modules/Forums/images/smiles/icon_cry.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":evil:", "<img src='modules/Forums/images/smiles/icon_evil.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":twisted:", "<img src='modules/Forums/images/smiles/icon_twisted.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":roll:", "<img src='modules/Forums/images/smiles/icon_twisted.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":wink:", "<img src='modules/Forums/images/smiles/icon_wink.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":!", "<img src='modules/Forums/images/smiles/icon_exclaim.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":?", "<img src='modules/Forums/images/smiles/icon_question.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":idea:", "<img src='modules/Forums/images/smiles/icon_idea.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":arrow:", "<img src='modules/Forums/images/smiles/icon_arrow.gif' alt='' align='absmiddle' BORDER=0>");
$emoticons[] = array(":o", "<img src='modules/Forums/images/smiles/icon_surprised.gif' alt='' align='absmiddle' BORDER=0>");
foreach ($emoticons as $emoticon) {
$text = str_replace($emoticon[0],$emoticon[1],$text);
}
return $text;
}
global $prefix, $db, $sitename, $user, $cookie, $group_id, $user_prefix, $admin;
$count = 1;
$howmany = 10; //How many forum posts in scrolling list
$showthese = "(0)"; //Auth view level 0-visitor, 1-registered, 2-subscribed
if(is_user($user) OR is_admin($admin)) {
if(is_admin($admin)) {
$showthese = "(0,1,2,3)";
} else {
$showthese = "(0,1)";
}
}
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"20\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Last $howmany Forum Messages</b></center>";
$result1 = $db->sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view IN ".$showthese." ORDER BY t.topic_last_post_id DESC LIMIT ".$howmany);
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id) = $db->sql_fetchrow($result1)) {
$result2 = $db->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'");
list($topic_id, $poster_id, $post_time)=$db->sql_fetchrow($result2);
$result3 = $db->sql_query("SELECT username, user_id FROM ".$user_prefix."_users where user_id='$poster_id'");
$row8 = $db->sql_fetchrow($result3);
$username = $row8['username'];
$user_id = $row8['user_id'];
$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> in <a href=\"forums.html?amp;file=viewforum&f=$forum_id\">$forum_name</a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "<br><center>[ <a href=\"forums.html\"STYLE=\"text-decoration: none\">$sitename ]</center>";
?>
|
|
|
|
|
 |
|