Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues
Author Message
mrix
Client



Joined: Dec 04, 2004
Posts: 757

PostPosted: Tue Oct 28, 2008 4:21 pm Reply with quote

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 Confused
anyway I was wondering if anyone else has a latest forum post block I can use ?
cheers all
mrix
 
View user's profile Send private message Visit poster's website
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Tue Oct 28, 2008 6:20 pm Reply with quote

How about posting the code for the block-fiapple-Forums.php and maybe we can fix it? What is it doing? Not doing? ???

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
mrix







PostPosted: Tue Oct 28, 2008 6:24 pm Reply with quote

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";
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue Oct 28, 2008 9:28 pm Reply with quote

It's probably the $dbi issue. Please see these threads for more information.
[ 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! ] [ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
mrix







PostPosted: Wed Oct 29, 2008 5:20 am Reply with quote

Hi thanks for the idea`s and I know you experienced guys totally understand what your talking about Very Happy 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 Crying or Very sad I have looked through the topics but its a little over my head to be honest Confused
Dont suppose someone could re-code the fiapple block as its a more popular block and you can download from this site Question
cheers all
mrix
 
montego







PostPosted: Wed Oct 29, 2008 6:02 am Reply with quote

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.
 
Raven







PostPosted: Wed Oct 29, 2008 7:14 am Reply with quote

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
 
mrix







PostPosted: Wed Oct 29, 2008 8:49 am Reply with quote

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. Confused
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 Very Happy
maybe it would be good idea if there was a list somewhere of blocks that are conmpatable with the latest ravenuke Question
cheers
mrix
 
Raven







PostPosted: Wed Oct 29, 2008 8:54 am Reply with quote

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 Wink. Thanks.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Wed Oct 29, 2008 10:47 am Reply with quote

Here is the new code. I fixed all the $dbi issues, added $user_prefix, fixed a few notices, and made it xhtml compliant.

Code:
SEE TWO POSTED DOWN


Last edited by Palbin on Wed Oct 29, 2008 4:33 pm; edited 3 times in total 
View user's profile Send private message
mrix







PostPosted: Wed Oct 29, 2008 3:17 pm Reply with quote

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
 
Palbin







PostPosted: Wed Oct 29, 2008 4:30 pm Reply with quote

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";
 ?>
 
mrix







PostPosted: Wed Oct 29, 2008 6:03 pm Reply with quote

Great Stuff, many thanks for finding the time to get this block up to date Very Happy
Its such a nice addition and now my site is running on the updated code and all is just great! Very Happy
many thanks for your time and this great fix Very Happy
cheers
mrix
 
Palbin







PostPosted: Wed Oct 29, 2008 7:15 pm Reply with quote

Dance-Y
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.3 RN Issues

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©