Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Search Thread Details »»
Search Thread
Version: 1.00, by Erwin Erwin is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

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.

Comments
  #22  
Old 10-29-2002, 08:16 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@ X-Fan:

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.
Reply With Quote
  #23  
Old 10-29-2002, 08:24 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #24  
Old 10-29-2002, 10:27 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit: I sorted it - Confliction with another hack

Satan
Reply With Quote
  #25  
Old 10-29-2002, 11:05 AM
X-Fan's Avatar
X-Fan X-Fan is offline
 
Join Date: Jan 2002
Location: Adelaide, Australia
Posts: 496
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Erwin
What is this?
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.

Quote:
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
Well it's still not working. Any reason why it woluldn't be compatible?
Reply With Quote
  #26  
Old 10-29-2002, 12:34 PM
Schorsch's Avatar
Schorsch Schorsch is offline
 
Join Date: Jul 2002
Location: Germany
Posts: 345
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks Erwin for your work!

I have two questions:

1) in your manual:

Quote:
In search.php

1. Find:

************************************************** ***********

// insert query into db

************************************************** ***********

ABOVE, ADD:

************************************************** ***********

// search thread - Erwin
if (!$threadid) {
$threadid="0";
}
// search thread - Erwin

************************************************** ***********
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 ?

2.) I don't have the following line of code in my search.php (vB 2.2.6)

Quote:

5. Find:

************************************************** ***********

post.visible=1 AND thread.visible=1 AND $newpostsql $search[query]

************************************************** ***********
is there a possibility to install your hack with 2.2.6 ?

thanks,
Schorsch
Reply With Quote
  #27  
Old 10-29-2002, 12:43 PM
zertox zertox is offline
 
Join Date: Oct 2002
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was just going to post a request for this hack, (for on this forum) cuz I hate going trough 100 pages searching for my error
Reply With Quote
  #28  
Old 10-29-2002, 12:48 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

6 Times?

I only have it 4 times...

And yes - Do I have to do it to the first one or all of them?

Satan
Reply With Quote
  #29  
Old 10-29-2002, 12:51 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok...Looking at it, I think you just need to do it for the first occurance

Satan
Reply With Quote
  #30  
Old 10-29-2002, 01:06 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice hack collegue

truely needed.
Reply With Quote
  #31  
Old 10-29-2002, 03:24 PM
N9ne N9ne is offline
 
Join Date: Feb 2002
Posts: 1,495
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed this hack, on my unhacked 2.2.8, and it doesn't............




























Have any bugs

Thanks for this hack, works perfectly
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:50 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.05281 seconds
  • Memory Usage 2,320KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete