I have pasted the forum block that we use on our main page below as it won't allow me to upload .php as an attachement.
I would like to add the ability to 'hoover' over the topic and get a small popup box with the text of the post.
I have been able to do this to the main forums page using "Mouse Hover First Post 1.0.1 " from your site.
Anyone have any idea how i add this functionality to this block?
Thanks!!!
<?php
/*=======================================================================
Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
=======================================================================*/
/************************************************************************
Nuke-Evolution: Enhanced Forum Block
============================================
Copyright (c) 2005 by The Nuke-Evolution Team
Filename : block-Forums.php
Author : JeFFb68CAM (www.
Evo-Mods.com)
Version : 3.0
Date : 11.05.2005 (mm.dd.yyyy)
Description : Enhanced Forum Block will show all your recent topics
on your homepage. It will match any theme you use for
your PHP-Nuke / Nuke-Evolution website. It is cached
so that it provides optimum performance with your
Nuke-Evolution web portal.
************************************************************************/
/*****[CHANGES]**********************************************************
-=[Base]=-
Nuke Patched v3.1.0 06/26/2005
Caching System v1.0.0 10/30/2005
-=[Mod]=-
Advanced Username Color v1.0.5 10/30/2005
************************************************************************/
if(!defined('NUKE_EVO')) exit;
global $prefix, $db, $sitename, $admin, $ThemeSel, $user_prefix, $board_config, $currentlang, $cache;
/***[CONFIGURATION]******************************************************/
/* These options give you the ability to customize this block */
/************************************************************************/
$HideViewReadOnly = 1; # Set this to 1 to hide posts that a user it not authorized to see, set to 0 to let them see any and all posts.
$AlternateRowClass = 1; # Set this to 1 to give your block a little bit of 'class' by changing the style of each row, set to 0 to disable.
$Last_New_Topics = 10; # Set this to however many topics you'd like to be displayed.
$SplitAnnouncements = 1; # Set this to 1 to split your board's most recent Announcements and Global Announcements from the normal topics.
$NumAnnouncements = 2; # Set this to the number of announcements you'd like to be displayed.
/***[CONFIGURATION]******************************************************/
/* These options give you the ability to customize this block */
/************************************************************************/
function make_a_row($row_class, $topic_first_post_id, $topic_title, $forum_name, $forum_id, $user_id, $username, $topic_replies, $topic_views, $post_time, $topic_last_post_id, $poster_name, $poster_id) {
global $ThemeSel;
$row = "<tr>"
."<td height=\"34\" nowrap=\"nowrap\" class=\"$row_class\"><img src=\"themes/$ThemeSel/forums/images/folder_new.gif\" alt=\"New Topic\" border=\"0\" /></td>"
."<td width=\"100%\" class=\"$row_class\"><a href=\"modules.php
?name=Forums&file=viewtopic&p=$topic_first_post_id#$topic_first_post_id\">$topic_title</a></td>"
."<td align=\"center\" class=\"$row_class\"><a href=\"modules.php
?name=Forums&file=viewforum&f=$forum_id\">$forum_name</a></td>"
."<td align=\"center\" class=\"$row_class\"><a href=\"modules.php
?name=Forums&file=profile&mode=viewprofile&u=$user_id\">$username</a></td>"
."<td align=\"center\" class=\"$row_class\">$topic_replies</td>"
."<td align=\"center\" class=\"$row_class\">$topic_views</td>"
."<td align=\"center\" nowrap=\"nowrap\" class=\"$row_class\"><font size=\"-2\"><i> $post_time </i></font><br />"
."<a href=\"modules.php
?name=Forums&file=profile&mode=viewprofile&u=$poster_id\">$poster_name</a> <a href=\"modules.php
?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\">"
."<img src=\"themes/$ThemeSel/forums/images/icon_newest_reply.gif\" alt=\"New Post\" border=\"0\"></a></td>"
."</tr>";
return $row;
}
function make_table($posts, $announcements, $SplitAnnouncements) {
$table = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">"
."<tr>"
."<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"
."<tr>"
."<td><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" class=\"forumline\">"
."<tr>"
."<th height=\"35\" colspan=\"2\" align=\"center\" nowrap=\"nowrap\" class=\"thcornerl\"><span class=\"block-title\"><strong>Topic</strong></span></th>"
."<th width=\"70\" align=\"center\" nowrap=\"nowrap\" class=\"thtop\"><span class=\"block-title\"><strong> Forum </strong></span></th>"
."<th width=\"70\" align=\"center\" nowrap=\"nowrap\" class=\"thtop\"><span class=\"block-title\"><strong> Author </strong></span></th>"
."<th width=\"50\" align=\"center\" nowrap=\"nowrap\" class=\"thtop\"><span class=\"block-title\"><strong> Replies </strong></span></th>"
."<th width=\"38\" align=\"center\" nowrap=\"nowrap\" class=\"thtop\"><span class=\"block-title\"><strong> Views </strong></span></th>"
."<th align=\"center\" nowrap=\"nowrap\" class=\"thcornerr\"><span class=\"block-title\"><strong> Last Post </strong></span></th>"
."</tr>";
if ($SplitAnnouncements) {
$table .= "<tr><th class=\"thTop\" colspan=\"7\" height=\"28\" align=\"left\"><span class=\"cattitle\">Announcements</span></th></tr>";
$table .= ($announcements) ? $announcements : "<tr><td class=\"row3\" colspan=\"7\" height=\"15\">There are no announcements.</td></tr>";
}
$table .= ($SplitAnnouncements) ? "<tr><th class=\"thTop\" colspan=\"7\" height=\"28\" align=\"left\"><span class=\"cattitle\">Topics</span></th></tr>" : "";
$table .= ($posts) ? $posts : "<tr><td class=\"row3\" colspan=\"7\" height=\"15\">There are no topics.</td></tr>";
$table .= "<tr>"
."<th class=\"thBottom\" height=\"28\" colspan=\"7\" align=\"right\" class=\"catbottom\">[ <a href=\"modules.php
?name=Forums&file=recent\">Recent Topics</a> ] </th>"
."</tr>"
."</table></td>"
."</tr>"
."</table></td>"
."</tr>"
."</table>";
return $table;
}
$Count_Topics = 0;
$where = ($SplitAnnouncements) ? "AND t.topic_type != '2' AND t.topic_type != '3'" : "";
$where .= ($HideViewReadOnly) ? " AND f.auth_view = '0' AND f.auth_read = '0'" : "";
/*****[BEGIN]******************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
//if (!$TopicData = $cache->load('TopicData', 'home')) {
/*****[END]********************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
$TopicData = array();
$result = $db->sql_query( "SELECT t.topic_id, t.topic_type, f.forum_name, f.forum_id, t.topic_last_post_id, t.topic_first_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, p.post_time, p.poster_id, pu.username as postername, u.username, u.user_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f, ".$prefix."_bbposts p, ".$user_prefix."_users u, ".$user_prefix."_users pu WHERE t.forum_id=f.forum_id AND p.post_id=t.topic_last_post_id AND u.user_id=t.topic_poster AND pu.user_id=p.poster_id AND t.topic_moved_id = '0' $where ORDER BY topic_last_post_id DESC LIMIT $Last_New_Topics");
while ( list( $topic_id, $topic_type, $forum_name, $forum_id, $topic_last_post_id, $topic_first_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $post_time, $poster_id, $poster_name, $username, $user_id ) = $db->sql_fetchrow( $result))
{
$TopicData[$topic_id]['topic_id'] = $topic_id;
$TopicData[$topic_id]['topic_type'] = $topic_type;
$TopicData[$topic_id]['forum_name'] = $forum_name;
$TopicData[$topic_id]['forum_id'] = $forum_id ;
$TopicData[$topic_id]['topic_last_post_id'] = $topic_last_post_id ;
$TopicData[$topic_id]['topic_first_post_id'] = $topic_first_post_id;
$TopicData[$topic_id]['topic_title'] = $topic_title;
$TopicData[$topic_id]['topic_poster'] = $topic_poster;
$TopicData[$topic_id]['topic_views'] = $topic_views;
$TopicData[$topic_id]['topic_replies'] = $topic_replies;
$TopicData[$topic_id]['post_time'] = $post_time;
$TopicData[$topic_id]['poster_id'] = $poster_id;
$TopicData[$topic_id]['poster_name'] = $poster_name;
$TopicData[$topic_id]['username'] = $username;
$TopicData[$topic_id]['user_id'] = $user_id;
}
$db->sql_freeresult($result);
/*****[BEGIN]******************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
// $cache->save('TopicData', 'home', $TopicData);
/*****[END]********************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
//}
$TopicData = (is_array($TopicData)) ? $TopicData : array();
foreach($TopicData as $topic_info) {
$row_class = ($Count_Topics % 2 && $AlternateRowClass) ? "row3" : "row2";
$Count_Topics += 1;
/*****[BEGIN]******************************************
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
$username = UsernameColor($topic_info['username']);
$poster_name = UsernameColor($topic_info['poster_name']);
/*****[END]********************************************
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
$post_time = EvoDate( $board_config['default_dateformat'] , $topic_info['post_time'] , $board_config['board_timezone'] );
$posts .= make_a_row($row_class, $topic_info['topic_first_post_id'], $topic_info['topic_title'], $topic_info['forum_name'], $topic_info['forum_id'], $topic_info['user_id'], $username, $topic_info['topic_replies'], $topic_info['topic_views'], $post_time, $topic_info['topic_last_post_id'], $poster_name, $topic_info['poster_id']);
}
# Start Custom Announcements Addon
if ($SplitAnnouncements) {
$Count_Announcements = 0;
$where = ($HideViewReadOnly) ? " AND f.auth_view = '0' AND f.auth_read = '0'" : "";
/*****[BEGIN]******************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
//if (!$AnnounceData = $cache->load('AnnounceData', 'home')) {
/*****[END]********************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
$AnnounceData = array();
$result = $db->sql_query( "SELECT t.topic_id, t.topic_type, f.forum_name, f.forum_id, t.topic_last_post_id, t.topic_first_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, p.post_time, p.poster_id, pu.username, u.username, u.user_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f, ".$prefix."_bbposts p, ".$user_prefix."_users u, ".$user_prefix."_users pu WHERE t.forum_id=f.forum_id AND p.post_id=t.topic_last_post_id AND u.user_id=t.topic_poster AND t.topic_type != '0' AND t.topic_type != '1' AND t.topic_type < '20' AND pu.user_id=p.poster_id AND t.topic_moved_id = '0' $where ORDER BY topic_last_post_id DESC LIMIT $NumAnnouncements");
while ( list( $topic_id, $topic_type, $forum_name, $forum_id, $topic_last_post_id, $topic_first_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $post_time, $poster_id, $poster_name, $username, $user_id ) = $db->sql_fetchrow( $result))
{
$AnnounceData[$topic_id]['topic_id'] = $topic_id;
$AnnounceData[$topic_id]['topic_type'] = $topic_type;
$AnnounceData[$topic_id]['forum_name'] = $forum_name;
$AnnounceData[$topic_id]['forum_id'] = $forum_id ;
$AnnounceData[$topic_id]['topic_last_post_id'] = $topic_last_post_id ;
$AnnounceData[$topic_id]['topic_first_post_id'] = $topic_first_post_id;
$AnnounceData[$topic_id]['topic_title'] = $topic_title;
$AnnounceData[$topic_id]['topic_poster'] = $topic_poster;
$AnnounceData[$topic_id]['topic_views'] = $topic_views;
$AnnounceData[$topic_id]['topic_replies'] = $topic_replies;
$AnnounceData[$topic_id]['post_time'] = $post_time;
$AnnounceData[$topic_id]['poster_id'] = $poster_id;
$AnnounceData[$topic_id]['poster_name'] = $poster_name;
$AnnounceData[$topic_id]['username'] = $username;
$AnnounceData[$topic_id]['user_id'] = $user_id;
}
$db->sql_freeresult($result);
/*****[BEGIN]******************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
// $cache->save('AnnounceData', 'home', $AnnounceData);
/*****[END]********************************************
[ Base: Caching System v3.0.0 ]
******************************************************/
//}
$AnnounceData = (is_array($AnnounceData)) ? $AnnounceData : array();
foreach($AnnounceData as $announce_info) {
$row_class = ($Count_Announcements % 2 && $AlternateRowClass) ? "row3" : "row2";
$Count_Announcements += 1;
/*****[BEGIN]******************************************
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
$username = UsernameColor($announce_info['username']);
$poster_name = UsernameColor($announce_info['poster_name']);
/*****[END]********************************************
[ Mod: Advanced Username Color v1.0.5 ]
******************************************************/
$post_time = EvoDate( $board_config['default_dateformat'] , $announce_info['post_time'] , $board_config['board_timezone'] );
$announcements .= make_a_row($row_class, $announce_info['topic_first_post_id'], $announce_info['topic_title'], $announce_info['forum_name'], $announce_info['forum_id'], $announce_info['user_id'], $username, $announce_info['topic_replies'], $announce_info['topic_views'], $post_time, $announce_info['topic_last_post_id'], $poster_name, $announce_info['poster_id']);
}
}
$content .= make_table($posts, $announcements, $SplitAnnouncements);
?>