View Full Version : Limit # of searches possible at once
just could not wait, but yet another hack reguest filled by Neo(tm)...... the link: https://vborg.vbsupport.ru/showthread.php?s=&threadid=35583
Ok kids... this is a big hack... not for people that only want to install a hack in 5 mins... the instruction file tells all.... let me repate and say this.... this is a big hack to your search.php so back it up before you do anything to it... cuz I wont trouble shoot that at all....
this has a admin cp to change the amount of searches possible at once... and it works pretty well on my vb... as you can in my images...
User Thing:
http://forums.animeutopia.com/forum/limitsearch1.jpg
Admin Thing:
http://forums.animeutopia.com/forum/limitsearch2.jpg
and here is the file..... BOOOOOOOOOOOOOOOM! *smoke raises and Neo falls on his ass*
Updated.
Admin
03-06-2002, 10:41 AM
Why not use a setting in the setting table, so you don't need another field / file?
Ohh good point. I never knew about that.
Admin
03-06-2002, 10:56 AM
Oh and what's the point in the Admin thing if you have this in your code?
if ($userssearch>=5) {
Scott MacVicar
03-06-2002, 10:59 AM
you have hardcoded values in your code
if ($userssearch>=5) {
also why not simply add it to the settings table, that would be like one query and would save people having to upload a file.
errrr... hold on a sec I ziped the wrong file.
Scott MacVicar
03-06-2002, 11:00 AM
damn chen got there first lol
Overgrow
03-06-2002, 12:51 PM
Shiznit!
The only part I'm worried about is if it's possible for a user to shut down their browser or crash or something and have their flag stuck at "1" ? Have you had any flags accumulate stuck at "1" yet?
AWESOME request filled, thanks neo... Since I'm the requestor I will definitely try it out and let you know about things getting stuck or how many complaints I get about it :) Should be a big help for big sites.
I haven't installed it yet, but I see this in the code:
$usdbamt = mysql_query("SELECT varname FROM setting WHERE varname='ups'");
$usdbamt_query = mysql_fetch_row($usdbamt);
$userssearchamt = $usdbamt_query[0]
It's missing the semi-colon at the end of the last line.. but really you don't need these lines at all. When you put something into the setting table, it is automatically loaded with every page. All you have to do is reference the name of the variable "$ups" and it will be there without that extra query.
Originally posted by Overgrow
Shiznit!
The only part I'm worried about is if it's possible for a user to shut down their browser or crash or something and have their flag stuck at "1" ? Have you had any flags accumulate stuck at "1" yet?
AWESOME request filled, thanks neo... Since I'm the requestor I will definitely try it out and let you know about things getting stuck or how many complaints I get about it :) Should be a big help for big sites.
I haven't installed it yet, but I see this in the code:
$usdbamt = mysql_query("SELECT varname FROM setting WHERE varname='ups'");
$usdbamt_query = mysql_fetch_row($usdbamt);
$userssearchamt = $usdbamt_query[0]
It's missing the semi-colon at the end of the last line.. but really you don't need these lines at all. When you put something into the setting table, it is automatically loaded with every page. All you have to do is reference the name of the variable "$ups" and it will be there without that extra query.
Once I finished making it I didnt have any flags stuck as I know of. But if you find any, feel free to tell me.
Usually when I cute and paste code I either leave the $ or the ; out.... I am not to careful about that, and I never knew about the settings that for the info. I will update it right away.
Scott MacVicar
03-06-2002, 04:48 PM
btw neo you should use vBulletins database class this is just an example cause $ups will have the value as you now know.
$usdbamt_query = $DB_site->query_first("SELECT varname FROM setting WHERE varname='ups'");
$userssearchamt = $usdbamt_query[0];
this allows you to have nice error reporting, just you will have to remember to globalize $DB_site in any function which accesses the database.
Yeah I finally got it working. And I used the settings to do it.. I never knew about that before.. and I usually use that... for some reason, I used that other as you see.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.