Version: 1.00, by Erwin
Developer Last Online: May 2013
Version: 2.3.x
Rating:
Released: 10-28-2002
Last Update: Never
Installs: 82
No support by the author.
Search Thread - by Erwin Loh
-----------------------------
This hack will add a "Search This Thread" search box at the bottom of threads (similar to the "Search This Forum" search box at the bottom of Forum Display).
Should be useful for loooooooooooooong threads, especially for a forum like this one.
Demo
-------
This hack is installed here at vB.org - just use the Search This Thread box at the bottom right hand corner of this page.
Features
-----------
1. Only posts from the thread will be searched.
2. Uses that standard searchindex table.
3. Uses the same vB search algorithms.
4. This will add NO extra queries to your forum.
5. Uses the standard search and forum permissions set by you.
Installation
------------
1. Running 1 database query
2. Making 2 changes to showthread.php
3. Making 6 changes to search.php
4. Making 1 change to template "showthread"
5. Adding a new template "showthread_searchthread"
Enjoy!
Please click install if you want updates to this hack!
Dr. Erwin Loh
I've updated the installation text file to make things clearer, and made the search box visible to guests as well.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I think that's the code for the search flood check - I only allow users on my forum to do one search every 60 seconds.
Well it's still not working. Any reason why it woluldn't be compatible?
No it's not. Seach flood check is not reliant on that piece of code - it's build into the normal unhacked search.php - that piece of code is something very strange. Are you using 2.2.8? I suggest starting from scratch with an unhacked 2.2.8 and install my hack first, then the other hacks. That piece of code may be not needed as I don't see what the point is as you are DOUBLING UP on queries.
Originally posted by Schorsch thanks Erwin for your work!
I have two questions:
1) in your manual:
But I have this "// insert query into db" 6 times in my search.php. So do I have to do the changes 6 times or just for the first ?
Just the FIRST occurence, and ignore the rest.
I've edited the installation text file to make it clear that it's the FIRST one.
Quote:
2.) I don't have the following line of code in my search.php (vB 2.2.6)
is there a possibility to install your hack with 2.2.6 ?
thanks,
Schorsch
2.2.6... mmm, I'm using 2.2.8 - My advice is to UPGRADE ASAP as 2.2.6 has huge security holes - dangerous ones.
Just download the search.php for vB 2.2.8 and use the 2.2.8 search.php on your forums while keeping the rest 2.2.6 - it should still work. I recommend upgrading the whole forum though.
I found the problem in your search.php - Geez, it was obvious.
In your search.php:
Find this:
PHP Code:
// search thread
" WHERE post.visible=1 AND $newpostsql$searchthreadquery$search[query]");
// search thread
Change it to:
PHP Code:
" WHERE post.visible=1 AND $newpostsql$searchthreadquery$search[query]");
Get rid of the //search thread bits. You CANNOT put // comments in the MIDDLE of a query!!!
Same goes for this:
PHP Code:
// search thread
$postids AND $searchthreadquery thread.threadid=post.threadid
// search thread
Change it to:
PHP Code:
$postids AND $searchthreadquery thread.threadid=post.threadid
I repeat - you CANNOT put // comments in the MIDDLE of a QUERY!!!
Look at the code - that whole paragraph is ONE line of code on separate lines - you cannot just put // comments in the middle of it. Don't go adding lines to my hack, and then blaming my hack.
You can just modify the template to suit your site. My hack will work for an unmodified template as it is. For modified templates, obviously you need to play around with the templates.
Tip: In "showthread" templates, you can move the variable "$searchthread" anywhere you like and the search box will appear.