A center block,.,.i actually edited the one from the link you gave me and works pretty nice now,.got it to display center with bigger text so i should be set.,.thx
This sorta works on 2.4 just show the topic's. No latest post, date/time or by who and the time. Any ideas on how to fix this??
Thanks.
Raven wrote:
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 . 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);
Joined: Mar 11, 2007 Posts: 1535 Location: North Carolina
Posted:
Wed Aug 31, 2011 4:12 pm
Did you try removing the // from the lines lines of code to show that?
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);
It's working just the latest post is not showing up on top for some reason and the time is in 24hr where the forums are 12hr. Must be missing something
Joined: Mar 11, 2007 Posts: 1535 Location: North Carolina
Posted:
Thu Sep 01, 2011 6:26 am
If you want it displayed in 12 hours, I think you will need to modify this line:
Code:
$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'";
To this:
Code:
$sql1 = "SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %r') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'";
Have you tried other browsers to see if the block shows the latest post or have you refreshed the browser?
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