Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
emmaphp
Worker
Worker



Joined: Aug 22, 2006
Posts: 192

PostPosted: Sat Jan 17, 2009 8:43 pm Reply with quote

Hi All,

I have tried using a Forums Scrolling block with my new installation of Raven Nuke 2.3, however it does not appear when activated, (as a right hand block).

This worked without any issues with a previous installation of Raven Nuke 2.1.

Additionally, I have noted that if you select the block to display on the left or as a block center up block, then all other blocks on the page disappear.

Please would some one take a look at this (code) and advise what the issue could be and a resolve.

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=\"235\" scrollamount= \"2\" scrolldelay= \"50\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#FFFFFF\"><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=\"#6677A0\"><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&amp;p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#6677A0\"><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><font color=\"#A600C9\">[<a href=\"forums.html\"STYLE=\"text-decoration: none\">Click To Visit Forums</a>]</center>";
//$content .= "<center><img src=\"images/banners/fatalexception-logo-88x31.gif\" border=\"0\"></center>";
$content .= "</a>";
?>
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Jan 17, 2009 11:05 pm Reply with quote

Right off I'd advise you to refer to the $dbi sticky note [ Only registered users can see links on this board! Get registered or login! ] and then report back.
 
View user's profile Send private message
emmaphp







PostPosted: Sat Jan 17, 2009 11:33 pm Reply with quote

Hi Raven,

Thanks for that heads up...I can now see how a few things/blocks may become a little 'messy' when trying to use them with the new 2.3 version of Raven Nuke.

I have followed the advise given in the sticky you quoted, but still the block is not working. Often when a block is not working and there is an issue with the code, it will appear but say something like 'there is currently a problem with this block', but the one I am trying to install does not even appear.

The following code is the code I have amended and am currently having problems with:

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, $db, $sitename, $user, $cookie, $group_id;
$count = 1;
$amount = 15;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"235\" scrollamount= \"2\" scrolldelay= \"50\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#FFFFFF\"><b>Last $amount Forum Messages</b></center>";
$result1 = $db->sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT $amount");
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title) = sql_fetch_row($result1, $db)) {
$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)=sql_fetch_row($result2, $db);

$result3 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=sql_fetch_row($result3, $db);

//$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=\"#6677A0\"><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&amp;p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#6677A0\"><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><font color=\"#A600C9\">[<a href=\"forums.html\"STYLE=\"text-decoration: none\">Click To Visit Forums</a>]</center>";
//$content .= "<center><img src=\"images/banners/fatalexception-logo-88x31.gif\" border=\"0\"></center>";
$content .= "</a>";
?>


I would appreciate it very much if someone could either advise where I have gone wrong, or what the problem is etc.

Also, I am wondering if there is a scrolling forums block for Raven Nuke 2.3 that is already available/updated etc?

Thanks in advance all.
 
Raven







PostPosted: Sun Jan 18, 2009 1:01 am Reply with quote

I took the original code and modified it; actually redesigned it. To get it working in RavenNuke(tm) v2.3.00 you need to save the following code as blocks/block-Forums_Scroll.php

Edited by Raven 2009-01-19 to avoid Shortlinks rewrite Smile. I added a space in the 2 links between name=Forums -> name = Forums to allow the correct links to be shown. So, when you copy the code you need to remove the 2 spaces.

Code:
<?php

/************************************************************************/
/* Forums Scrolling Block for RavenNuke(tm)  */
/* =================================================                    */
/*                                                                      */
/* Copyright (c) 2009 by Gaylen Fraley (raven@ravenphpscripts.com       */
/* http://ravenphpscripts.com                     */
/* 2009-01-18  Modified for RavenNuke(tm)  v2.30.00+ by Gaylen Fraley (Raven) http://ravenphpscripts.com */
/* Added security so that user only sees the forums that he is authorized to see */
/*                           */
/* Original 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/                                */
/* =================================================                    */
/*                                               */
/* This Block shows the last (elected number of 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.       */
/************************************************************************/

if (eregi("block-ForumsScroll.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}

//include_once ('blocks/smileys.php');

global $prefix, $user_prefix, $db, $sitename, $user, $cookie, $group_id;
$count = 1;
$amount = 15;
$content = "<a name= \"scrollingCode\"></a>";
$content .="<marquee behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"235\" scrollamount= \"2\" scrolldelay= \"50\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <style=\"text-decoration: none\"><font color=\"#FFFFFF\"><b>Last $amount Forum Messages</b></center>";
$sql = 'SELECT t.forum_id, topic_id, topic_last_post_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 ' . $amount;
$result = $db->sql_query($sql);
$content .= "<br />";
while (list($forum_id, $topic_id, $topic_last_post_id, $topic_title, $auth_view, $auth_read) = $db->sql_fetchrow($result)) {
   if (($auth_view < 2) OR ($auth_read < 2)) {
      $sql1 = "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'";
      $result1 = $db->sql_query($sql1);
      list($topic_id, $poster_id, $post_time) = $db->sql_fetchrow($result1);
      $sql2 = 'SELECT username, user_id FROM ' . $user_prefix . '_users where user_id=' . $poster_id;
      $result2 = $db->sql_query($sql2);
      list($username, $user_id)=$db->sql_fetchrow($result2);

//$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=\"#6677A0\"><b>Message: $count<br /></b>";
      $content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\" alt=\"\">";
      $content .= "<a href=\"modules.php?name = Forums&amp;file=viewtopic&amp;t=".$topic_id."\" style=\"text-decoration: none\"><b> $topic_title </b></a><br />";
      //<font color=\"#6677A0\"><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="modules.php?name = Forums"><b>'.$sitename.' Forums</b></a><br /><br /></center>';
?>


Last edited by Raven on Mon Jan 19, 2009 12:20 pm; edited 1 time in total 
Raven







PostPosted: Sun Jan 18, 2009 5:03 pm Reply with quote

You're welcome?
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sun Jan 18, 2009 9:30 pm Reply with quote

Rolling Eyes
 
View user's profile Send private message Send e-mail
emmaphp







PostPosted: Mon Jan 19, 2009 12:47 am Reply with quote

Hi Raven,

Thank you very much for your reply and supplying the code/2 files to make this block work/compatible with Raven Nuke 2.3.

Firstly, I am interested to learn why this block (code) now requires an accompanying second file (the one to be placed in the location ShortLinks/GTB-block-Forums_Scroll.php), in order for the block to work, but the block that works with older versions of Raven Nuke and PHP Nuke only requires the one Scrolling Forums block itself?

More importantly at this time, there is a slight difference with the block displayed using the aforementioned new code/2 files you supplied and I am wondering if, when you have some time for this, you would kindly advise about this.

Simply, the Scrolling Forums block used previously for previous versions of Raven Nuke and PHP Nuke, not only had the title of a Forum posting displayed, but also the subject of that specific posting.

How can we achieve this with the new code/block you have provided?

Thanks again for this 'all'.
 
dad7732
RavenNuke(tm) Development Team



Joined: Mar 18, 2007
Posts: 1242

PostPosted: Mon Jan 19, 2009 8:31 am Reply with quote

I installed the blocks as per Raven's mods and when I click on any title in the scroll, I get this:
Code:
/forums.html?file=viewtopic&t=7928 was not found on this server


Cheers

Edit: Argggh, never mind, I put the block in a 2.0.02 installation. Bah Sad

Just installed it in a 2.3 install and get the same error. Seems the problem is there is no such file as <b>forums.html</b>
 
View user's profile Send private message
Raven







PostPosted: Mon Jan 19, 2009 9:36 am Reply with quote

Do you have ShortLinks activated?
 
dad7732







PostPosted: Mon Jan 19, 2009 9:48 am Reply with quote

Ah, so that's the secret, will let you know when I get home from work, thanks.
 
dad7732







PostPosted: Mon Jan 19, 2009 11:31 am Reply with quote

O well, I can't use it becaue I don't use ShortLinks.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Mon Jan 19, 2009 12:05 pm Reply with quote

The problem is not with using or not using shortlinks. The problem is that this site uses shortlinks Smile.

This is wrong.
$content .= "<a href=\"forums.html?amp;fi

Not because raven or you posted it wrong, but because this site rewrote it. I will post an offsite text file when I get home unless someone beats me to it.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
Raven







PostPosted: Mon Jan 19, 2009 12:22 pm Reply with quote

I edited the code/post above to allow the code to be shown w/ mod_rewrite butting in Laughing

I added a space in the 2 links between name=Forums -> name = Forums to allow the correct links to be shown. So, when you copy the code you need to remove the 2 spaces.
 
emmaphp







PostPosted: Mon Jan 19, 2009 9:27 pm Reply with quote

Hi 'All',

I actually just returned here to report an issue with the aforementioned Scrolling Forums block, but it appears dad7732 has beaten me to this Wink !

Thanks for the fix again Raven!

Dance-Y
 
dad7732







PostPosted: Mon Jan 19, 2009 9:43 pm Reply with quote

Works now just fine, no ShortLinks needed to be active.

Cheers
 
Raven







PostPosted: Mon Jan 19, 2009 11:01 pm Reply with quote

RavensScripts
 
dad7732







PostPosted: Tue Jan 20, 2009 7:22 am Reply with quote

Cheers

Cheers
 
snyper
Hangin' Around



Joined: Nov 18, 2010
Posts: 28

PostPosted: Mon Feb 07, 2011 4:13 pm Reply with quote

hey i was wondering if you made a newer scrolling forums block since this 1?

Im currently using this one but when someone reply's to a post it doesnt put the post to the top of the list showing its new,it only display's newest actual post not reply,.,.hope your understanding me..
 
View user's profile Send private message
snyper







PostPosted: Wed Feb 16, 2011 10:27 am Reply with quote

hmm dead forums??
 
Guardian2003







PostPosted: Wed Feb 16, 2011 11:06 am Reply with quote

You resurrected a thread that was 2 years old, which is possibly why no one has responded yet.
As far as I know, the latest block is in the downloads on this site but the code posted above was for RavenNuke (tm) 2.3.
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Wed Feb 16, 2011 11:12 am Reply with quote

nukecoder has an alternate scrolling forums block, but I don't know if it orders posts any differently.. [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message Visit poster's website
Raven







PostPosted: Wed Feb 16, 2011 11:34 am Reply with quote

Try the one from RN 2.04.01. I don't remember if we changed it but this site is not (yet) updated to the latest RN.
 
snyper







PostPosted: Sat Feb 19, 2011 1:02 am Reply with quote

thx,.i think i tried the one in the dwnloads here and didnt display and jacked my main page
 
snyper







PostPosted: Sat Feb 19, 2011 12:11 pm Reply with quote

Ya the one here and at that link you posted are the same blocks,but the one on RN wacks out my page the one at the link doesnt and does show by newest post but is centered to the left and looks funny,.,.

I just thought you might of been able to look at the code youve redone on this post and spot out either how to or why it isnt displaying by newest reply..

Theres alot of scrolling forum blocks out there that i like but dont work with ravennuke and i dont know how to rewrite them.,.I like using raven so i guess ill just deal with the block not displaying replies untill i can find one that works with rn.
 
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Sat Feb 19, 2011 12:51 pm Reply with quote

Are you looking for a center block or a side block?

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

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 ©