Reply
A little help please...
Old 07-16-2004, 06:36 PM A little help please...
Junior Talker

Posts: 1
Hey I'm trying to add a block module in php-nuke that displays the latest topics in the forums in a scrolling marquee but it seems to only work in Internet Explorer. In Netscape it puts the ENTIRE forum squished up in the little block. I was wondering how to edit the code below to be Netscape friendly. If anyone can help I'd really appreciate it.

if (eregi("block-Forums_Scroll.php", $PHP_SELF)) {
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;
/* Total Amount of Topics */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbtopics" );
$Amount_Of_Topics = $db->sql_numrows( $result );

/* Total Amount of Posts */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbposts" );
$Amount_Of_Posts = $db->sql_numrows( $result );

/* Total Amount of Topic Views */
$Amount_Of_Topic_Views = 0;
$result = $db->sql_query( "SELECT topic_views FROM ".$prefix."_bbtopics" );
while( list( $topic_views ) = $db->sql_fetchrow( $result ) )
{
$Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;
}

/* Total Amount of Topic Replies */
$Amount_Of_Topic_Replies = 0;
$result = $db->sql_query( "SELECT topic_replies FROM ".$prefix."_bbtopics" );
while( list( $topic_replies ) = $db->sql_fetchrow( $result ) )
{
$Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;
}

/* Total Amount of Members */
$result = $db->sql_query( "SELECT * FROM ".$user_prefix."_users" );
$Amount_Of_Members = $db->sql_numrows( $result );

$count = 1;
$content = "<table class=\"row1\" cellspacing=\"0\" cellpadding=\"3\" width=\"100%\">
<tr>
<td align=\"left\" class=\"row1\" width=\"50%\"><font class=\"tiny\"><b>"._BBFORUM_TOTTOPICS."</b></font></td>
<td align=\"left\" class=\"row1\" width=\"50%\"><b>$Amount_Of_Topics</b></td>
</tr>
<tr>
<td align=\"left\" class=\"row1\" width=\"50%\"><font class=\"tiny\"><b>"._BBFORUM_TOTPOSTS."</b></font></td>
<td align=\"left\" class=\"row1\" width=\"50%\"><b>$Amount_Of_Posts</b></td>
</tr>
<tr>
<td align=\"left\" class=\"row1\" width=\"50%\"><font class=\"tiny\"><b>"._BBFORUM_TOTVIEWS."</b></font></td>
<td align=\"left\" class=\"row1\" width=\"50%\"><b>$Amount_Of_Topic_Views</b></td>
</tr>
<tr>
<td align=\"left\" class=\"row1\" width=\"50%\"><font class=\"tiny\"><b>"._BBFORUM_TOTREPLIES."</b></font></td>
<td align=\"left\" class=\"row1\" width=\"50%\"><b>$Amount_Of_Topic_Replies</b></td>
</tr>
<tr>
<td align=\"left\" class=\"row1\" width=\"50%\"><font class=\"tiny\"><a href=\"modules.php?name=Members_List\">"._BBFORUM_ TOTMEMBERS."</a></font></td>
<td align=\"left\" class=\"row1\" width=\"50%\"><b>$Amount_Of_Members</b></td>
</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=\"220\" scrollamount= \"2\" scrolldelay= \"20\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font class=\"content\"><b>Last 20 Forum Messages</b></center>";
$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
LIMIT 20");
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&amp;file=viewtopic& amp;p=$topic_last_post_id#$topic_last_post_id\"STY LE=\"text-decoration: none\"><b> $topic_title </b></a><br><font class=\"content\"><i>Last post by <A HREF=\"modules.php?name=Forums&file=profile&mode=v iewprofile&u=$poster_id\"STYLE=\"text-decoration: none\"> $username </a> in <a href=\"modules.php?name=Forums&amp;file=viewforum& amp;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>
<td align=\"center\" class=\"row1\" width=\"50%\"><a href=\"modules.php?name=Forums\">"._BBFORUM_FORUM. "</a></td>
<td align=\"center\" class=\"row1\" width=\"50%\"><a href=\"modules.php?name=Forums&file=search\">"._BB FORUM_SEARCH."</a></td>
</tr></table>";
?>




THANKS!!!!
tiredandbored12 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 07-17-2004, 05:34 PM
Nafai's Avatar
Novice Talker

Posts: 11
Location: London UK
Your best bet would be to find a dHTML/Javascript scroller - there are many available on the web. Then just plug the values from this script straight into the contents of your new script.

I haven't done scrolling things in quite some time, but it is often a difficult thing to get right in all browser renderers.
__________________
Nafai

E-mail: nafai at punkass dot com
IRC: irc.devirc.org:6667
Nafai is offline
Reply With Quote
View Public Profile Visit Nafai's homepage!
 
Reply     « Reply to A little help please...
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12880 seconds with 13 queries