Author |
Message |
fondy
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/052.gif)
Joined: Sep 12, 2003
Posts: 63
|
Posted:
Wed Jul 19, 2006 6:45 am |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Guardian2003
Site Admin
![](modules/Forums/images/avatars/125904890252d880f79f312.png)
Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Wed Jul 19, 2006 6:50 am |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
myrtletrees
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/44fbb573445a9d36e3110.jpg)
Joined: Sep 13, 2005
Posts: 259
Location: Cornfields of Indiana
|
Posted:
Wed Jul 19, 2006 9:33 am |
|
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\"> </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\"> <b>$forum_name</b><br> <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> $post_time </i></font><br>
<a href=\"profile-.html$user_id\" alt=\"$username\" title=\"$username\">$username</a> <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> Svar </strong></font></th>
<th width=\"100\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong> Av </strong></font></th>
<th width=\"50\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong> Visninger </strong></font></th>
<th align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thcornerr\"><font color=\"#DEEEF3\"><strong> Siste innlegg </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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 9:57 am |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 10:04 am |
|
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 http://juniorbridge.no could not come up again.
fondy |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
myrtletrees
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 10:11 am |
|
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\"> </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\"> <b>$forum_name</b><br> <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> $post_time </i></font><br>
<a href=\"forum-userprofile-.html$user_id\" alt=\"$username\" title=\"$username\">$username</a> <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> Svar </strong></font></th>
<th width=\"100\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong> Av </strong></font></th>
<th width=\"50\" align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thtop\"><font color=\"#DEEEF3\"><strong> Visninger </strong></font></th>
<th align=\"center\" nowrap background=\"themes/fisubice/images/cellpic_nav.gif\" class=\"thcornerr\"><font color=\"#DEEEF3\"><strong> Siste innlegg </strong></font></th>
</tr>";
$content .= "$viewlast";
$content .= "$show";
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 11:37 am |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
myrtletrees
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 12:09 pm |
|
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! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 1:34 pm |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
myrtletrees
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 1:53 pm |
|
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? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 1:57 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
myrtletrees
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 2:19 pm |
|
make sure you also have the file smileys.php in your blocks/ directory |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 2:27 pm |
|
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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
myrtletrees
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 5:29 pm |
|
Here's the smileys.php for future reference
Only registered users can see links on this board! Get registered or login! |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Jul 19, 2006 11:53 pm |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jtmcadams
New Member
![New Member New Member](modules/Forums/images/ranks/1star.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jun 21, 2003
Posts: 18
Location: Las Vegas, NV
|
Posted:
Sat Jul 22, 2006 5:53 pm |
|
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? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
fondy
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sat Jul 22, 2006 10:47 pm |
|
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 |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
gregexp
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/458c161744a70db912a6e.jpg)
Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol
|
Posted:
Sun Jul 23, 2006 4:45 am |
|
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!! |
|
![ICQ Number ICQ Number](themes/RavenIce/forums/images/lang_english/icon_icq_add.gif) |
![](themes/RavenIce/forums/images/spacer.gif) |
|