Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks
Author Message
64bitguy
The Mouse Is Extension Of Arm



Joined: Mar 06, 2004
Posts: 1164

PostPosted: Tue May 10, 2005 7:47 am Reply with quote

Hi

I wanted to ask this one in public in case anyone else ever needs to do this.

On my domain, I'm using a userinfo block that has a ton of extra features, one of which is the ability to control who sees what at each level (anonymous, registered, subscribed, admin, etc...)

I advised another user to use Raven's block for a variety of reasons and a question that came up was this.

He wants to hide the "Who is online" information from anonymous users (You wouldn't actually see that section unless you were logged in).

Is there a quick fix for this short of recoding the block for session info?

I was hoping it would simply be a matter of changing the section:
Code:
    else {

      $who_online_now .= "$zi:&nbsp;<a href=\"userinfo-.html$member_result[username]\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $member_result[username]\"></a>&nbsp;<a href=\"messages-post-.html$member_result[user_id]\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\"Send a quick private message to $member_result[username]\"></a>&nbsp;<A HREF=\"forums.html?file=profile&mode=viewprofile&u=$member_result[user_id]\">".$sessionNameModified."</a><br />\n";
       $who_online_now .= ($i != $member_online_num ? "  " : "");
       $i++;
   }
}

Thanks
Steph

_________________
Steph Benoit
100% Section 508 and W3C HTML5 and CSS Compliant (Truly) Code, because I love compliance. 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Tue May 10, 2005 11:14 am Reply with quote

If they're using my block, just set the block to Registered Users Only.
 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Tue May 10, 2005 12:45 pm Reply with quote

I think Steph wants the block to appear for everyone, but the Who's Online portion to only appear for registered users.

Something like this might work:

Code:
if (!isset($user)) {

      $who_online_now = "";
} else {
      $who_online_now .= "$zi:&nb...

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
64bitguy







PostPosted: Tue May 10, 2005 1:42 pm Reply with quote

I actually now have it as (that whole section):
Code:
while ($member_result = $db->sql_fetchrow($result)) {

    if ($i < 10) $zi = "0$i";
    else $zi = $i;
    if (is_admin($admin)) {
      $zi = "<a href=\"http://www.samspade.org/t/lookat?a=".$member_result[host_addr]."\" target=\"_blank\">".$zi."</a>";
   }
   $sessionNameModified = strlen($member_result[username])<13?$member_result[username]:substr($member_result[username],0,10)."...";
    if (!$member_result[user_allow_viewonline]&&!is_admin($admin)) {
      $hiddenTotal++;
   }
    elseif (!$member_result[user_allow_viewonline]&&is_admin($admin)) {
      $hiddenTotal++;
      $who_online_now .= "$zi:&nbsp;<a href=\"userinfo-.html$member_result[username]\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $member_result[username]\"></a>&nbsp;<a href=\"messages-post-.html$member_result[user_id]\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\"Send a quick private message to $member_result[username]\"></a>&nbsp;<A HREF=\"forums.html?file=profile&mode=viewprofile&u=$member_result[user_id]\">".$sessionNameModified."</a>(H)<br />\n";
       $who_online_now .= ($i != $member_online_num ? "  " : "");
       $i++;
   }
    elseif (!isset($user)) {
      $who_online_now .= "";
   } else {
      $who_online_now .= "$zi:&nbsp;<a href=\"userinfo-.html$member_result[username]\"><img src=\"images/blocks/icon_mini_profile.gif\" border=\"0\" alt=\"Check the profile of $member_result[username]\"></a>&nbsp;<a href=\"messages-post-.html$member_result[user_id]\"><img src=\"images/blocks/nopm.gif\" border=\"0\" alt=\"Send a quick private message to $member_result[username]\"></a>&nbsp;<A HREF=\"forums.html?file=profile&mode=viewprofile&u=$member_result[user_id]\">".$sessionNameModified."</a><br />\n";
       $who_online_now .= ($i != $member_online_num ? "  " : "");
       $i++;
   }
}

But yeah, that isset was what I was forgetting.

Thanks kguske.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Blocks

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 ©