View Full Version : Making a Search Command in the Side Bar(missing security token problem)
Hell Bomb
06-19-2009, 10:33 PM
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.
<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 (https://vborg.vbsupport.ru/showthread.php?t=177013)
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
<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:
<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>
<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>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.