View Full Version : Last 10 Searches
AntiOnline
03-06-2002, 10:00 PM
Greetings All:
Updated 3/11/2002: Hack now shows the date and time each search was made, plus the number of results. Also included is the security fix by firefly (thanks).
Updated 3/8/2002: It now also links those search words to the previous search results.
Here's just a little fun feature that I added for my users, and thought that I would share with everyone else. It works with versions 2.03 and up, requires no modifications to your database, and should take less than 2 minutes to install:
This hack displays the last 10 searches made by your users on your main site search page. It uses your censor options to make sure nothing naughty shows up (unless, that is, you want it to).
Demo at http://www.AntiOnline.com/search.php
Enjoy!
Yours In CyberSpace,
John Vranesevich
Founder, AntiOnline
Kinght
03-07-2002, 09:57 PM
nice hack, i like it, very simple to install... : )
wooolF[RM]
03-07-2002, 10:03 PM
]nice nifty hack! thanx! :D
censor options is a VERY good idea! ;)
Robert9
03-08-2002, 04:06 AM
yeah, nice hack, is it possible to poste the threadwors as a link, so when you klick on this word, the forum search this word AND is it possile to post the username right from the searchwords!
the membername with link to the profile!
greetz!
Overgrow
03-08-2002, 06:16 AM
Nice! Why not link the keywords to the searchid so if people see a search they like, they can click right to the results without having to re-run it or type anything in?
Robert9
03-08-2002, 11:24 AM
yes, this would be great, and can you show the user, who searched this words? AND how many results were in his search??
AntiOnline
03-08-2002, 05:56 PM
Greetings All:
I've added Overgrow's request, and updated the file to reflect the changes.
I don't really like the idea of posting a user's name next to the search terms. I think it would be a privacy violation, and I for one would know that my users would have a fit.
To update, for those of you that already have this installed:
In search.php FIND:
$lastsearches=$DB_site->query('SELECT querystring
REPLACE that with this:
$lastsearches=$DB_site->query('SELECT searchid,querystring
In search.php FIND:
$lastsearch .="$lastsearchcount[querystring], ";
REPLACE that with this:
$lastsearch .="[REMOVEurl='search.php?s=&action=showresults&searchid=$lastsearchcount[searchid]&sortby=lastpost&sortorder=descending']$lastsearchcount[querystring][REMOVE/url], ";
Get rid of the word REMOVE before the url= and the /url= That's just there so that it's not replaced on this board posting.
Yours In CyberSpace,
John Vranesevich
Founder, AntiOnline.com
Admin
03-08-2002, 06:30 PM
Nice, installed here with some modifications. :)
inetd
03-08-2002, 06:39 PM
Which modifications? :)
Admin
03-08-2002, 06:42 PM
<a href="https://vborg.vbsupport.ru/search.php?s=" target="_blank">https://vborg.vbsupport.ru/search.php?s=</a>
inetd
03-08-2002, 06:51 PM
In my opinion "Date and Time" column owe be broader...
Robert9
03-08-2002, 07:15 PM
@FireFly
can you plz post the code 4 this modifications, they are very usefull 4 me, THX, if you'll do that!
cYa!
Admin
03-08-2002, 07:18 PM
I'll let AntiOnline do that, after all it is his hack. :)
AntiOnline
03-08-2002, 07:28 PM
Greetings All:
Geeze, thanks firefly =P
I'll work on it tonight and post the updates.
wooolF[RM]
03-08-2002, 10:30 PM
]YaY :D
Jawelin
03-09-2002, 08:12 AM
Just a performance question: when the last 10 searches are exposed this way, I can easly assume most of users will try one or another ...
Question: are these searches cached ? How long they last on the search table in db ?
Thanks
Admin
03-09-2002, 08:18 AM
Yes, all searches are cached in the database for 7 days IIRC (not sure about the time).
When the user clicks the link, only the results are shows and the search is not ran again.
BTW there is a security issue with this hack that I will post a fix to later...
Admin
03-09-2002, 08:25 AM
Ok, if a user can find a searchid of a search that was done by an admin / mod, and goes to that search, he will see all posts inlcuding these in private forums he shouldn't see.
Of course, this hack makes it even easier to find these searches as they are just one click away.
To solve the problem the hack created, replace the query:
$lastsearches=$DB_site->query('SELECT searchid,querystring FROM search WHERE querystring!="" ORDER BY searchid desc LIMIT 0,10');
with this:
$lastsearches=$DB_site->query('SELECT searchid,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
This will make sure no searches submitted by admins, mods and super mods will show up on the list.
Robert9
03-09-2002, 08:33 AM
thx!
Jawelin
03-09-2002, 09:10 AM
Originally posted by FireFly
Yes, all searches are cached in the database for 7 days IIRC (not sure about the time).
When the user clicks the link, only the results are shows and the search is not ran again.
BTW there is a security issue with this hack that I will post a fix to later...
Thanks a lot for info and the fix... ;)
O-T: have you noticed the small bug in search query_string when someone put the star BEFORE the word instead after ?
:surprised
This should be a bug due to some special char in regexp search. Submitted to vb.com, anyway...
Bye and thanks again.
Jawelin
03-09-2002, 02:32 PM
Anyway this hack doesn't work to me.
It only shows the 10 most recent words searched, divided by ',' and each of them links to
http://search.php/?action=showresults&searchid=xxxxx&sortby=lastpost&sortorder=descending
?!?!?
Hwr, much different from the FireFly's implementation here... :)
Thanks
inetd
03-09-2002, 03:00 PM
FireFly has modifications this hack. (post #8 (https://vborg.vbsupport.ru/showthread.php? postid=227146#post227146)). But AntiOnline has promised the same way to update and itself hack.:)
eva2000
03-10-2002, 12:17 PM
Originally posted by FireFly
https://vborg.vbsupport.ru/search.php?s= me wants those modifications too :D
Birdie501
03-10-2002, 12:56 PM
Yes please update the file! I really like the modifications firefly did!
Thanks!
AntiOnline
03-11-2002, 06:02 PM
Greetings All:
As promised, I have updated this hack.
Updated 3/11/2002: Hack now shows the date and time each search was made, plus the number of results. Also included is the security fix by firefly (thanks).
You can download this from the first post in this thread.
(If you already have this hack installed, just copy/paste the new code over the old).
(demo still at: http://www.AntiOnline.com/search.php)
Enjoy!
AntiOnline
03-11-2002, 06:24 PM
Greetings All:
BTW: this hack is finished, so if you could move it into the "Full Releases" forum I would appreciate it.
cditty
03-11-2002, 06:42 PM
1 question and 1 request.....
Q - This will only show the searches done by non-admin users correct? I search and it won't show anything.
R - I seem to have problems with my users saying they are searching when they prob are not. Since the user id is stored in the database, is it possible to show the username of the person that searched? Possibly make it visible to admins and mods?
Chris
ps...thanks for the hack.
inetd
03-11-2002, 07:35 PM
Hack does not work. The data on search are not added.
AntiOnline
03-11-2002, 07:48 PM
Greetings All:
inetd, what version of vbulletin are you using? Has anyone else had problems with the recent update?
cditty
03-11-2002, 07:48 PM
I think this is because you are trying it. Try it as a normal user and see if the search is updated.
Chris
Tim Wheatley
03-11-2002, 08:04 PM
Consider it installed :D
White Knight
03-11-2002, 10:59 PM
very nice hack. and thank you much for updating it!
inetd
03-12-2002, 05:31 PM
Originally posted by AntiOnline
Greetings All:
inetd, what version of vbulletin are you using? Has anyone else had problems with the recent update? vb 2.2.3 (some files fixes to 2.2.4)
inetd
03-12-2002, 05:52 PM
In Results column, may be, take away results from Private forums.
irn-bru
03-12-2002, 06:34 PM
nice hack works well thanx
cditty
03-14-2002, 01:56 AM
I have problems with my users saying they are searching when they prob are not. Since the user id is stored in the database, is it possible to show the username of the person that searched? Make it visible only to admins and mods?
Chris
Jawelin
03-14-2002, 08:13 PM
Hi.
Could be added even the search author column only to admin eyes ? Could be similar to the ip column in online.php...
What do you think about ?
Thanks
inetd
03-14-2002, 08:46 PM
Jawelin, you are right!!!
-=dm=-
03-14-2002, 08:57 PM
Originally posted by Jawelin
Hi.
Could be added even the search author column only to admin eyes ? Could be similar to the ip column in online.php...
What do you think about ?
Thanks
that wil be cool:)
cditty
03-14-2002, 09:03 PM
That's what I was thinking. Anyone care to do it?
Chris
David Bott
03-18-2002, 06:32 PM
Must say....Very nice and installed. I love hacks that add features like this that take just minutes to install.
Thank you!
David Bott
AVS Forum
http://www.avsforum.com
David Bott
03-18-2002, 06:46 PM
ok...I do have a question....
The top ten with the the table lines between each seach that was done makes the table quite large. I like it like it is on this site without the gridlines. I know it is in this $lastsearch line of the serach.php...but what do I remove? (At least I think it is.)
Thank you again.
David Bott
AVS Forum Admin
http://www.avsforum.com
LouChipher
03-19-2002, 02:14 PM
Nice Hack, but...
Date - Query - Results
today at 16:20 - rich - 20
But when i klick on this... -> Sorry - no matches found. Please try some different terms.
Or some user find more things with their search as the admin...
The security issu is not fixed! You must go through the searchids and look for jumps! If you found a jump, go directly to the cached search and you will see what the mod/admin found...
Can somebody fix it?
Greets,
Lou
David Bott
03-19-2002, 03:22 PM
Please note it also seems to take some time to pull the last 10 serach from where it is getting it. On a large site, it takes like 5-8 seconds to pull up the serach screen now. Now it is only 10 lookups, but it seems to hurt us.
Any thoughts?
LamBras
03-21-2002, 10:20 AM
Installed on 2.2.4 and working, thanks, brilliant idea!
freakyshiat
03-21-2002, 01:15 PM
There seems to be a problem with this hack..it doesnt show last 10 searches all the time, it skips certain users....I am talkin about regular users not admins/mods.
And sometimes, it says this:
"Warning: Compilation failed: nothing to repeat at offset 19 in functions.php on line 268"
ZiRu$
03-21-2002, 04:41 PM
very nice i will install it and let you know my results
Jawelin
03-23-2002, 01:17 PM
Excuse me: what's the exact meaning of 'results' number ?
Even here on vb.org, if I click on a search with for example +1200 matches, I found many many less actual results.
Ok, here I'm not a staff member, so I couldn't have access to every post...
But on my forum where I am the Admin ???
I have numbers like +2000 results and the actual new search finds only Displaying Topics 1 to 25 of 462
????
Thanks
Admin
03-23-2002, 04:49 PM
The result number is the number of posts the search returns.
Jawelin
03-23-2002, 09:03 PM
I guessed.
But what do you think about the strange phenomenon I reported ?
You are admin here... Please, check if the reported number matches - and doesn't overcome - the actual search result clicking on the query link in list.
Thanks
Admin
03-24-2002, 11:31 AM
The result number is the number of posts + clicking the link searches for threads = your explanation. :)
Tim Wheatley
03-24-2002, 11:33 AM
If you are worried about private forums etc, and are in the same situation as me where the only forums which need the ability to search are the public ones, simply disable searching for admin and mods of the private forums, that way no private posts can be found in any hole in the scripts, because no private posts will ever be searched.
I'm personally not too bothered, the private game editing forums on my forums are all search disabled and hidden too, normal users can get NO access. But even if they could it's no biggie.
TheCaver
04-06-2002, 01:45 AM
Has the performance issue with this hack been resolved?
TIA!
JC
99SIVTEC
04-08-2002, 12:58 AM
Hmm any idea why it isn't showing anything on my site? I'm using 2.2.4 http://www.sportcompactracing.com/vbulletin/search.php
Xanthine
04-11-2002, 12:31 AM
It isnt showing for me either, Using 2.2.5. I have the table there just the posts arent appearing. Anyone know whats going on?
Xanthine
04-11-2002, 12:36 AM
Nevermind I just noticed it does not display mods/admins searches, thanks for the hack :D
akaler
04-14-2002, 12:04 PM
Thanks for the great hack.
I had some problems, too. I just installed this on my vb 2.2.5 board, and nothing was showing for me. I tried logging out, logging in as a normal user, using the vb as a guest, etc. Nothing. Then I read through all the messages carefully, and found the original $lastsearch= code. I changed
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
to the original
$lastsearches=$DB_site->query('SELECT searchid,querystring FROM search WHERE querystring!="" ORDER BY searchid desc LIMIT 0,10');
Then EVERYTHING appeared.
I then reverted it back to the new code... and bam... it continued working.
As I see a lot of the people here had the original code, then updated it to the security corrected code... I think there might be some issues for brand new installs. Something overlooked.
Also, searches by guests don't show with the security corrected code. Only ones made by normal users. Is that normal?
heh thx akaler that one was a huge tip man :-)
nice hack AntiOnline
Legacy
04-14-2002, 06:52 PM
GJ..installed on 2.2.5 not to many problems as long as you read all these threads carefully
GJ...thx
Crazy Mofo
04-15-2002, 12:47 AM
how can you make it like here so it doesnt show the black lines?
Crazy Mofo
04-15-2002, 12:47 AM
nm
Crazy Mofo
04-15-2002, 03:01 AM
actully how do you get it so theres no spaces between eace line?
e.g
https://vborg.vbsupport.ru/search.php?s=
Twig Deez
04-16-2002, 09:00 AM
working fine for me. great hack! :D
212rikanmofo
04-22-2002, 09:59 AM
this hack doesnt show up anything for me when i use
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
but it shows up when i use:
$lastsearches=$DB_site->query('SELECT searchid,querystring FROM search WHERE querystring!="" ORDER BY searchid desc LIMIT 0,10');
what gives??? and how come it doesnt display the user who ran the search like on here?
212rikanmofo
04-22-2002, 10:08 AM
i found out why it wasn't displaying... it was filtering out the usergroup id's and unfortunately everyone doesnt have the same userids for there usergroups...
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
see where it says 5,6,7? i changed it to 1 and it shows up...
how do you findout what ID each of your usergroups are?
inetd
04-22-2002, 04:37 PM
FireFly, please post version of hack in used this board. :)
akaler
04-22-2002, 09:29 PM
That'd be cool if firefly did that! Except that, for me, I'd want to remove the bit of code that displays someone's name. If I left it in, I'd feel like one of those nasty kids who pulled down other kid's pants in school. ;)
BTW... I continue to have some issues with this hack myself (as you can read above, i couldn't even get it going without taking out security modified queries, toying around, then placing the security modified queries back in) .
Even though usergroups 5, 6 and 7 are blocked exclusively, the hack still doesn't show searches by guests/not logged in folks (group 1), even though they can certainly perform searches.
And something else I just noticed is that people in group 3 -- awaiting email moderation -- their searches DO show up... but when I click on them in the last 10 list, nothing comes up! For one, it says "101 posts" next to the search, yet when I click on it and vB respond back saying "Sorry, no matches". (I've tried it logged on as both an admin and a normal registered user)
If I then do the *exact* same search again as as a normal user (group 2), then the search works, and it's entry on the last 10 list works, too... for everyone, in all groups. (as far as I can tell, anyway)
Kinda funky.
My usergroups are default.
Group 1 are Unregistered/not logged in.
Group 2 are normal Registered Users.
Group 3 are Users Awaiting Email Confirmation.
Group 4 are COPPA Users Awaiting Moderation.
Group 5 are Super Moderators.
Group 6 are Administrators.
Group 7 are Moderators.
Since my vB is so new, a lot of other things are default, too, and the code itself is relatively unhacked.
Any tips anyone?
212rikanmofo, in your vB control panel, on the left side of the screen, look for "User Groups". Under that, select "Modify". Hover your mouse over "Edit" link for each group, and in the url displayed on the status line of your browser.. at the very end, you'll something like &usergroup=7. That's the method I use to tell which usergroup is assigned to each number.
TheComputerGuy
04-23-2002, 12:52 AM
Great hack, clicked installed.
www.gunandgame.com/forums/search.php :)
Thanks so much!
Entourage
04-23-2002, 10:57 AM
cool one mate! tnx
akaler
04-23-2002, 02:10 PM
Man, this seems to be working for sooo many people without problems. Makes those of us with 'issues' wonder 'what's wrong with meeeee????' like we're infected with the 'stupid' virus or something :D
Mathiau
04-23-2002, 11:18 PM
great hack m8, installed and working fine :)
http://66.207.199.6/forums/search.php?s=
P.S - no i did not copy the blue idea form here..lol i just noticed how alike they are.., well sort of but nto really :) (it was my works old color scheme.
Webmasta XT
05-06-2002, 10:21 AM
ok this hack is great but the results it shows at the corner are not right, I mean it always shows 1 even if a member found 100 results, any ideas??
*Edit* Never Mind, I fixed it..Thnx for the hack anywayz *Edit*
patvdv
05-07-2002, 08:01 AM
Originally posted by Crazy Mofo
how can you make it like here so it doesnt show the black lines?
Change the PHP code in search.php like this:
// begin last search hack by JP
$colstart1="<td bgcolor='{ secondaltcolor }'><smallfont>";
$colstart2="<td align='center' bgcolor=' { firstaltcolor }' width=15%><smallfont>";
$colend="</smallfont></td>";
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE queryst
ring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
while ($lastsearchcount=$DB_site->fetch_array($lastsearches)):
$lastsearchdate=vbdate($dateformat,$lastsearchcoun t[dateline]);
$lastsearchtime=vbdate($timeformat,$lastsearchcoun t[dateline]);
$ourlastquery=$lastsearchcount[querystring];
$ourlastquery=bbcodeparse($ourlastquery);
$ourlastquery=censortext($ourlastquery);
$lastsearchresultscount="$lastsearchcount[postids]";
$lastsearchresultscount=explode(",",$lastsearchresultscount);
$lastsearchresultscount=sizeof($lastsearchresultsc ount);
$lastsearchmatches.="$lastsearchresultscount posts<br>";
$lastsearchkeywords.="<a href='search.php?s=&action=showresults&searchid=$lastsearchcount[searchid]&sortby=lastpost&sortorder=desce
nding'>$ourlastquery</a><br>";
$lastsearchtimestamp.="$lastsearchdate at $lastsearchtime<br>";
endwhile;
$lastsearch="<tr>".$colstart2.$lastsearchmatches.$colend.$colstart1. $lastsearchkeywords.$colend.$colstart2.$lastsearch timestamp.$co
lend."</tr>";
// end last search hack by JP
It will also use alternating colours for the columns :)
Mone'
05-30-2002, 03:15 PM
hack work perfectly !
patvdv your code is giving me error can you check your code as i'd like to have your layout :)
Mone'
Originally posted by patvdv
Change the PHP code in search.php like this:
// begin last search hack by JP
$colstart1="<td bgcolor='{ secondaltcolor }'><smallfont>";
$colstart2="<td align='center' bgcolor=' { firstaltcolor }' width=15%><smallfont>";
$colend="</smallfont></td>";
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE queryst
ring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
while ($lastsearchcount=$DB_site->fetch_array($lastsearches)):
$lastsearchdate=vbdate($dateformat,$lastsearchcoun t[dateline]);
$lastsearchtime=vbdate($timeformat,$lastsearchcoun t[dateline]);
$ourlastquery=$lastsearchcount[querystring];
$ourlastquery=bbcodeparse($ourlastquery);
$ourlastquery=censortext($ourlastquery);
$lastsearchresultscount="$lastsearchcount[postids]";
$lastsearchresultscount=explode(",",$lastsearchresultscount);
$lastsearchresultscount=sizeof($lastsearchresultsc ount);
$lastsearchmatches.="$lastsearchresultscount posts<br>";
$lastsearchkeywords.="<a href='search.php?s=&action=showresults&searchid=$lastsearchcount[searchid]&sortby=lastpost&sortorder=desce
nding'>$ourlastquery</a><br>";
$lastsearchtimestamp.="$lastsearchdate at $lastsearchtime<br>";
endwhile;
$lastsearch="<tr>".$colstart2.$lastsearchmatches.$colend.$colstart1. $lastsearchkeywords.$colend.$colstart2.$lastsearch timestamp.$co
lend."</tr>";
// end last search hack by JP
It will also use alternating colours for the columns :)
Jean147
05-30-2002, 03:31 PM
Installed succesfully!
Great Hack :thumbsup
patvdv
05-30-2002, 05:30 PM
Originally posted by Mone'
hack work perfectly !
patvdv your code is giving me error can you check your code as i'd like to have your layout :)
Mone'
Mone, it's working great for me. What erros are you getting?
Carthriller
06-01-2002, 07:18 PM
my searches are not getting listed, please help.
Do I have to do a minimum of 10 searches for the search words to appear?
JZarate
06-01-2002, 09:04 PM
great hack! thanks
Admin
06-02-2002, 02:00 PM
Carthriller: The admin/mod's searches do not appear.
pseudocode
06-04-2002, 05:09 PM
Thanks!!
David Bott
06-04-2002, 08:39 PM
Originally posted by TheCaver
Has the performance issue with this hack been resolved?
I am sorry to answer this with a NO for large sites. Not sure why, as it onmly seems to add 1 query....but it must be a big one. So...Why does it kill the server on large sites? Anyway around this?
AntiOnline
06-04-2002, 09:00 PM
Dave:
We have over 90,000 registered members, and get around 6-7 million page views / month, and we've had no performance problems from this hack.
Although, we do run the site off of a dedicated Sun Enterprise 450 =x
David Bott
06-04-2002, 09:22 PM
Thanks for the reply...
http://www.avsforum.com see 30,000 unique visitors a day and we run the site off of two Dell Poweredge 2550 server's. Each have two 1 ghz processors, 2 gigs of RAM, and are both run a 128 meg RAID 5 controller (3 - 10,000 RPM SCSI-3 drives). One server is for web, the other for DB. (another server also for ads.)
Not sure what to say...but we have over a million posts and do about 12.5 million page views a month. I do not think the user count matters as much as the posts in this case. As I write this there are 714 members on-line.
I would love to use this with our forum...but when I press the button to got into the search area...It just takes so long and server load goes up.
Anyone, anyone....Buler, Buler?
Kars10
06-05-2002, 04:21 PM
Greetings all: very easy to install and very effectiv....if it works. But i had a Problem with it.
My searchresults are displayed but the last one was on 5.6.2002 0.19 . The hack where installed on 12.00 today. I made many searches but nothing whered displayed.
what can i do, .... :confused:
Thanx for youre support.
And please excuse my bad english!! ;)
Kars10
06-05-2002, 04:52 PM
Sorry, vorget about it. It works!! Some Stupid Mistake from me... :D
Keyser S?ze
06-06-2002, 02:16 PM
how can i change it so it displays it like this results - query - date
also, can i set it to only display the last 5 not 10?
Admin
06-06-2002, 02:52 PM
Change the LIMIT 10 in the query to LIMIT 5.
Keyser S?ze
06-06-2002, 03:07 PM
Originally posted by patvdv
Mone, it's working great for me. What erros are you getting?
also getting this error Parse error: parse error in /usr/home/emusa/emusanet.com/public_html/forums/search.php on line 225
this is line 225 lend."</tr>";
Boofo
06-06-2002, 04:49 PM
Mone',
Did you ever get an answer to this question or get it figured out? I'd like to know myself. :)
Originally posted by Mone'
hack work perfectly !
patvdv your code is giving me error can you check your code as i'd like to have your layout :)
Mone'
87GTR
06-14-2002, 04:16 AM
all of my past search where showing 1 more than the result so I just added this line and now they are ok
$lastsearchresultscount=sizeof($lastsearchresultsc ount);
$lastsearchresultscount=$lastsearchresultscount-1;
Kathy
06-20-2002, 12:31 PM
This is a great help to me. Thanks!
I'm wondering about making it possible for admin to see the users on this page? (Or have a page just for admin to see the searches?)
I have an ex-moderator who has been spending hours each day searching our forums. She left under unhappy circumstances (I caught her attempting to do other things in the control panel, underhanded things...... :( ) and now I'd like to know what she is spending her days "searching".
I'd like to just turn off her ability to search. Is that possible to turn one member off from ability to search the forums? In the meantime, this hack will help me to see what she is searching for...I think!
Kathy
06-20-2002, 01:05 PM
One more question abuot this hack. If a person searches the forum by "membername" does this search show up? All I see are "keywords" and I think I might be interested in seeing (atleast for a while...) the membernames that are being searched.
Thanks!
FleaBag
06-20-2002, 02:25 PM
Installed on 2.2.6, running well. Thanks! :D
Kathy
06-21-2002, 02:26 AM
Is there anyway of having the "username" searched show up on this list? You know...not the keyword but the username (not the one who is searching but the username that is being searched).
This would really help me out for a while....
Thanks!
Roxie
06-25-2002, 08:39 PM
My searches aren't showing on the page. Hmmmm.
Admin
06-26-2002, 05:31 AM
Admins' and mods' searches do not appear.
josh929
06-28-2002, 08:15 PM
cool hack.
i modified it so that everyone's searches appear (including mods and admins).
roxie, you can do that by removing this from the hack modification:
AND usergroupid NOT IN (5,6,7)
Schorsch
07-16-2002, 04:27 AM
great modification, thank you :)
regards,
Schorsch
Destee
08-08-2002, 02:12 AM
Great Hack!
Thank You ... Clicking Installed
Destee
Derek
08-10-2002, 04:25 AM
I've installed this, but will it be possible for someone to code up the look to resemble the mods done by Chen for vB.org's last 10 searches?
FleaBag
09-03-2002, 02:59 PM
Works a treat with 2.2.7. Cheers. :D
Da`Nacho
09-03-2002, 06:19 PM
Originally posted by josh929
cool hack.
i modified it so that everyone's searches appear (including mods and admins).
roxie, you can do that by removing this from the hack modification:
AND usergroupid NOT IN (5,6,7)
You do realize that by doing this people can view your admin forums, right??? Or at least the threads from that forum returned in the results...
Keith
09-11-2002, 05:25 PM
Mine shows quantity 1 more than actual amount of results. So if it shows 3, there are always 2.
Using 87GTR's suggestion on page 6 of this thread works, but now shows 1 when there are indeed no results. So if it shows 1 result and you click on it, there could be either 1 or none. Very weird.
PHiXTiT
09-12-2002, 02:11 PM
Working great on 2.2.7!
5 Stars...
neocorteqz
09-16-2002, 02:15 AM
Nice hack, Thanks.
And i don't think you want to have Mods and admins searches shown...unless there is a way of checking user permissions in the search(if the user is an admin or mod then it shows All post by the admin or mod). IMO, a serious flaw in security.
neocorteqz
09-16-2002, 02:17 AM
Originally posted by Da`Nacho
You do realize that by doing this people can view your admin forums, right??? Or at least the threads from that forum returned in the results... I discovered that quite awhile back. Before i took over the Current forum (yes you know which one:p ;)) A mod posted a Search on a Admins post and I saw every thread in the private mods forum. with a small bit of his post.
FleaBag
10-29-2002, 08:52 PM
Working like a dream with 2.2.8. Thanks again! :)
Chris M
10-29-2002, 10:11 PM
Gamer:mad: - https://vborg.vbsupport.ru/showthread.php?s=&action=showpost&postid=316171
Satan
DrkFusion
10-29-2002, 10:13 PM
Originally posted by hellsatan
Gamer:mad: - https://vborg.vbsupport.ru/showthread.php?s=&action=showpost&postid=316171
Satan
LOL
All the posts in full releases either has working, or 2.2.8, or 2.2.7
-Arunan
Chris M
10-29-2002, 10:15 PM
Indeed...
Please stop Gamer...
Satan
FleaBag
10-29-2002, 10:24 PM
At least DrkFusion had the sense to PM me rather than posting in every thread behind me - which I'm quite unlikely to read. Fear the brain power!
You read most of the replies, so it wasn't unlikely you were going to read them :p
FleaBag
10-29-2002, 11:11 PM
I only read them because I got the PM from DrkFusion and saw how many times Satan had decided to post!
Dynamic One
11-01-2002, 07:08 PM
Thanks will try it.
Visionray
12-03-2002, 07:20 AM
Strange, its not really working for me. After I installed, one search showed up under latest searches, so I thought it was working. However, whenever I search something, it doesnt update the search list, it only shows the same one.
any ideas?
Boofo
12-03-2002, 07:36 AM
Originally posted by hellsatan
Gamer:mad: - https://vborg.vbsupport.ru/showthread.php?s=&action=showpost&postid=316171
Satan
Chris,
Installed on 2.2.9 :)
;)
Visionray
12-03-2002, 07:37 AM
Nevermind I just noticed it does not display mods/admins searches
Icheb
12-11-2002, 10:59 AM
I just made a search as admin in a private forum and then logged in as a regular user, tried to view the results of the search i just did by using the search id and it didn't show up any results. However, when i went back to the search page I could see which query has been run and how many results were returned.
Some of those security issues were apparently solved, but not every one of them as it seems.
The regular user can still see what an admin/mod was looking for and how many results were returned, although you don't see the actual results. This is not necessarily a security issue, but a privacy issue.
Let's assume the following: An admin searched for "ban AND user x", the reason why he did this is not really relevant, as this scenario is hypothetical. Now user y finds out that there was this search and that several results were returned, he tells this user x and user x makes it public.
Now what? Or am I just being paranoid?
Icheb
Squirre1
12-23-2002, 07:31 AM
Hey FireFly, you might want to check me on this one...
I looked into this because I have not been able to see any searchs that I am performing.. Based on the below quote from the MySQL manual:
If there is no matching record for the right table in the ON or USING part in a LEFT JOIN, a row with all columns set to NULL is used for the right table.
If the search was performed by a guest which has an account value of "0", it tries to do the NOT IN which it can not compare to anything because that account does not exist in the user table...
I think this should be a correct query, I have tested here and it is working with no issues:
SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND (usergroupid NOT IN (5,6,7) OR search.userid = "0") ORDER BY searchid desc LIMIT 0,10
Also, as a note to some people, I had to upgrade my search.php in order the get the links created correctly so other users could access them. Otherwise, I got a user is not authorized message.
Enjoy this info folks.... !!
Boofo
12-23-2002, 08:06 AM
Originally posted by Squirre1
Hey FireFly, you might want to check me on this one...
I looked into this because I have not been able to see any searchs that I am performing
Are you searching with a regular user account?
.. Based on the below quote from the MySQL manual:
If the search was performed by a guest which has an account value of "0", it tries to do the NOT IN which it can not compare to anything because that account does not exist in the user table...
I think this should be a correct query, I have tested here and it is working with no issues:
SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND (usergroupid NOT IN (5,6,7) OR search.userid = "0") ORDER BY searchid desc LIMIT 0,10
I guess I'm not sure why you would need to add the OR search.userid = "0" part. I'm not very good at mySQL, though. :)
Also, as a note to some people, I had to upgrade my search.php in order the get the links created correctly so other users could access them. Otherwise, I got a user is not authorized message.
Enjoy this info folks.... !!
How did you upgrade? I am running 2.2.9 and it seems to work fine here.
Squirre1
12-23-2002, 11:18 AM
When I say I had to upgrade... It was from the 2.2.6 Search.php to the 2.2.9 search.php... Also, the listings that did not get displayed were guest listing... Guests also have the option to search my forums and it was there searches that were not coming up in the last 10 searches list... BUT, registered users searches were...
Boofo
12-24-2002, 11:37 PM
I see what you mean now. Their searches don't show on the listing, but they are still able to search. I like it the way it is now, though. I also allow them to search, but not be listed in the last 15 (I set it to that). Gives them more of an incentive to register. :)
Da`Nacho
12-25-2002, 09:11 PM
Originally posted by User_001
Nice hack, Thanks.
And i don't think you want to have Mods and admins searches shown...unless there is a way of checking user permissions in the search(if the user is an admin or mod then it shows All post by the admin or mod). IMO, a serious flaw in security.
Just so everyone knows, I think this was fixed in vBulletin 2.2.8 so that permissions are checked before sending the user the search results. I've checked on my forum and search results matching threads said user doesn't have access to no longer seem to show up. As a result I have removed the 'not in 5,6,7' part of the hack on my forums and things are working peachy.
mini2
03-02-2003, 09:58 AM
Originally posted by Da`Nacho
Just so everyone knows, I think this was fixed in vBulletin 2.2.8 so that permissions are checked before sending the user the search results. I've checked on my forum and search results matching threads said user doesn't have access to no longer seem to show up. As a result I have removed the 'not in 5,6,7' part of the hack on my forums and things are working peachy.
Just installed this hack, very cool. I'm addicted to vB hacking now!
www.mini2.com/forum/search.php
Is the above (regarding the 'bug fix') correct, is it safe to remove the 'not in 5,6,7' section of the query?
Brother
03-10-2003, 07:24 AM
I use it in my version 2.3.0 and it works :)
monstergamer
03-10-2003, 04:29 PM
great hack
love it
clicks install
Sweet Cheeks
03-21-2003, 03:59 PM
06-20-02 at 05:31 AM Kathy said this in Post #91 (https://vborg.vbsupport.ru/showthread.php?postid=263603#post263603)
This is a great help to me. Thanks!
I'm wondering about making it possible for admin to see the users on this page? (Or have a page just for admin to see the searches?)
Yes I'd love this too, did anyone ever figure out how to do this? :D
Snapperhaed
03-22-2003, 03:30 AM
Nice hack! Thanks! Works fine on v2.3.3
Brooke
03-24-2003, 03:01 PM
Easily installed on 2.3 release 3. Thanks!!
Intex
03-31-2003, 11:50 AM
Installed and works fine - just make sure you set the correct usergroup ID's dependent upon who you want to list search results for, whilst taking into consideration the security implications.
* Intex clicks install :cool:.
0ptima
04-13-2003, 02:37 AM
I installed it on 2.3.0
neocorteqz
04-14-2003, 01:56 PM
12-25-02 at 07:05 PM Da`Nacho said this in Post #124 (https://vborg.vbsupport.ru/showthread.php?postid=334780#post334780)
Just so everyone knows, I think this was fixed in vBulletin 2.2.8 so that permissions are checked before sending the user the search results. I've checked on my forum and search results matching threads said user doesn't have access to no longer seem to show up. As a result I have removed the 'not in 5,6,7' part of the hack on my forums and things are working peachy.
Nice, thanks for letting us know that.
I'd also like to know if it's possible to list which user searched for what.. For admins only of course.
Doubledoom
04-30-2003, 09:28 AM
installed on 2.3.0 and removed the NOT IN part and permissions are working fine.
Thanks.
:Judge:
05-02-2003, 01:28 AM
I had trouble at first tryin to edit www/search.php
I figured out that I needed to edit www/forums/search.php so it is workin now like a charm.
I don't know if I missed something here but this does not look like the last 10 searchs here, mine is pretty big.
The last 10 takes up alot of space on the page, anyway to slim it down some?
Might help if I add a link
http://www.planetquintessa.com/forums/search.php?
OmaniMan
05-04-2003, 12:25 AM
Great :cheeky: ,,
WellDone :bandit: ,,
Wish You The Best ...
S.Shady
05-04-2003, 01:37 AM
get it working on 2.3.0 any one ?
OmaniMan
05-04-2003, 01:40 AM
Yes S.Shady,,
It works with me easily ...
S.Shady
05-07-2003, 08:47 PM
04-22-02 at 06:59 AM 212rikanmofo said this in Post #64 (https://vborg.vbsupport.ru/showthread.php?postid=243406#post243406)
this hack doesnt show up anything for me when i use
$lastsearches=$DB_site->query('SELECT searchid,postids,dateline,querystring FROM search LEFT JOIN user USING (userid) WHERE querystring!="" AND usergroupid NOT IN (5,6,7) ORDER BY searchid desc LIMIT 0,10');
but it shows up when i use:
$lastsearches=$DB_site->query('SELECT searchid,querystring FROM search WHERE querystring!="" ORDER BY searchid desc LIMIT 0,10');
what gives??? and how come it doesnt display the user who ran the search like on here?
I have the same thing here and im on vB 2.3.0. Also on my board it says the date as 12-31-1969 at 07:00 PM
screen shot of my board is in attachment.
@ OmaniMan > can you pm me what you have in your search.php that you added ?
[edit] nvm i got it to work. How? i don't know lol but its working fine. Thanks for the great hack
mmmender
05-07-2003, 11:40 PM
works great for me, thanks! 2.2.9
OmaniMan
05-07-2003, 11:46 PM
Brother S.Shady ,,,
It shows up correctly brother ,,,
Boofo
05-08-2003, 01:16 AM
Today at 04:47 PM S.Shady said this in Post #139 (https://vborg.vbsupport.ru/showthread.php?postid=392864#post392864)
I have the same thing here and im on vB 2.3.0. Also on my board it says the date as 12-31-1969 at 07:00 PM
screen shot of my board is in attachment.
@ OmaniMan > can you pm me what you have in your search.php that you added ?
[edit] nvm i got it to work. How? i don't know lol but its working fine. Thanks for the great hack
How did you fix the date problem? ;)
Oblivion Knight
05-08-2003, 02:57 PM
Installed on 2.3.0 RC3 with similar modifications that Chen made..
http://www.umbrellaonline.co.uk/forums/search.php
All seems to be working well, great hack :)
S.Shady
05-20-2003, 02:30 AM
05-07-03 at 10:16 PM Boofo said this in Post #142 (https://vborg.vbsupport.ru/showthread.php?postid=392934#post392934)
How did you fix the date problem? ;)
i dont know lol i was messing with chens fix for the admins not showing changing it back and forth and it worked for some reason
S.Shady
05-22-2003, 12:33 AM
Lmao gues what i did. I reformated my hd and had to reupload my last backup of everything before i reformated right. so upload the files and all but then my problem goes back. :(
So i took out the mod supermod and admin part and got it working. Ill mess with it to see if i can get it working again :)
gmarik
05-24-2003, 10:05 AM
A wish:
Make a DB, where the top 10 most searched names are stored of all the searches made. That would be really of some good, so admin would know, what they're users are after for.
Talisman
06-04-2003, 03:49 AM
Mine's not working quite right. When I search for something that's already been searched for (logged in as a regular member; not an admin), it does not appear on the Last 10 listing...... if say, it was searched for 20 or 30 searches ago.
The "last 10" list only shows search strings that have NEVER been searched for before.
How do we dump old searches so people can find them again?
Talisman
06-06-2003, 06:06 AM
Hello? Please help.
This is a great hack. But when we search for something that's already been searched for..... it won't show up on the "Last 10 Searches" list.
That's not how this function works here. So what's wrong with the code?
What do I do?
Thanks!!
Boofo
06-06-2003, 06:11 AM
Jump on my site and check out my search page. Play with it a bit and see if it does what you want. If it does, let me know and I can give you the modified code that I use for the hack.
Talisman
06-07-2003, 05:31 AM
Ohh, yes. That's a lovely arrangement, Boof..... except for your dreadful color scheme and that gawd-awful mouse flapping around all over the place. ;) (He's so much like our wild banana-man.)
:banana: :banana: :banana:
That would really help to see the code you're using. (Thanks!) Maybe then I could spot the problem with mine.... figure out why it won't let us list the same search twice.
I've made a few of the same changes you did at the top - mostly the way Chen set this up here. But then I gave up trying to get rid of the lines between rows. I know that's a very simple change to make..... just very annoying that I couldn't find what I was looking for.
As usual, you made some very nice changes to the basic hack. I really like what you've done with the central search section. On our search page (here (http://www.virtualcup.org/vcup/search.php?s=)), I also added the Google-Web Search hack at the bottom.
Boofo
06-07-2003, 06:03 AM
You know, attacking my mascot (the mouse) is not nice, young lady. ;) And he's not "flapping", he's dancing. His twin brother is on the vBHome Lite page (www.bearfacts2.com).
The central search section is because I added the MySQL 4 Search hack (here at vb.org). If you are running MySQL version 4 on your host server, you can run this hack, too.
I can pm you the instructions for my search setup if you want them. The part for the code without the lines is in there, too. Jump on the site and pm me if you want it, and I will get it to you.
Talisman
06-07-2003, 06:08 AM
Today at 12:03 AM Boofo said this in Post #151 (https://vborg.vbsupport.ru/showthread.php?postid=405498#post405498)
His twin brother is on the vBHome Lite page (www.bearfacts2.com).
Oh sure...... like having one freaked out rodent at the site's not weird enough, you've got to have two of them.
:p
(I'll be right over.)
Boofo
06-07-2003, 06:24 AM
You need to turn on private messaging on the site or I can't send you anything. ;)
Talisman
06-07-2003, 09:07 AM
(Hehe.... what an impatient fella, he is.)
Talisman
06-07-2003, 07:22 PM
I really appreciate your help, Boof. I guess the problem is something to do with how my database tables are set up or the way my query is running..... maybe?
When I installed the hack, I moved the columns and variables around like they did at this site ..... (it's a nicer layout). Looks like you did the same thing in the code you sent me. Only you figured out how to also get rid of the lines (which I couldn't do).
Just to be sure, though, I threw out my formatting changes and overwrote that portion of my code with yours. (Thankfully, we didn't pick up any stray hairs from that jumping rat you hang out with.) :cheeky:
Even so.... the search list indexing still doesn't work the same way at my site as it does at your site. Even when this part of our php file and our template were the same for this hack. So I guess that leaves the database as the place to check, right? Or maybe there's some other instruction further up in the search.php file that has an affect on this? (I am using an older vB 2.2.6...... but then, this hack has been out for a while, too.)
You can see how the search list is displayed in the screenshot I attached here. I put a red mark by the ones I searched for a second time. See how the date was overwritten? And these two items stayed on the list in the same position. They didn't repeat and didn't move up to the top like yours does.
And when I searched again for a keyword that's already dropped off the list ..... it didn't show up at all.
Boofo
06-07-2003, 08:34 PM
That's how it is supposed to work. That's how it works on my site. The only way it will add a new entry on the list for a word that is already on the list is if the amount of posts that has that word in it has changed. Go ahead and make a test message with one of the words on the list in it and then do another search for that word and you will see what I mean.
Talisman
06-07-2003, 08:40 PM
No, it doesn't. That's what I checked there last night.
Go look at your search list now and you'll see the keyword search for "testing" is listed three different times..... and always in the order in which it was searched.
At my site, the previous instance gets overwritten. And it won't show at all if it's something that has been on the list previously.
Talisman
06-07-2003, 08:45 PM
Hey..... I see now. Those "testing" searches did show up again because there were new posts in the result that weren't included in the earlier searches.
I just went there and picked a different keyword already on your list. No new posts have been made containing the word "mouse," (lol..... no wonder?) ..... so it didn't need a new entry. Just changed the date/time.
Boofo
06-07-2003, 08:48 PM
I just looked at it and the amount of post matches is different for each instance of "testing". When I was testing it yesterday, the only thing that was changing for a word that was already in the list, was the time was being overwritten if I searched for a word that was already on the list, which is what it should do instead of having the same word listed over and over. ;)
Boofo
06-07-2003, 08:51 PM
LOL We wrote at the same time. Is that how you wanted it to work?
Talisman
06-07-2003, 09:18 PM
Well, I don't know. I guess this means it's intentional.... and there's nothing wrong with my hack or my database.
Or..... maybe it just means your site is messed up along with mine. :cross-eyed:
But you know, if someone searches for something -- and that entry drops off the list (because 15 other searches have appeared since that one) ..... then that keyword will never appear on the list again if we don't get a new post that contains it. And no one sees what was searched for weeks ago after it's slid down this list...... even if our members keep searching for the same thing.
Wouldn't that forever kill off something that's found in a closed thread? Not very accurate, really.
So the hack really doesn't show us the last 10 (or 15) searches...... it just shows the last searches that our system hasn't already bothered with before.
Check out the "Last 10 Searches" listing here at vb.org. It doesn't do this like ours does. I had tested that once before, when I wondered about mine.
Oh, and I see someone else has just been over there doing the same thing. (Was that you?) Look at this shot ...... the same search does repeat, even when no new posts have been made.
Boofo
06-07-2003, 09:36 PM
You're right. It won't show a word again that has already been on the list. I just tested it on my site. I will get that fixed and get back to you. Should be a very simple tweak. ;)
Talisman
06-07-2003, 10:03 PM
That's great, Boofo... thanks.
Alien
06-08-2003, 10:02 PM
That would be great, Boofo! :D I'd like to see repeated keywords too, and not just have them show up once!
S.Shady
06-18-2003, 06:01 AM
any updates ?
Alien
06-21-2003, 11:49 PM
Probably just been busy. :) I'd still really like to see it updated when you're able!
Thanks again!
Talisman
06-22-2003, 12:26 AM
Yep, he must be busy. Or, maybe.......
You know, I suspect it might be a nasty case of RAT FEVER.
I've even sent notice to the Boof-dude warning him about this terrible infection ...... along with a (very wise) recommendation that he clear his premises of all rats and mice.
Can't be too careful, you know. ;)
Talis.
ogden2k
06-25-2003, 09:24 PM
Will this be re done for VB3?
Salazar
08-18-2003, 12:18 AM
Very nice... it works on 2.3.0 :)
http://www.hogwarts-forum.de/search.php ;)
* Salazar clicked install
mfacer
08-26-2003, 11:42 PM
great hack...
had to remove the 'not in 5,6,7' part from the SQL string to make the search words appear... any ideas why?
- just gonna press the install button.... now!
:-)
midnightz
08-31-2003, 02:37 PM
Hi -
can somebody help me with a modification on this hack or a heads up where to start.
I have users seraching for words I can't repeat here and others that I just dont want searching, so I am requesting this if possible...
1 - minimum posts to use search function
2 - I would like the ability to have only mods and above to view the users name that did the search, registered members and other groups would see it as it is... That will help with some spy issues I have. I would like to know this info so I can ban the persons doing these searches.
or just have mods and above be able to vierw the entire hack, no other groups will be allowed , they will only see the regular search.
Thank you very much
Bison
09-01-2003, 12:34 PM
How can you add the User who performed the search?
Salazar
09-01-2003, 03:56 PM
Today at 03:34 PM Bison said this in Post #172 (https://vborg.vbsupport.ru/showthread.php?postid=430390#post430390)
How can you add the User who performed the search?
Honestly, I think that would be a severe attack on the user's privacy.
chuckwk
09-10-2003, 10:07 PM
great hack...
had to remove the 'not in 5,6,7' part from the SQL string to make the search words appear... any ideas why?
- just gonna press the install button.... now!
:-)
THANKS!! I would have NEVER figured that out! I removed 'AND usergroupid NOT IN (5,6,7)' and it worked!
JustAskJulie
04-03-2004, 01:30 AM
ok this hack is great but the results it shows at the corner are not right, I mean it always shows 1 even if a member found 100 results, any ideas??
*Edit* Never Mind, I fixed it..Thnx for the hack anywayz *Edit*
How did you fix it?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.