vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Add Search/Sort/Order in thread view (https://vborg.vbsupport.ru/showthread.php?t=39947)

Recluse 06-18-2002 04:47 PM

ill give your suggestion a try after work tonight, let you know the outcome in about 12 hours

bad_madman 06-18-2002 11:53 PM

Quote:

Originally posted by Recluse
ill give your suggestion a try after work tonight, let you know the outcome in about 12 hours
https://vborg.vbsupport.ru/external/2002/06/2.gif thx !

However, take the new version 1.10 of the hack for this.

bad_madman 06-18-2002 11:58 PM

New version out: 1.10

Features/Updates
- Show message instead of a empty thread, if the sort result = 0 posts
- Now compatible with: FireFly's beta hack 'Multiple Quotes'
- Bug fixed: if you use the links 'Previous Thread' ... 'Next Thread' in thread...

Screenshots:
Screenshots in the first post.

Download:
The latest version is in the first post of this thread.

Recluse 06-19-2002 07:35 AM

ok reinstalled to the new version for the multi quote hack, this is what i get when searching

Warning: Variable passed to reset() is not an array or object in /home/cra++++/public_html/forums/showthread.php on line 749

Warning: Variable passed to each() is not an array or object in /home/cra++++/public_html/forums/showthread.php on line 750


Code:

        //highlight words for search engine
        if (isset($highlight)) {
                if ((isset($postid) and $postid==$post[postid]) or !isset($postid)) {
749         reset($replacewords);
750         while (list($key,$val)=each($replacewords)){
                        $post['message']=preg_replace("/(^| |\n|\r|\t|\]|>|\")(".$val.")(([\.,]+[ $\n\r\t])|$|\"|<|\[| |\n|\r|\t)/si", "\\1<highlight>\\2</highlight>\\3", $post['message']);
                        }
                }
        }


bad_madman 06-19-2002 10:06 AM

Strange. Which version of vB do you use? It seems to be an old version.
Replace the complete highlight-part by this code.
PHP Code:

// words to highlight from the search engine
$replacewords = array();
if (isset(
$highlight) && $highlight != '') {
  
$highlight urldecode($highlight);
  
$highlightwords=explode(" ",str_replace("/","\/",quotemeta($highlight)));
  while (list(
$key,$val)=each($highlightwords)) {
    
$val strtolower($val);
    if (
$val=='or' OR $val=='and' OR $val=='not') {
      continue;
    }
    if (
$allowwildcards) {
      
$val str_replace("\*""[a-zA-z]+"$val);
    }
    
$replacewords[$key]="$val";
  }


edit:
code changed

BigJohnson 06-19-2002 10:13 AM

I already installed the old hack can some just post what i have to change in order to have it updated? That would help alot more thanks.

bad_madman 06-19-2002 10:41 AM

Quote:

Originally posted by BigJohnson
I already installed the old hack can some just post what i have to change in order to have it updated? That would help alot more thanks.
Update from v1.00 to 1.10:
Note: Remove all blanks between { and }
for example: ="{ secondaltcolor}
-------------- ^

search in template 'showthread_adds' for:
Code:

<input type="hidden" name="threadid" value="$threadid">
and replace with:
Code:

<input type="hidden" name="threadid" value="$threadid"><input type="hidden" name="goto" value="$goto">
Add new template "showthread_adds_notfound" and copy & paste this in:
Code:

<table bgcolor="{ pagebgcolor}" width="{ tablewidth}" cellpadding="0" cellspacing="0" border="0"><tr><td width="10"><img width="10" height="1" src="{ imagesfolder}/space.gif" alt=""></td><td width="100%"><!-- spacer -->
<table cellpadding="{ tableouterborderwidth}" cellspacing="0" border="0" bgcolor="{ tablebordercolor}" { tableouterextra} width="{ contenttablewidth}" align="center"><tr><td>
<table cellpadding="4" cellspacing="{ tableinnerborderwidth}" border="0" { tableinnerextra} width="100%">
<tr>
        <td bgcolor="{ secondaltcolor}" width="100%" nowrap><br><br><p align="center"><normalfont>No posts found</b><br>Please <a href="javascript:history.back()"><b>go back</b></a></normalfont></p><br></td>
</tr>
</table>
</td></tr></table>
<!-- spacer --></td><td width="10"><img width="10" height="1" src="{ imagesfolder}/space.gif" alt=""></td></tr></table>

Search in file "showthread.php" for:
Code:

$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage$threadnavi".iif(isset($highlight), "&highlight=$highlight", ""));
and replace with:
Code:

if ($totalposts<1) eval("\$postbits=\"".gettemplate("showthread_adds_notfound")."\";");
$pagenav = getpagenav($totalposts,"showthread.php?s=$session[sessionhash]&threadid=$threadid&perpage=$perpage$threadnavi".iif(isset($highlight), "&highlight=$highlight", ""));

That's all!

Recluse 06-19-2002 04:20 PM

using 2.2.2 with a few updates for securty, ill give your codea go when i return from work

Smoothie 06-19-2002 05:38 PM

bad_madman,

Maybe its me, but I had to remove this hack. It caused my showthread page queries to go from 23 to anywhere from 50-89 queries. Anyone else see this?

bad_madman 06-19-2002 08:13 PM

This is interesting. :surprised: I will have a look at this more exactly in my forum...


All times are GMT. The time now is 11:49 AM.

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.01579 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete