vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Last 10 Searches (https://vborg.vbsupport.ru/showthread.php?t=35840)

AntiOnline 03-06-2002 10:00 PM

Last 10 Searches
 
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.

Code:

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:
Code:

$lastsearches=$DB_site->query('SELECT searchid,querystring FROM search WHERE querystring!="" ORDER BY searchid desc LIMIT 0,10');
with this:
Code:

$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

Quote:

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=showresult...der=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). But AntiOnline has promised the same way to update and itself hack.:)

eva2000 03-10-2002 12:17 PM

Quote:

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

Quote:

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

Quote:

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


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01249 seconds
  • Memory Usage 1,809KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete