Previous Thread
Next Thread
Print Thread
Rate Thread
#207550 01/16/2001 11:55 AM
Joined: Dec 2000
Posts: 13
Newbie
Newbie
Offline
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
Sponsored Links
Snorre #207551 01/17/2001 4:20 PM
Joined: Mar 2000
Posts: 84
Member
Member
Offline
Joined: Mar 2000
Posts: 84
Well, isn't that what the Who's Online link is for?

---------
Shalazar
www.charisma-carpenter.com

G5 #207552 01/17/2001 4:36 PM
Joined: Dec 2000
Posts: 13
Newbie
Newbie
Offline
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
Snorre #207553 01/17/2001 11:54 PM
Joined: Mar 2000
Posts: 84
Member
Member
Offline
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.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 253
Joined: January 2000
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 3429
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 4
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)