1
drummond
Custom User Profile Depending on Membership
  • 2005/6/14 5:35

  • drummond

  • Just popping in

  • Posts: 36

  • Since: 2004/6/19


I am trying to make it so anonymous users can only view certain parts of a member's profile, but if a user is a member, allow them to see the entire profile.

I have been hacking around in system_userinfo.html but I am not a programmer and am not having much luck. This is what I was thinking:

<{$chkgroup = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_REGISTERED;}>

<{if $chkgroup == true}>

<{$lang_extrainfo}>
<{$user_extrainfo}>

<{/if}>

Can anyone give me a hint as to what I need to do? Should I be hacking userinfo.php instead?

2
drummond
Re: Custom User Profile Depending on Membership
  • 2005/6/22 17:17

  • drummond

  • Just popping in

  • Posts: 36

  • Since: 2004/6/19


Is there a global XOOPS variable that will detect if the person viewing a page is logged in, or if they are anonymous? If so, that could be used in a template file to determine what items that user should be seeing.

Anyone? Help!

3
Mithrandir
Re: Custom User Profile Depending on Membership

If you just want to distinguish between logged-in users and not, you can use
<{if $xoops_isuser}>

4
drummond
Re: Custom User Profile Depending on Membership
  • 2005/6/23 14:57

  • drummond

  • Just popping in

  • Posts: 36

  • Since: 2004/6/19


Ahh, thanks...I haven't tried that yet, but I found that this worked in the xoopsmembers/index.php file to only show the extended profile link if the person viewing was a member:

if ( $xoopsUser ) {
$userdata['realname'] = $foundusers[$j]->getVar("name") ? ".$foundusers[$j]->getVar("uid")."'>".$foundusers[$j]->getVar("name")."" "";

} else {
$userdata['realname'] = $foundusers[$j]->getVar("name") ? $foundusers[$j]->getVar("name") : " ";
}

5
Dhrystone
Re: Custom User Profile Depending on Membership
  • 2005/7/20 22:07

  • Dhrystone

  • Just popping in

  • Posts: 6

  • Since: 2005/3/31


I just posted an open question in the FAQ about this but figured I'd crosspost in this thread too. I have a site where I don't want ANY users except site admins to have permission to even VIEW user profiles, let alone edit them. Can I globally restrict access to profile editing (ie userinfo.php) to site administrators only? So even if a registered user manually navigates to ~/userinfo.php, they will see the usual "You do not have permission" error?

Cheers
Dhry

Login

Who's Online

216 user(s) are online (101 user(s) are browsing Support Forums)


Members: 0


Guests: 216


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits