Hey just wanted to show you how to do this for yourself.... Its quite handy if you have the fiblac3d theme because you CAN NOT use the AdvancedForumNews hack found at portedmods.com.
Thanks to nuke mods for there recent forum posts block, the subject of my hack
1. Create a New forum catagory Called 'News'
2. Create a new forum inside this catagory, again called 'News'
Looks like this:
3. Open PHPmyAdmin or whatever you use to edit your MySQL database, look in the _bbforums table and browse it. You will see your 'News' forum and in that table you will see a row called 'forum_id' get this # and remember it
4. Make a new php file called block-forumnews.php Paste this code into the file.
Code:
<?php
########################################################################
# PHP-Nuke Block: fiblack3d Center Forum News Block v.1.0 #
# Made for PHP-Nuke 6.5 ONLY. #
# #
# Made by coldblooded http://www.nukemods.com #
# Modifyed for showing forum new and post text by #
# DaiShan www.midwestdomination.com #
# This block is made only to match the fiblack3d Theme pack #
########################################################################
# 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 you modify this, let me know for fun. =) #
########################################################################
if (eregi("block-fiblack3d-Forum.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
global $prefix, $dbi, $sitename, $admin;
$HideViewReadOnly = 0;
$Last_New_Topics = 10;
$show = " <tr>
<td height=\"28\" colspan=\"6\" align=\"center\" class=\"cat\">&</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>";
$Count_Topics = 0;
$Topic_Buffer = "";
$result = sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics WHERE forum_id = 24 ORDER BY topic_last_post_id DESC", $dbi );
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = sql_fetch_row( $result, $dbi ) )
{
$skip_display = 0;
if( $HideViewReadOnly == 1 )
{
$result1 = sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'", $dbi );
list( $auth_view, $auth_read ) = sql_fetch_row( $result1, $dbi );
if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
}
if( $topic_moved_id != 0 )
{
// Shadow Topic !!
$skip_display = 1;
}
if( $skip_display == 0 )
{
$Count_Topics += 1;
$result2 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'", $dbi);
list($username, $user_id)=sql_fetch_row($result2, $dbi);
$avtor=$username;
$sifra=$user_id;
$result3 = sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %H:%i') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($poster_id, $post_time)=sql_fetch_row($result3, $dbi);
$result4 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result4, $dbi);
$result5 = sql_query("SELECT post_id, post_text FROM ".$prefix."_bbposts_text where post_subject ='$topic_title'", $dbi);
list($post_id, $post_text)=sql_fetch_row($result5, $dbi);
$post_text = ereg_replace("\n","
", $post_text);
$viewlast .=" <tr>
<td align=\"center\" height=\"30\" width=\"35\" nowrap class=\"row1\"><img src=\"themes/fiblack3d/forums/images/folder_new_hot.gif\" border=\"0\" /></td>
<td width=\"100%\" class=\"row1\">&<a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\">$topic_title</a>
$post_text</td>
<td align=\"center\" class=\"row2\">$topic_replies</td>
<td align=\"center\" class=\"row3\"><a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$sifra\">$avtor</a></td>
<td align=\"center\" class=\"row2\">$topic_views</td>
<td align=\"center\" nowrap class=\"row3\"><font size=\"-2\">&&$post_time&</font>
<a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\">$username</a>&<a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"themes/fiblack3d/forums/images/icon_minipost_new.gif\" border=\"0\" alt=\"Latest Post\"></a></td>
</tr>";
}
if( $Last_New_Topics == $Count_Topics ) { break 1; }
}
$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
<tr>
<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td bgcolor=\"#000000\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" class=\"forumline\">
<tr>
<th height=\"25\" colspan=\"2\" align=\"center\" nowrap class=\"thcornerl\"><font color=\"#8E8E8E\">Topics</font></th>
<th width=\"50\" align=\"center\" nowrap class=\"thtop\"><font color=\"#8E8E8E\">&Replies&</font></th>
<th width=\"100\" align=\"center\" nowrap class=\"thtop\"><font color=\"#8E8E8E\">&Author&</font></th>
<th width=\"50\" align=\"center\" nowrap class=\"thtop\"><font color=\"#8E8E8E\">&Views&</font></th>
<th align=\"center\" nowrap class=\"thcornerr\"><font color=\"#8E8E8E\">&Last Post&</font></th>
</tr>";
$content .= "$viewlast";
$content .= "$show";
?>
5.
In this file find---
Code:
$result = sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics WHERE forum_id = # ORDER BY topic_last_post_id DESC", $dbi );
Replace # with the forum_id of your 'News' forum.
Save and add the block from admin panel.
Finished product:
This can also be done with fiblue3d but you need to edit a couple of things if you cant figure it out ill make one up for you just ask.
Hope you like it!!!