|
|
Joined: Dec 2000
Posts: 13
Newbie
|
Newbie
Joined: Dec 2000
Posts: 13 |
Does anybody know how to have the user list displayed, only for users who are actualy loged-in? I do not want user list displayed for non users.
Many thanks
PG
PG
|
|
|
|
Joined: Mar 2000
Posts: 84
Member
|
Member
Joined: Mar 2000
Posts: 84 |
Well, isn't that what the Who's Online link is for? --------- Shalazar www.charisma-carpenter.com
|
|
|
|
Joined: Dec 2000
Posts: 13
Newbie
|
Newbie
Joined: Dec 2000
Posts: 13 |
Thanks for your reply
Maybe I wasn't clear enough.
I wish to have Userlist menu available only for loged in users. eg the Userlist menu do not appear for Guests but is available once visitor is loged in (with a User status.) Hope it makes sense..
PG
PG
|
|
|
|
Joined: Mar 2000
Posts: 84
Member
|
Member
Joined: Mar 2000
Posts: 84 |
I apologize for the misunderstanding. To do what you're asking only requires a minor change to the main.inc.php file.
Around lines 272-295 of main.inc.php, change the following block of code:
echo " <a href = "$phpurl/login.php?Cat=$Cat">$lang[CPRIV_MENU]</a> $spacer <a href = "$phpurl/online.php?Cat=$Cat">$lang[WHO_ON]</a> $spacer <a href = "$phpurl/$language.php?Cat=$Cat">$lang[FAQ_TEXT]</a> $spacer <a href = "$phpurl/logout.php?Cat=$Cat">$lang[LOGOUT_TEXT]</a> "; }
// ----------------------------- // Are we showing the user list? if ($config['userlist']) { echo " $spacer <a href="$phpurl/showmembers.php?Cat=$Cat&page=1">$lang[USER_LIST]</a> "; } $this->close_table(); echo "<p>"; }
To the following:
echo " <a href = "$phpurl/login.php?Cat=$Cat">$lang[CPRIV_MENU]</a> $spacer <a href = "$phpurl/online.php?Cat=$Cat">$lang[WHO_ON]</a> $spacer <a href = "$phpurl/$language.php?Cat=$Cat">$lang[FAQ_TEXT]</a> $spacer <a href = "$phpurl/logout.php?Cat=$Cat">$lang[LOGOUT_TEXT]</a> "; // ----------------------------- // Are we showing the user list? if ($config['userlist']) { echo " $spacer <a href="$phpurl/showmembers.php?Cat=$Cat&page=1">$lang[USER_LIST]</a> "; } }
$this->close_table(); echo "<p>"; }
Basically, you're moving the "Are we showing the user list" check into the block of code available to only those users logged in.
Best of luck to you. I've tested it with php5.1.5 and it appears to work flawlessly.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 70
Joined: January 2007
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|