Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jul 2001
Posts: 442
Enthusiast
Enthusiast
Offline
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
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
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 />   }[/]


Joined: Mar 2002
Posts: 305
Enthusiast
Enthusiast
Offline
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[/]
Joined: Jul 2001
Posts: 442
Enthusiast
Enthusiast
Offline
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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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
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 20221218)