Author |
Message |
mrix
Client
![](modules/Forums/images/avatars/blank.gif)
Joined: Dec 04, 2004
Posts: 757
|
Posted:
Tue Oct 28, 2008 4:21 pm |
|
Hi there, with the upgrade I have lost my really nice latest post block block-fiapple-Forums.php not sure if anyone knows the block?
anyway thats stopped working so I decided to try the scrolling forums block in this sites download but that dosnt work anymore
anyway I was wondering if anyone else has a latest forum post block I can use ?
cheers all
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Tue Oct 28, 2008 6:20 pm |
|
How about posting the code for the block-fiapple-Forums.php and maybe we can fix it? What is it doing? Not doing? ??? |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Oct 28, 2008 6:24 pm |
|
Hi there here it is, basically it just doesnt display at all, and also makes my right side blocks dissapear. I have left the <?php and ?> off as the last time the site banned me for some reason
Code:########################################################################
# PHP-Nuke Block: fiapple Center Forum Block v.9 #
# Made for PHP-Nuke 6.5 ONLY!! #
# #
# Made by mikem http://www.nukemods.com #
# Edited by William Wickings http://www.amateur-online.net #
########################################################################
# 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-fiapple-Forum.php",$PHP_SELF)) {
Header("Location: /");
die();
}
global $prefix, $dbi, $sitename, $admin;
$HideViewReadOnly = 1;
$Last_New_Topics = 20;
$show = " <tr>
<td height=\"28\" colspan=\"6\" align=\"center\" class=\"catbottom\" background=\"themes/Anzio/forums/images/cat_bkg.gif\"> </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 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);
$viewlast .=" <tr>
<td height=\"30\" nowrap bgcolor=\"#f5f5f5\" class=\"row1\"><img src=\"themes/Anzio/forums/images/folder_new.gif\" border=\"0\" /></td>
<td width=\"100%\" bgcolor=\"#f5f5f5\" class=\"row1\"> <a href=\"ftopict-$topic_id.html\">$topic_title</a></td>
<td align=\"center\" bgcolor=\"#ececec\" class=\"row2\">$topic_replies</td>
<td align=\"center\" bgcolor=\"#ececec\" class=\"row3\"><a href=\"forum-userprofile-$sifra.html\">$avtor</a></td>
<td align=\"center\" bgcolor=\"#f5f5f5\" class=\"row2\">$topic_views</td>
<td align=\"center\" nowrap bgcolor=\"#ececec\" class=\"row3\"><font size=\"-2\"><i> $post_time </i></font><br>
<a href=\"forum-userprofile-$user_id.html\">$username</a> <a href=\"ftopicp-$topic_last_post_id.html#$topic_last_post_id\"><img src=\"themes/Anzio/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=\"#D1D7DC\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
<tr>
<th height=\"25\" colspan=\"2\" align=\"center\" nowrap background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thcornerl\"><font color=\"#000000\"><strong>Topics</strong></font></th>
<th width=\"50\" align=\"center\" nowrap background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thtop\"><font color=\"#000000\"><strong> Replies </strong></font></th>
<th width=\"100\" align=\"center\" nowrap background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thtop\"><font color=\"#000000\"><strong> Author </strong></font></th>
<th width=\"50\" align=\"center\" nowrap background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thtop\"><font color=\"#000000\"><strong> Views </strong></font></th>
<th align=\"center\" nowrap background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thcornerr\"><font color=\"#000000\"><strong> Last Post </strong></font></th>
</tr>";
$content .= "$viewlast";
$content .= "$show";
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
Site Admin/Owner
![](modules/Forums/images/avatars/45030c033f18773153cd2.gif)
Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Tue Oct 28, 2008 9:28 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 5:20 am |
|
Hi thanks for the idea`s and I know you experienced guys totally understand what your talking about but what about the countless none experienced out there like myself that are using these blocks etc..if they upgrade they will run into the same problems I have looked through the topics but its a little over my head to be honest
Dont suppose someone could re-code the fiapple block as its a more popular block and you can download from this site
cheers all
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 6:02 am |
|
mrix, all you have to do is uncomment two lines of code in mainfile.php for now. The very first link Raven posted has the exact code identified and what to do...
But, yes, it would be better to re-code it. But, who here has that kind of time? I don't. Sorry. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 7:14 am |
|
We cannot take on the recoding of antiquated code. That is always the responsibility of the author(s) of the code or in lieu of their absence or unwillingness, the person using the code. As Montego said, it's a simple matter to resolve your issue, this time. The support of $dbi code is deprecated and will be removed in the future as the database layer that is being used in phpnuke and carried over to RavenNuke(tm) will be rewritten in the future using technology that isn't 4 years old ![Wink](modules/Forums/images/smiles/icon_wink.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 8:49 am |
|
There must be thousands out there that are using old blocks etc and to get authors to update is impossible. As I said I guess many of the blocks that can be downloaded from even this site havnt been updated as the first one I tried wasnt.
Sorry if I sound ungratefull the ravennuke is a really great system but its becoming harder to find blocks that actually work anymore, I did try the fix and that worked fine for now
maybe it would be good idea if there was a list somewhere of blocks that are conmpatable with the latest ravenuke
cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Raven
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 8:54 am |
|
It would be almost impossible to list the blocks/modules. It's much simpler for the webmaster to just scan the code for the $dbi variable. And the process for conversion is simple and has been documented so I think we have covered the issue and the fix . Thanks. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Wed Oct 29, 2008 10:47 am |
|
Here is the new code. I fixed all the $dbi issues, added $user_prefix, fixed a few notices, and made it xhtml compliant.
|
Last edited by Palbin on Wed Oct 29, 2008 4:33 pm; edited 3 times in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 3:17 pm |
|
Hi there many thanks for re-coding this very useful block.
I have installed it but unfortunately it only shows 1 latest post?
Where in the code it shows 1 latest topic it should be showing at least 20 etc.
could you check that bit out the single post its displaying seems to work fine.
cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 4:30 pm |
|
Code:<?php
########################################################################
# PHP-Nuke Block: fiapple Center Forum Block v.9 #
# Made for PHP-Nuke 6.5 ONLY!! #
# #
# Made by mikem http://www.nukemods.com #
# Edited by William Wickings http://www.amateur-online.net #
########################################################################
# 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 (!defined('BLOCK_FILE')) {
Header('Location: ../index.php');
die();
}
global $prefix, $user_prefix, $db, $sitename, $admin;
$HideViewReadOnly = 1;
$Last_New_Topics = 20;
$show = " <tr>
<td height=\"28\" colspan=\"6\" align=\"center\" class=\"catbottom\" background=\"themes/Anzio/forums/images/cat_bkg.gif\"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>";
$Count_Topics = 0;
$Topic_Buffer = "";
$viewlast = "";
$result = $db->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 ORDER BY topic_last_post_id DESC" );
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow( $result ) ) {
$skip_display = 0;
if( $HideViewReadOnly == 1 ) {
$result1 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result1 );
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 = $db->sql_query("SELECT username, user_id FROM ".$user_prefix."_users where user_id='$topic_poster'");
list($username, $user_id) = $db->sql_fetchrow($result2);
$avtor=$username;
$sifra=$user_id;
$result3 = $db->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'");
list($poster_id, $post_time) = $db->sql_fetchrow($result3);
$result4 = $db->sql_query("SELECT username, user_id FROM ".$user_prefix."_users where user_id='$poster_id'");
list($username, $user_id) = $db->sql_fetchrow($result4);
$viewlast .=" <tr>
<td height=\"30\" nowrap=\"nowrap\" bgcolor=\"#f5f5f5\" class=\"row1\"><img src=\"themes/Anzio/forums/images/folder_new.gif\" border=\"0\" /></td>
<td width=\"100%\" bgcolor=\"#f5f5f5\" class=\"row1\"> <a href=\"ftopict-$topic_id.html\">$topic_title</a></td>
<td align=\"center\" bgcolor=\"#ececec\" class=\"row2\">$topic_replies</td>
<td align=\"center\" bgcolor=\"#ececec\" class=\"row3\"><a href=\"forum-userprofile-$sifra.html\">$avtor</a></td>
<td align=\"center\" bgcolor=\"#f5f5f5\" class=\"row2\">$topic_views</td>
<td align=\"center\" nowrap=\"nowrap\" bgcolor=\"#ececec\" class=\"row3\"><font size=\"-2\"><i> $post_time </i></font><br />
<a href=\"forum-userprofile-$user_id.html\">$username</a> <a href=\"ftopicp-$topic_last_post_id.html#$topic_last_post_id\"><img src=\"themes/Anzio/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=\"#D1D7DC\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
<tr>
<th height=\"25\" colspan=\"2\" align=\"center\" nowrap=\"nowrap\" background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thcornerl\"><font color=\"#000000\"><strong>Topics</strong></font></th>
<th width=\"50\" align=\"center\" nowrap=\"nowrap\" background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thtop\"><font color=\"#000000\"><strong> Replies </strong></font></th>
<th width=\"100\" align=\"center\" nowrap=\"nowrap\" background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thtop\"><font color=\"#000000\"><strong> Author </strong></font></th>
<th width=\"50\" align=\"center\" nowrap=\"nowrap\" background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thtop\"><font color=\"#000000\"><strong> Views </strong></font></th>
<th align=\"center\" nowrap=\"nowrap\" background=\"themes/Anzio/forums/images/cat_bkg.gif\" class=\"thcornerr\"><font color=\"#000000\"><strong> Last Post $Count_Topics</strong></font></th>
</tr>";
$content .= "$viewlast";
$content .= "$show";
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
mrix
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 6:03 pm |
|
Great Stuff, many thanks for finding the time to get this block up to date
Its such a nice addition and now my site is running on the updated code and all is just great!
many thanks for your time and this great fix
cheers
mrix |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Oct 29, 2008 7:15 pm |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|