Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel™ v2.5.x
Author Message
fondy
Regular
Regular


Joined: Sep 12, 2003
Posts: 55

PostPosted: Wed Jul 19, 2006 6:45 am Reply with quote

Hi

after upgrading til sentinel 2.5.0 my block-phpib2-Forums.php block dont work anymore. I use the block as a center block om the front page.

The code is here: Only registered users can see links on this board! Get registered or login!

regards fondy
 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin


Joined: Aug 28, 2003
Posts: 6792
Location: Ha Noi, Viet Nam

PostPosted: Wed Jul 19, 2006 6:50 am Reply with quote

Thats a very old block. It uses the old $dbi abstraction layer and needs updating for the latest patch series.
I'm not sure ifanyone or the original author would update the block but you could always use the Collapsing Center block available on this site as an alternative.
 
View user's profile Send private message Send e-mail
myrtletrees
Involved
Involved


Joined: Sep 13, 2005
Posts: 259
Location: Cornfields of Indiana

PostPosted: Wed Jul 19, 2006 9:33 am Reply with quote

Code:
<?php


########################################################################
# PHP-Nuke Block: phpib2 Center Forum Block v.2                          #
# Made for PHP-Nuke 6.5 and up                                               #
#                                                                      #
# Made by mikem http://www.nukecops.com                                #
# This block is made only to match the phpib2 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 ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}
include_once ('blocks/smileys.php');

global $prefix, $sitename, $db, $user, $cookie, $group_id;
// When set to 1 then Forums permissions which View and/or Read are NOT set to 'ALL' will NOT be displayed in the center block
$HideViewReadOnly = 0;
// Shows only 5 last new topics. Must be one higher than number to show
$Last_New_Topics  = 5;
$show = "  <tr>
    <td height=\"28\" colspan=\"6\" align=\"center\" class=\"catbottom\" background=\"themes/fisubice/images/cellpic_nav.gif\">&nbsp;</td>
  </tr>
</table></td>
        </tr>
      </table></td>
  </tr>
</table>";

$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = $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" );
$content .= "<br>";
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow( $result1 ) )
{
   $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 ".$prefix."_users where user_id='$topic_poster'");
list($username, $user_id)=$db->sql_fetchrow($result2);
$user_id = intval($user_id);

$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);
$poster_id = intval($poster_id);

$result4 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result4);
$user_id = intval($user_id);
                         $viewlast .="  <tr>
    <td height=\"30\" nowrap bgcolor=\"#EAEFF6\" class=\"row1\"><img src=\"themes/fisubice/forums/images/folder_new.gif\" border=\"0\" /></td>
    <td width=\"100%\" bgcolor=\"#EAEFF6\" class=\"row1\">&nbsp;<b>$forum_name</b><br>&nbsp;&nbsp;<a href=\"forums.html?file=viewtopic&t=$topic_id#$topic_last_post_id\" alt=\"$topic_title\" title=\"$topic_title\">$topic_title</a></td>
    <td align=\"center\" bgcolor=\"#DFE6EF\" class=\"row2\">$topic_replies</td>
    <td align=\"center\" bgcolor=\"#EAEFF6\" class=\"row3\"><a href=\"profile-.html$sifra\" alt=\"$username\" title=\"$username\">$avtor</a></td>
    <td align=\"center\" bgcolor=\"#DFE6EF\" class=\"row2\">$topic_views</td>
    <td align=\"center\" nowrap bgcolor=\"#C2CFDF\" class=\"row3\"><font size=\"-2\"><i>&nbsp;&nbsp;$post_time&nbsp;</i></font><br>
      <a href=\"profile-.html$user_id\" alt=\"$username\" title=\"$username\">$username</a>&nbsp;<a href=\"forums.html?file=viewtopic&t=$topic_id#$topic_last_post_id\"><img src=\"themes/fisubice/forums/images/icon_minipost_new.gif\" border=\"0\" alt=\"View Latest Post\" title=\"View 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\">
  <tr>
    <th height=\"25\" colspan=\"2\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thcornerl\"><font color=\"#DEEEF3\"><strong>Siste innlegg i forumet</strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong>&nbsp;Svar&nbsp;</strong></font></th>
    <th width=\"100\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong>&nbsp;Av&nbsp;</strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong>&nbsp;Visninger&nbsp;</strong></font></th>
    <th align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thcornerr\"><font color=\"#DEEEF3\"><strong>&nbsp;Siste innlegg&nbsp;</strong></font></th>
  </tr>";
    $content .= "$viewlast";

 $content .= "$show";

?>


Try that.
The main problem was that result1 was not getting the right info from the DB. Plus I went ahead and updated it to use the new abstraction layer along with chatserv's fixes.
 
View user's profile Send private message
fondy
PostPosted: Wed Jul 19, 2006 9:57 am Reply with quote

Guardian2003 wrote:
Thats a very old block. It uses the old $dbi abstraction layer and needs updating for the latest patch series.
I'm not sure ifanyone or the original author would update the block but you could always use the Collapsing Center block available on this site as an alternative.


Thanks for the reply.

Yes, if the block is not working i could try the collapsing block.

fondy
 
fondy
PostPosted: Wed Jul 19, 2006 10:04 am Reply with quote

myrtletrees wrote:
Try that.
The main problem was that result1 was not getting the right info from the DB. Plus I went ahead and updated it to use the new abstraction layer along with chatserv's fixes.


Hi, thanks for the new code. However the block was not working. When I acivate the block with the new code, the site Only registered users can see links on this board! Get registered or login! could not come up again.

fondy
 
myrtletrees
PostPosted: Wed Jul 19, 2006 10:11 am Reply with quote

Make sure you copy and paste code with a PHP Editor, not NOTEPAD or Wordpad

Possible code got corrupted when copied and saved

If still does not work, I can zip file for you to d/l

Here is the code again:

Code:
<?php


########################################################################
# PHP-Nuke Block: phpib2 Center Forum Block v.2                          #
# Made for PHP-Nuke 6.5 and up                                               #
#                                                                      #
# Made by mikem http://www.nukecops.com                                #
# This block is made only to match the phpib2 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 ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
    die();
}
include_once ('blocks/smileys.php');

global $prefix, $sitename, $db, $user, $cookie, $group_id;
// When set to 1 then Forums permissions which View and/or Read are NOT set to 'ALL' will NOT be displayed in the center block
$HideViewReadOnly = 0;
// Shows only 5 last new topics. Must be one higher than number to show
$Last_New_Topics  = 5;
$show = "  <tr>
    <td height=\"28\" colspan=\"6\" align=\"center\" class=\"catbottom\" background=\"themes/fisubice/images/cellpic_nav.gif\">&nbsp;</td>
  </tr>
</table></td>
        </tr>
      </table></td>
  </tr>
</table>";

$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = $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" );
$content .= "<br>";
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow( $result1 ) )
{
   $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 ".$prefix."_users where user_id='$topic_poster'");
list($username, $user_id)=$db->sql_fetchrow($result2);
$user_id = intval($user_id);

$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);
$poster_id = intval($poster_id);

$result4 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result4);
$user_id = intval($user_id);
                         $viewlast .="  <tr>
    <td height=\"30\" nowrap bgcolor=\"#EAEFF6\" class=\"row1\"><img src=\"themes/fisubice/forums/images/folder_new.gif\" border=\"0\" /></td>
    <td width=\"100%\" bgcolor=\"#EAEFF6\" class=\"row1\">&nbsp;<b>$forum_name</b><br>&nbsp;&nbsp;<a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\" alt=\"$topic_title\" title=\"$topic_title\">$topic_title</a></td>
    <td align=\"center\" bgcolor=\"#DFE6EF\" class=\"row2\">$topic_replies</td>
    <td align=\"center\" bgcolor=\"#EAEFF6\" class=\"row3\"><a href=\"forum-userprofile-.html$sifra\" alt=\"$username\" title=\"$username\">$avtor</a></td>
    <td align=\"center\" bgcolor=\"#DFE6EF\" class=\"row2\">$topic_views</td>
    <td align=\"center\" nowrap bgcolor=\"#C2CFDF\" class=\"row3\"><font size=\"-2\"><i>&nbsp;&nbsp;$post_time&nbsp;</i></font><br>
      <a href=\"forum-userprofile-.html$user_id\" alt=\"$username\" title=\"$username\">$username</a>&nbsp;<a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\"><img src=\"themes/fisubice/forums/images/icon_minipost_new.gif\" border=\"0\" alt=\"View Latest Post\" title=\"View 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\">
  <tr>
    <th height=\"25\" colspan=\"2\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thcornerl\"><font color=\"#DEEEF3\"><strong>Siste innlegg i forumet</strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong>&nbsp;Svar&nbsp;</strong></font></th>
    <th width=\"100\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong>&nbsp;Av&nbsp;</strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong>&nbsp;Visninger&nbsp;</strong></font></th>
    <th align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thcornerr\"><font color=\"#DEEEF3\"><strong>&nbsp;Siste innlegg&nbsp;</strong></font></th>
  </tr>";
    $content .= "$viewlast";

 $content .= "$show";

?>
 
fondy
PostPosted: Wed Jul 19, 2006 11:37 am Reply with quote

Hi

I cant get the code working. I have used both Dreamweaver and Textpad to copy and paste.

Can you zip the code ?

Regards fondy
 
myrtletrees
PostPosted: Wed Jul 19, 2006 12:09 pm Reply with quote

Herer you go, hope it works.
It works on my 7.6 raven distro site with Sentinel 2.5.00

Only registered users can see links on this board! Get registered or login!
 
fondy
PostPosted: Wed Jul 19, 2006 1:34 pm Reply with quote

myrtletrees wrote:
Herer you go, hope it works.
It works on my 7.6 raven distro site with Sentinel 2.5.00

Only registered users can see links on this board! Get registered or login!


Thanks a lot myrtletrees

I testet the block on a site with 7.6 Raven distro and sentinel 2.4.2.pl5 all is ok. But on my site with nuke 7.6 and sentinel 2.5.0 it still is a problem. I updated sentinel from 2.3.0 to 2.5.0 on this site today, I think I have to check the code updates I did here.

Thanks again

Regards fondy
 
myrtletrees
PostPosted: Wed Jul 19, 2006 1:53 pm Reply with quote

Maybe that is the problem. You upgraded from 2.3.0 to 2.5.0
The 2.5.0 upgrade package is only for upgrades from 2.4.x to 2.5.0
Did you upgrade to 2.4.x from 2.3.0 before going to 2.5.0? or did you find an upgrade package that takes you from 2.3.0 to 2.5.0?
 
fondy
PostPosted: Wed Jul 19, 2006 1:57 pm Reply with quote

myrtletrees wrote:
Maybe that is the problem. You upgraded from 2.3.0 to 2.5.0
The 2.5.0 upgrade package is only for upgrades from 2.4.x to 2.5.0
Did you upgrade to 2.4.x from 2.3.0 before going to 2.5.0? or did you find an upgrade package that takes you from 2.3.0 to 2.5.0?


In the nsnst.php from the 2.5.0 package there is upgrades from all 2.3.x versions also. I did all the upgrades to 2.5.0.
 
myrtletrees
PostPosted: Wed Jul 19, 2006 2:19 pm Reply with quote

make sure you also have the file smileys.php in your blocks/ directory
 
fondy
PostPosted: Wed Jul 19, 2006 2:27 pm Reply with quote

myrtletrees wrote:
make sure you also have the file smileys.php in your blocks/ directory


I did not find smiley.php so I had to comment it out in the block for testing.
 
myrtletrees
PostPosted: Wed Jul 19, 2006 5:29 pm Reply with quote

Here's the smileys.php for future reference

Only registered users can see links on this board! Get registered or login!
 
fondy
PostPosted: Wed Jul 19, 2006 11:53 pm Reply with quote

myrtletrees wrote:
Here's the smileys.php for future reference

Only registered users can see links on this board! Get registered or login!


Hi, thanks a lot

regards fondy
 
jtmcadams
New Member
New Member


Joined: Jun 21, 2003
Posts: 18
Location: Las Vegas, NV

PostPosted: Sat Jul 22, 2006 5:53 pm Reply with quote

I have this same problem but I didn't upgrade I did a fresh install of sentinel 2.5 and as soon as sentinel was installed and working the forum scroller quit working, I've tried to use the new one posted with out any luck, I can't even get the collapsing version to work. Any ideas?
 
View user's profile Send private message Visit poster's website
fondy
PostPosted: Sat Jul 22, 2006 10:47 pm Reply with quote

jtmcadams wrote:
I have this same problem but I didn't upgrade I did a fresh install of sentinel 2.5 and as soon as sentinel was installed and working the forum scroller quit working, I've tried to use the new one posted with out any luck, I can't even get the collapsing version to work. Any ideas?


Yes tested the collapsing block, it didnt work here either
 
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Sun Jul 23, 2006 4:45 am Reply with quote

Alot of people are having problems with the collapsing forums block, I believe people are looking into it and I'm pretty sure you will see an update or a fix for it very shortly.

Patience is a virtue.

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!! 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> NukeSentinel™ v2.5.x

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 ©