Greetings All,
I altered the Old Forums Scroll block to get rid of $dbi and a bunch of " ' "
What else did I miss?
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 */
/* Modified by Dawg for new $db */
/************************************************************************/
if (eregi("block-ForumsScroll.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
global $prefix, $db, $sitename, $user, $cookie, $group_id;
$count = 1;
$amount = 30;
$content = "<a name= 'scrollingCode'></a>";
$content .="<marquee behavior= 'scroll' align= 'center' direction= 'up' height='300' 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 = $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) = $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 ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result3);
Joined: Mar 30, 2006 Posts: 2404 Location: Pennsylvania
Posted:
Wed Jun 17, 2009 5:29 pm
Code:
if (eregi("block-ForumsScroll.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
Should be:
Code:
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
Code:
global $prefix, $db, $sitename, $user, $cookie, $group_id;
I don't think $group_id, $$cookie, or $user_id are needed.
Code:
global $db, $prefix, $sitename;
Code:
$content .= "<img src='modules/Forums/templates/subSilver/images/icon_mini_message.gif' border='0'alt='' \/><a href='forums.html&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 />";
A lot of your closing tags in this string have something like this <br \/> instead of this <br />.
You also need to remove the capital HREF= and STYLE=.
You should validate the block with
Only registered users can see links on this board! Get registered or login to the forums!
The only other thing that I would would be to tackle the whole " vs ' quotes thing. If you don't know what I am talking about or don't feel comfortable doing it I wouldn't worry about it.
I know "Some" of the ' vs " but not enough to feel comfortable with the sql part of it so I am going to leave 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 */
/* Modified by Dawg for new $db */
/* with help from Palbin */
/************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
global $db, $prefix, $sitename;
$count = 1;
$amount = 30;
$content = "<a name= 'scrollingCode'></a>";
$content .="<marquee behavior= 'scroll' align= 'center' direction= 'up' height='300' scrollamount= '2' scrolldelay= '25' onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center><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) = $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 ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result3);
and if you look through those errors....they are all about the use of the marquee tag and the code that runs it. Anything with Marquee in it is not going to test valid.
I have tested it againest IE7 and 8, FF3 and it works as expected.
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