Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
NAME: Locking down Who's Online
VERSION: 1.0.0
DESCRIPTION: Restricts the who's online page to registered users only.
WORKING UNDER: UBB.threads 6.2.3
PREREQUISITES: none
AUTHORS: Dalantech
CREDITS:
DEMO: Who's Online at Da Forum. If you are not registered you'll see an error page.
FILES ALTERED: online.php
DATABASE ALTERED: no
NEW FILES: None.
HISTORY: Initial release.

Backup your online.php file first!

In online.php look for:

Code
<br />// Get the user info<br />   $userob = new user;<br />   $user = $userob -> authenticate("U_TimeOffset,U_Groups"); 


and under it ADD:

Code
<br />   $Username = $user['U_Username'];<br /><br />// Block if Not Logged in<br />if (!$Username) {<br />   $html = new html;<br />   $html -> not_right('You must <a href="login.php">Login</a> or <a href="newuser.php">Register a Username</a> To use the Who is Online display.',$Cat);<br />}   


Save and upload the online.php file to your Threads directory.

Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Works like a charm. Thanks!

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Glad you like it

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
If you wanted to simplify this slightly, you could get rid of the first line, and change the "if" to:

if (!$user['U_Username']) {

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Thanks!

Sponsored Links
Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
Lisa P posted a mod for 6.0.2 to lock down who's online that I didn't even see until today. Her version blocks people who have set themselves to invisible, and it may work for Threads 6.2.x (but I haven't tried it yet). Good job!

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
JustDave has this feature on IIP.

[]If a user a user is invisible should we allow them to see others that are not?
Note: Admins are not affected by this setting.[/]

But I guess it really defeats the purpose if it only affects the PAL box.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
I haven't modified the PAL box to only allow registered users to see it... yet...


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:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
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-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)