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)

Velocd 06-21-2002 03:26 AM

My search is bugged then, it doesn't highlight nor find :(

Attached is a picture, incase anybody is wondering, of what this hack looks like (except it doesn't come with my template modifications ;))

Velocd 06-21-2002 03:40 AM

Sorry for the double post, though it does work! I just rechecked it and the search words are in red. This hack is totally awesome bad_badman, and should be a definate nomination for hack of the month. If it were implemented on these forums it would make searching within huge threads so much easier! We just need FireFly to look at this...

BigJohnson 06-21-2002 09:14 AM

Well i am getting a problem. I upgraded not doing the first post ove rbut just adding and editing the post that i asked for. Just to add what i need to update. i don't no if you told me the wrong thing to update but i did a test on my forums. In one post i have several posts with the word STUFF in it and i searched that word and then i get only one highlighted word stuff. Thats it. All the other words are not highlighted at all. Plus if i search for a word not in the post it wont give me that error message that the update is all about.

BigJohnson 06-21-2002 09:17 AM

ok never mind it works. But it is wierd. It doesnt show the word stuff in the last post. i dont no why it is doing that but that is the only word it does it for. Wierd. Also i am still not getting any error screen. What is wrong witht that?

And also one of my templates is red so that is a problem. Is there any way we can use a replacement variable for this hack? So i can then change the replace ment variable for the HIGHLIGHTED word colors? That owuld be great because every style on my boar dhas its on replacement variable.

Boofo 06-21-2002 09:22 AM

I am getting 2 black boxes (1 on either side of the not found window when it displays). Has anyone else run into this problem?

BigJohnson 06-21-2002 09:24 AM

I dont get the error screen at all. It is wierd. i just geta refreshed page.

Boofo 06-21-2002 09:24 AM

It also will only refesh the page if it doesn't find the word it is looking for. Is there a way to have it tell you that it can't find the word you are looking for?

Quote:

Originally posted by Smoothie
It does however highlight the word in red.

BigJohnson 06-21-2002 09:29 AM

Well that was the whole point of the new updated version in. read throught the thread it is on page 3. There is no error screen and there is suppose to be one.

bad_madman 06-21-2002 12:14 PM

Quote:

Originally posted by Boofo
I am getting 2 black boxes (1 on either side of the not found window when it displays). Has anyone else run into this problem?
Your original postbit template is very changed. You also have an unusual but nice design :) You must adapt the template showthread_adds_notfound to your postbit template. You then don't get the black boxes any more.

bad_madman 06-21-2002 04:55 PM

Quote:

Originally posted by BigJohnson
...Also i am still not getting any error screen. What is wrong witht that?...
The error screen only comes, if this sort result (not the search result!!) doesn't give any posts back.
Quote:

Originally posted by BigJohnson
...And also one of my templates is red so that is a problem. Is there any way we can use a replacement variable for this hack? So i can then change the replace ment variable for the HIGHLIGHTED word colors? That owuld be great because every style on my boar dhas its on replacement variable....
This is a little more complicated. I have a fast solution here. This also more simply works certainly... :rolleyes:

- Make your replacements:
</myhighlight> is replaced by </font></i></b>
<myhighlight is replaced by <b><i><font color="red"

- Search in showthread.php for:
if (isset($highlight) and $highlight!="search") {$src[string]="$highlight";}

- and replace with:
if (isset($highlight)) {$src[string]="$highlight"; $myhighlight=1;}

- Search in admin/functions.php for:
PHP Code:

    //highlight words for search engine
    
if (isset($highlight) && $highlight != '') {
        if ((isset(
$postid) and $postid==$post[postid]) or !isset($postid)) {
            
reset($replacewords);
            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']);
            }
        }
    } 

and replace with:
Code:

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

That's all ??!


All times are GMT. The time now is 11:21 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.01316 seconds
  • Memory Usage 1,750KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)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