vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Making a Search Command in the Side Bar(missing security token problem) (https://vborg.vbsupport.ru/showthread.php?t=216596)

Hell Bomb 06-19-2009 10:33 PM

Making a Search Command in the Side Bar(missing security token problem)
 
i have made a pretty basic search bar and i was wondering a couple things about it

1. How do i fix the security token issue with in it.
2. How do i make it so it doesn't stretch the side bar.
3. How can i change the submit button to something i choose.

Code:

<form action="search.php?do=process" method="post" name="vbform" id="searchform" >
<input type="text" name="query" />
<input type="submit" />
</form> </div>


Lynne 06-19-2009 10:45 PM

This thread here tells you about security tokens. It should tell you the line to add to your form - Implementing CSRF Protection in modifications

Hell Bomb 06-20-2009 12:39 AM

Ok now i got the security token to work properly but it is not searching correctly can anyone take a look at the code and see what is wrong with it

Code:

<div class="sidebar_menu"><form action="search.php?do=process" method="post" name="vbform" id="searchform"\>
<input type="text" class="bginput" name="search" id="search" size="20" accesskey="u" tabindex="101" value="Search" onfocus="if (this.value == 'Search') this.value = '';" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
</form></div>


Lynne 06-20-2009 01:09 AM

Take a look at the search form in the navbar. You will need to have all the same input fields in your form as in the quick search form.

Hell Bomb 06-20-2009 02:28 AM

can anyone provide some actual code that might be of some use. Either the actual code that i need or a example code for me to base my code off of would be very appreciated.

Lynne 06-20-2009 03:30 AM

Did you look in the navbar like I suggested? This is the form in the navbar - you'll have to edit it to fit your needs:
HTML Code:

            <td class="vbmenu_option" title="nohilite">
                <form action="search.php?do=process" method="post">

                    <input type="hidden" name="do" value="process" />
                    <input type="hidden" name="quicksearch" value="1" />
                    <input type="hidden" name="childforums" value="1" />
                    <input type="hidden" name="exactname" value="1" />
                    <input type="hidden" name="s" value="$session[sessionhash]" />
                    <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                    <div><input type="text" class="bginput" name="query" size="25" tabindex="1001" /><input type="submit" class="button" value="$vbphrase[go]" tabindex="1004" /></div>
                    <div style="margin-top:$stylevar[cellpadding]px">
                        <label for="rb_nb_sp0"><input type="radio" name="showposts" value="0" id="rb_nb_sp0" tabindex="1002" checked="checked" />$vbphrase[show_threads]</label>
                        &nbsp;
                        <label for="rb_nb_sp1"><input type="radio" name="showposts" value="1" id="rb_nb_sp1" tabindex="1003" />$vbphrase[show_posts]</label>
                    </div>
                </form>
            </td>



All times are GMT. The time now is 05:50 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.01122 seconds
  • Memory Usage 1,742KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete