View Single Post
  #43  
Old 04-26-2003, 08:25 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've managed to make my Search Thread hack work with this, which is great.

Very simple.

1) Install my search hack here first before installing this hack:

https://vborg.vbsupport.ru/showthrea...threadid=45142

If you've already installed my hack, that's fine. Go to next step.

2) Then, install this hack (after installing my hack first).

3) Then, find this block of code (which is from this hack) in search.php:

PHP Code:
  // check for existing query:
  
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE showposts='".intval($showposts)."' AND query='".addslashes($wheresql)."' AND postids='".addslashes($goodpostlist)."' AND querystring='".addslashes($masterquery)."'")) {
    
$DB_site->query("UPDATE search SET dateline=".time().", userid=$bbuserinfo[userid], ipaddress='".addslashes($ipaddress)."' 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) VALUES (NULL,'".addslashes($wheresql)."','".addslashes($goodpostlist)."',".time().",'".addslashes($masterquery)."','".intval($showposts)."',$bbuserinfo[userid],'".addslashes($ipaddress)."')");
                
$searchid=$DB_site->insert_id();
  } 
Replace with this:

PHP Code:
// search thread - Erwin

  
if (!$threadid) {
  
$threadid="0";
  }
    
// check for existing query:
  
if ($getsearch=$DB_site->query_first("SELECT searchid FROM search WHERE showposts='".intval($showposts)."' AND query='".addslashes($wheresql)."' AND postids='".addslashes($goodpostlist)."' AND querystring='".addslashes($masterquery)."'")) {
    
$DB_site->query("UPDATE search SET dateline=".time().", userid=$bbuserinfo[userid], ipaddress='".addslashes($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,'".addslashes($wheresql)."','".addslashes($goodpostlist)."',".time().",'".addslashes($masterquery)."','".intval($showposts)."',$bbuserinfo[userid],'".addslashes($ipaddress)."',$threadid)");
                
$searchid=$DB_site->insert_id();
  }

// search thread - Erwin 
Alternative, if you've already installed this hack first, you can install my hack after, and skip PHP steps (1) and (2) in my instructions, and instead use Step (2) above, then follow the instructions (3)-(6) in my instructions.

Thanks, my Search Thread is much faster. I notice this new search is smarter and ignores common words too.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01270 seconds
  • Memory Usage 1,807KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete