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 got your PM of your search.php - You've got whole chunks of code that I don't what is there for in that file!
I've added the threadid bit to one of these chunks of code.
To be honest, your search.php is very messy, with repeated queries.
What is this?
PHP Code:
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE query='".addslashes($wheresql)."'")) {
$searchid=$getsearch[searchid];
} else {
// get last search for this user and check floodcheck
if ($prevsearch=$DB_site->query_first("SELECT searchid,dateline FROM search WHERE ".iif($bbuserinfo[userid]==0,"ipaddress='".addslashes($ipaddress)."'","userid=$bbuserinfo[userid]")." ORDER BY dateline DESC LIMIT 1")) {
if (time()-$prevsearch[dateline]<$searchfloodcheck and $searchfloodcheck!=0) { // and !ismoderator()) {
eval("standarderror(\"".gettemplate("error_searchfloodcheck")."\");");
exit;
}
}
// insert query into db
$DB_site->query("INSERT INTO search (searchid,query,dateline,querystring,showposts,userid,ipaddress,threadid) VALUES (NULL,'".addslashes($wheresql)."',".time().",'".addslashes($query)."',0,$bbuserinfo[userid],'".addslashes($ipaddress)."',$threadid)");
$searchid=$DB_site->insert_id();
}
eval("standardredirect(\"".gettemplate("redirect_search")."\",\"search.php?s=$session[sessionhash]&action=showresults&getnew=true&searchid=$searchid\");");
}
It's not part of the normal search.php - anyway, I've added the threadid bits to this code (as you can see). This may make your search work.
If it still doesn't work, I cannot help you. My hack may not compatible with al these extra hacks you have in your search.php
I know definitely that this hack works with an unhacked search.php, and should work with the "Last 10 Searches" hack. But some other hacks may interfere with it, or may need to be modified for this to work.
The same goes for people having problems with this hack - uninstall your other hacks, or use an UNHACKED search.php and install it and see if it works.
This hack is working fine on my forums with 5000 members with 200 on at once, and my members love it. If this hack works for you, or if you know it is compatible with another search hack, please post here and let me know. Thanks.