vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Search This Thread box (https://vborg.vbsupport.ru/showthread.php?t=223170)

Welshy2008 09-14-2009 03:04 PM

Search This Thread box
 
1 Attachment(s)
Hi All,

I am looking for a "Search this thread box" that I can physically put at the top and bottom of my forum.

The drop down menu one is getting overlooked by my users.

I am looking at putting a table? around the box and for me to be able to add some text (Title and a little write up about it) and then Place the "Search (this THREAD) box along with a 'Go' or Search button at the side of it.

I am new to it all and would be grateful if some one would tell me what code I need and where to put it please?

I would only like this on one or two selected Threads/forums - So would this be possible too please?

Many Thanks.

PS. I have attached screen shots of where I would like them positioned.

I would be happy with the standard vB table, Title in the Blue border, with a little desciption below. (Please bear in mind that I only want these to show in Select threads. Is it possible to do them based on a thread ID for example, please?

Welshy2008 09-16-2009 04:30 PM

Do you know what I mean? :)

James Birkett 09-16-2009 04:33 PM

Search threads?

What does this accomplish that Ctrl + F doesn't? :confused:

Welshy2008 09-16-2009 04:43 PM

Not all my members are familiar with short cuts like that and it would look more professional to have it as I have described. Even though there is one via the drop down menu (That always gets over looked).

--------------- Added [DATE]1253133912[/DATE] at [TIME]1253133912[/TIME] ---------------

Forgot to add that CTRL & F only searches the page that you are looking at - I need it to search the whole of a given thread. :)

Welshy2008 09-18-2009 06:17 AM

Forgot to mention that I am running vB 3.8.1 PL1

Lynne 09-18-2009 02:51 PM

Have you tried just copying the form for the Search this Thread that is currently displayed on the page? (Give the other forms a unique id, of course.)

Welshy2008 09-19-2009 11:20 AM

I haven't a clue on how to do what you suggest, Lynne.

If you have the patients and time to explain on here (So everyone can benefit) then I would be grateful.

:)


Thank You.

--------------- Added [DATE]1253363250[/DATE] at [TIME]1253363250[/TIME] ---------------

Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">
                <if condition="$show['searchthread']">$vbphrase[search_thread] - <a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]">$threadinfo[title]</a><else />$vbphrase[search_forums]</if>
        </td>
</tr>
<tr>
        <td class="panelsurround" align="center">

        <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
        <tr>
                <td align="$stylevar[left]" valign="top" width="50%">
                        <fieldset class="fieldset" style="margin:0px">
                                <legend>$vbphrase[search_by_key_word]</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td colspan="2">
                                                <div>$vbphrase[key_words]:</div>
                                                <div><input type="text" class="bginput" name="query" size="35" value="$query" style="width:250px" /></div>
                                        </td>
                                </tr>
                                <if condition="!$show['searchthread']">
                                <tr>
                                        <td>
                                                <select name="titleonly">
                                                        <option value="0" $titleonlyselected[0]>$vbphrase[search_entire_posts]</option>
                                                        <option value="1" $titleonlyselected[1]>$vbphrase[search_titles_only]</option>
                                                </select><if condition="$show['nocache']"> <label for="cb_nocache"><input type="checkbox" name="nocache" value="1" id="cb_nocache" />$vbphrase[do_not_use_cached_results]</label></if>
                                        </td>
                                </tr>
                                </if>
                                </table>
                        </fieldset>
                </td>

--------------- Added [DATE]1253363434[/DATE] at [TIME]1253363434[/TIME] ---------------

I believe that is what I need, Yes?

I would like it to search and show individual posts please. What would I need to do and where do I place this code please?

Would it be possible to add this just to search the whole thread that I need it for? To search thread ID34212 for example.

--------------- Added [DATE]1253363846[/DATE] at [TIME]1253363846[/TIME] ---------------

I have scaled it down to this:

Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">
                <if condition="$show['searchthread']">$vbphrase[search_thread] - <a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]">$threadinfo[title]</a><else />$vbphrase[search_forums]</if>
        </td>
</tr>
<tr>
        <td class="panelsurround" align="center">

        <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
        <tr>
                <td align="$stylevar[left]" valign="top" width="50%">
                        <fieldset class="fieldset" style="margin:0px">
                                <legend>Search this thread</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td colspan="2">
                                                <div>Please enter any search word, Ie: Name, Address, Post Code etc:</div>
                                                <div><input type="text" class="bginput" name="query" size="35" value="$query" style="width:250px" /></div>
                                        </td>
                                </tr>
                                <if condition="!$show['searchthread']">
                                <tr>
                                        <td>

                                                </select> </label></if>
                                        </td>
                                </tr>
                                </if>
                                </table>
                        </fieldset>
                </td>


Would this work Lynne? I can't see to actually enter the unique ThreadID of the only thread that I would like this to work on?

Is the above code correct to search a thread and show the actual posts, Please?



Many Thanks.

--------------- Added [DATE]1253365168[/DATE] at [TIME]1253365168[/TIME] ---------------

Scrap the above codes... What do you think of the following...

Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="tcat">
               
        </td>
</tr>
<tr>
        <td class="panelsurround" align="center">

        <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
        <tr>
                <td align="$stylevar[left]" valign="top" width="50%">
                        <fieldset class="fieldset" style="margin:0px">
                                <legend>Search this thread</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td colspan="2">
                                                                                <tr>
<form action="search.php?do=process&searchthreadid=5" method="post">
        <table cellpadding="4" cellspacing="1" border="0">
        <tr>
                <td class="thead">Please enter any search word, Ie: Name, Address, Post Code etc:<a name="goto_threadsearch"></a></td>
        </tr>
        <tr>
                <td class="vbmenu_option" title="nohilite">
                        <input type="hidden" name="s" value="" />
                        <input type="hidden" name="securitytoken" value="9-fe0c255" />
                        <input type="hidden" name="do" value="process" />
                        <input type="hidden" name="searchthreadid" value="5" />
                        <input type="text" class="bginput" name="query" size="25" /><input type="submit" class="button" value="Go"  /><br />
                </td>
        </tr>
        <tr>
                        </tr>
        </table>
</form>

                                        <td>

                                                </select> </label></if>
                                        </td>
                                </tr>
                                </if>
                                </table>
                        </fieldset>
                </td>


Where would I place this, just to search the threadID that I will correct, to the one that I need (The one now '5' is an example).

I need it to show on all the current pages and any future pages too. (top and bottom). Where would I place the code please?


Many Thanks.

Lynne 09-19-2009 02:21 PM

Your code is a bit different from mine. This is from my SHOWTHREAD template. This is the part you see in the top bar - it's just basic javascript to create the dropdown (in the same manner dropdowns are made in the navbar):
HTML Code:

    <if condition="$show['search']">
        <td class="vbmenu_control" id="threadsearch" nowrap="nowrap">
            <a href="$show[nojs_link]#goto_threadsearch">$vbphrase[search_this_thread]</a>
            <if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("threadsearch"); </script></if>
        </td>
    </if>

Then, near the bottom of the template is the drop down part with the form:
HTML Code:

<if condition="$show['search']">
<!-- thread search menu -->
<div class="vbmenu_popup" id="threadsearch_menu" style="display:none">
<form action="search.php?do=process&amp;searchthreadid=$threadid" method="post">
    <table cellpadding="4" cellspacing="1" border="0">
    <tr>
        <td class="thead">$vbphrase[search_this_thread]<a name="goto_threadsearch"></a></td>
    </tr>
    <tr>
        <td class="vbmenu_option" title="nohilite">
            <input type="hidden" name="s" value="$session[sessionhash]" />
            <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
            <input type="hidden" name="do" value="process" />
            <input type="hidden" name="searchthreadid" value="$threadid" />
            <input type="text" class="bginput" name="query" size="25" />$gobutton<br />
        </td>
    </tr>
    <tr>
        <td class="vbmenu_option"><a href="search.php?$session[sessionurl]searchthreadid=$threadid">$vbphrase[advanced_search]</a></td>
    </tr>
    </table>
</form>
</div>
<!-- / thread search menu -->
</if>

If you don't want the dropdown, then you can just use the form in the second code portion. You'll have to format it how you want. It looks like it doesn't have a form id you need to change, but you can't leave that div id the same - threadsearch_menu. Of course, get rid of the display:none stuff, but when you reformat it, I'm sure you will. You'll have to just play with it, I'd guess.

Welshy2008 09-19-2009 07:08 PM

Thanks Lynne.

How would I actually find the Template (If that is the correct word) of the forum that I need to add it to, And where would I need to place that code in order to have it in the correct positions as my two Attachments in my OP Please?

Many Thanks.

James Birkett 09-19-2009 07:17 PM

Admin CP -> vBulletin Options -> General Settings -> Add Template Name in HTML Comments -> Yes


All times are GMT. The time now is 06:08 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.02933 seconds
  • Memory Usage 1,808KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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