» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 53
0 members and 53 guests
No Members online
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
Tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Football Betting - best nfl betting promotions at sportsbook.com.
Oral Chelation - initial cleansing of your veins & arteries
Portatiles - Ofertas en Ordenadores y Portatiles. Increibles Ofertas DELL.

Register Now! Contact Us

About this Page
This is a discussion on Helius Forums Center Block within the Nuke 7.x - Blocks forums, part of the PHP-Nuke 7.x category; I wonder if any of you folks can help. I'm looking to include posts from private forums as well ...


Go Back   Nukemods Forum » PHP-Nuke 7.x » Nuke 7.x - Blocks

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-11-2005, 08:36 AM
Junior Member
 
Join Date: Jan 2005
Posts: 3
Helius Forums Center Block
I wonder if any of you folks can help. I'm looking to include posts from private forums as well as the public/registered forums in the center forum block, but to only be viewable to people with the correct access levels.

I had this working under nuke 6.9 & phpbb 2.0.6 but it no longer works under nuke 7.5 & phpbb 2.0.10(patched).

Any help appreciated,

Regards,

[_]frisp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2005, 02:33 PM
Junior Member
 
Join Date: Jan 2005
Posts: 3
Think I have it sussed out, can one of you kind people look over the code, see if I've made any glaring errors,

This forum block will a check to make sure the user has access to view the forums were the posts were made. If not it will not display the post. This checks both bbauth_access.auth_view = 1 and bbauth_access.auth_mod = 1 as well as checking to see if forum is public by using bbforums.auth_read.

Code:
<?php
/*************************************************/
/*************************************************/
/* Helius Theme Center Forum Block With Security */
/* Made For PHP Nuke 7.5                         */
/*                                               */
/* Made By Frisp http://www.unrealgamerz.org     */
/* Based On Helius Center Forum Block v.3        */
/* Made by mikem http://www.nukemods.com         */
/*                                               */
/* 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 Free Software Foundation; either */
/* version 2 of the License.                     */
/*************************************************/
/*************************************************/
 
if (eregi("block-Forums.php", $PHP_SELF)) {
    Header("Location: index.php");
    die();
}

global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
cookiedecode($user);
$uname = $cookie[1];
$result10 = sql_query("SELECT u.user_id FROM ".$prefix."_users u where username = '$uname'", $dbi);
list($user_id)=sql_fetch_row($result10, $dbi);
$userid = $user_id;
$count = 1;

$show = "  <tr> 
    <td bgcolor=\"#525E6E\" height=\"25\" colspan=\"6\" align=\"center\" background=\"themes/Helius/forums/images/top_center.gif\"></td>
  </tr>
</table></td>
        </tr>
      </table></td>
  </tr>
</table>";

$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = sql_query("SELECT DISTINCT t.topic_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id, f.forum_name, f.forum_id, f.auth_read 
				FROM     ".$prefix."_bbtopics t, ".$prefix."_bbforums f,".$prefix."_bbuser_group a, ".$prefix."_bbauth_access b 
				where    t.forum_id=f.forum_id       and
					   f.forum_id=b.forum_id       and
					   b.group_id=a.group_id       and
  				 	   (( a.user_id='$userid' and (b.auth_view = 1 or b.auth_mod = 1 )) OR f.auth_read = 0)
				ORDER BY t.topic_last_post_id DESC LIMIT 5", $dbi);
while(list($topic_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id, $forum_name, $forum_id, $auth_read) = sql_fetch_row($result1, $dbi)) 
{
   $skip_display = 0;
   if( $HideViewReadOnly == 1 )
   {

      $result2 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
      list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result2 );
      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,'%b %d, %Y at %T') 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 topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result4, $dbi);
$result5 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result5, $dbi);

            	          $viewlast .="  <tr> 
    <td height=\"34\" nowrap bgcolor=\"#EAEDF4\" class=\"row1\"><img src=\"themes/Helius/forums/images/folder_new.gif\" width=\"19\" height=\"18\" border=\"0\" /></td>
    <td width=\"100%\" bgcolor=\"#EAEDF4\" class=\"row1\">$forum_name
<a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\">$topic_title</a></td>
    <td align=\"center\" bgcolor=\"#F8F9FA\" class=\"row2\">$topic_replies</td>
    <td align=\"center\" bgcolor=\"#EAEDF4\" class=\"row3\"><a href=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$sifra\">$avtor</a></td>
    <td align=\"center\" bgcolor=\"#F8F9FA\" class=\"row2\">$topic_views</td>
    <td align=\"center\" nowrap bgcolor=\"#EAEDF4\" 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/Helius/forums/images/icon_minipost_new.gif\" border=\"0\" alt=\"Last Post\"></a></td>
  </tr>";
}
   
   if( $Last_New_Topics == $Count_Topics ) { break 1; }
   
}

    $content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td bgcolor=\"#525E6E\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
  <tr> 
    <th height=\"25\" colspan=\"2\" align=\"center\" nowrap background=\"themes/Helius/forums/images/top_center.gif\" class=\"thcornerl\"><font color=\"#364D67\">Forum/Topic</font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/Helius/forums/images/top_center.gif\" class=\"thtop\"><font color=\"#364D67\">Replies</font></th>
    <th width=\"100\" align=\"center\" nowrap background=\"themes/Helius/forums/images/top_center.gif\" class=\"thtop\"><font color=\"#364D67\">Author</font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/Helius/forums/images/top_center.gif\" class=\"thtop\"><font color=\"#364D67\">Views</font></th>
    <th align=\"center\" nowrap background=\"themes/Helius/forums/images/top_center.gif\" class=\"thcornerr\"><font color=\"#364D67\">Last Post</font></th>
  </tr>";
    $content .= "$viewlast";

 $content .= "$show";

?>
Regards,

[_]frisp
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2005, 07:46 PM
Eck Eck is offline
Junior Member
 
Join Date: Apr 2005
Posts: 3
This was exactly what I have been searching for. It worked very well, I seem to have no problems with it.

Thank you very, very much.

If People ask will you have a problem if I point them here to download it?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2005, 02:15 PM
Junior Member
 
Join Date: Jan 2005
Posts: 3
Glad it worked ok, and no problems, help yourselves
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forum center block pulling info from two forums? Liqid Nuke 7.x - Blocks 0 09-03-2005 12:19 PM
iCGstation - Problem with Forums Center Block Theberge43 Theme packs 0 07-25-2005 05:42 PM
Problems using DAJ_Glass-Forums Center block with DAJ_Glass cab0725 Theme packs 2 07-24-2005 10:52 PM
Forums Center Block Virgil Nuke 6.5 to 6.9 - Blocks 3 05-21-2003 04:24 PM
phpbbmodule center block chuck Purged Topics 19 03-26-2003 12:08 PM


All times are GMT -5. The time now is 06:21 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31