Previous Thread
Next Thread
Print Thread
Rate Thread
Turn search off for unregistered users
#246784 05/16/2003 8:53 AM
Joined: Jul 2001
Posts: 442
coloradok5 Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Jul 2001
Posts: 442
I was wanting to turn off the search feature by group but I think just turning it off for unregistered users as a small motivation to register sounds like a plan. I thought someone did this before but if not anyone know the best way to turn off the search feature for unregistered users?

Sponsored Links
Re: Turn search off for unregistered users
bisbell #246785 05/16/2003 9:38 AM
Joined: Apr 2002
Posts: 1,768
Dave_L_dup1 Offline
Addict
Offline
Addict
Joined: Apr 2002
Posts: 1,768
This is untested, but should work:

[6.3b4]

search.php

Code
// -----------------<br />// Get the user info<br />   $userob = new user;<br />   $user = $userob -> authenticate("U_Groups");                       <br />   if (!$user['U_Groups']) {<br />      $user['U_Groups'] = "-4-";<br />   }<br /><br />[:"red"]// Limit access to logged-in users.<br />   if (!$user['U_Username']) {<br />      $html = new html;<br />      $html -> not_right('You must be registered and logged in to perform this function.',$Cat);<br />   }[/]


Re: Turn search off for unregistered users
joeuser #246786 05/16/2003 10:07 AM
Joined: Mar 2002
Posts: 305
Lisa_P Offline
Enthusiast
Offline
Enthusiast
Joined: Mar 2002
Posts: 305
Dave's code should work fine - ours is almost the same and it works.

Code
// --------------------------------------------------------------------<br />   $html = new html;<br />   if (!$user['U_Username']) {<br />      $html -> not_right($ubbt_lang['LOGIN_OR_REG'],$Cat);<br />   }


and in language/generic.php we have:

Code
$ubbt_lang['LOGIN_OR_REG']  = 	"Please <a href='login.php'>login</a> or  <a href='newuser.php'>register</a> to use this function.";


(Because if we don't provide the link to login or register, I inevitably get people emailing me asking how. )


Just a note though - it doesn't disable the search at the bottom of the postlist page. They can still search each forum individually. We don't disable that because hopefully some people use it to prevent duplicate posts.


[:"red"]Lisa[/]
Re: Turn search off for unregistered users
JacquiL #246787 05/16/2003 10:56 AM
Joined: Jul 2001
Posts: 442
coloradok5 Offline OP
Enthusiast
OP Offline
Enthusiast
Joined: Jul 2001
Posts: 442
Thanks guys, Josh sent me some code to, maybe this will help with site performance as well.


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
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Forum Statistics
Forums63
Topics37,529
Posts293,721
Members13,834
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 143
Topics Created 0
Posts Made 1
Users Online 2
Birthdays 17
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,795
Greg Hard 4,625
Top Posters(30 Days)
isaac 3
Top Likes Received
isaac 33
Gizmo 8
Brett 7
Morgan 2
Top Likes Received (30 Days)
isaac 3
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Snapshot build 20200217.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.034s Queries: 23 (0.011s) Memory: 3.2545 MB (Peak: 3.6253 MB) Data Comp: Zlib Server Time: 2020-02-17 21:21:11 UTC
Valid HTML 5 and Valid CSS