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.
That's exactly what I said. The vb search does it to. I wasn't complaining about your hack. I have it installed and use it constantly. I was giving you more of a "looks what I found out about vb's search from using your hack." And it can be duplicated here. This is where I found it.
Erwin, I'm still having trouble integrating this with the MySQL 4 search hack per your instructions. I've totally redone the hacks on a fresh search.php and I still get a parse error on the following line:
PHP Code:
$DB_site->query("UPDATE search SET dateline=".time().", userid=$bbuserinfo[userid], ipaddress='".$ipaddress)."', threadid=$threadid WHERE searchid=$getsearch[searchid]");
Today at 06:44 AM Erwin said this in Post #104 I have exactly the same line in mine, and it works. I just checked. I have no idea what the problem could be. Post 10 lines before and 10 lines after.
I'm sure it's something simple I'm just not getting through my thich head at 7AM saturday morning, lol:
PHP Code:
$wheresql.=$datesql;
}
// search thread - Erwin
if (!$threadid) {
$threadid="0";
}
// check for existing query:
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE showposts='".$showposts)."' AND query='".$wheresql)."' AND postids='".$goodpostlist)."' AND querystring='".$masterquery)."'") {
$DB_site->query("UPDATE search SET dateline=".time().", userid=$bbuserinfo[userid], ipaddress='".$ipaddress)."', threadid=$threadid WHERE searchid=$getsearch[searchid]");
$searchid=$getsearch[searchid];
} else {
// insert query into db
$DB_site->query("INSERT INTO search (searchid,query,postids,dateline,querystring,showposts,userid,ipaddress,threadid) VALUES (NULL,'".$wheresql)."','".$goodpostlist)."',".time().",'".$masterquery)."','".$showposts)."',$bbuserinfo[userid],'".$ipaddress)."',$threadid)");
$searchid=$DB_site->insert_id();
}
By the way, it's giving the parse error on the following line now:
PHP Code:
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE showposts='".$showposts)."' AND query='".$wheresql)."' AND postids='".$goodpostlist)."' AND querystring='".$masterquery)."'")) {
Today at 07:45 AM Erwin said this in Post #107 You are missing a } somewhere I'm sure. You really have to get it back to a working file, then reinstall as instructed.
I've done it three times now, each time to a fresh copy of search.php... the two hacks work seperate fine.
I wonder if it has to do with the problem some of us were having with the phantom query with the MySQL 4 search hack? *shrug*
Oh well... thanks for your help... looks like today is going to be one of those days.