Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-24-2008, 12:24 PM
Greeksgal Greeksgal is offline
 
Join Date: Jul 2006
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Simple Search Bar?

I'd like to place a simple search bar at the top centre of one of my forums but not on my front page (i.e navbar or header) actually in one of the forums under the catagories. I've tried the code below which works but it allows search to search the entire forum, I only want it to search the forum it's placed in...any ideas?

Quote:
<if condition="$forumid == 25">
<!-- Search Box -->
<td valign="center" class="alt1"> <div style="white-space:nowrap">
<form action="http://www.**************.com/search.php" method="post">
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="process" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="showposts" value="0" />
<input type="hidden" name="quicksearch" value="1" />
<input type="text" style="width:100px;" class="bginput" name="query"/>
<input style="font: bold 10px Arial" type="submit" class="button" value="Search" /></form> </if>
<a style="text-decoration:none" href="search.php" accesskey="4" rel="nofollow" id="navbar_search"

class=""></a>&nbsp;
</div></td>
<!-- /Search Box -->
Reply With Quote
  #2  
Old 11-24-2008, 02:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add in a line like this:
HTML Code:
<input type="hidden" name="forumchoice[]" value="xx">
And what is the purpose of this line?
HTML Code:
<a style="text-decoration:none" href="search.php" accesskey="4" rel="nofollow" id="navbar_search" 

class=""></a>
Reply With Quote
  #3  
Old 11-24-2008, 09:07 PM
Greeksgal Greeksgal is offline
 
Join Date: Jul 2006
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've no idea to be honest, I just copied the code from a mod, am I free to take that bit out?

Thanks for the extra line

Also, although the code says "align center" when I add the code to my forumdisplay template the search box is way off to the left, any ideas how to get it in the middle?

Thanks
Reply With Quote
  #4  
Old 11-24-2008, 09:36 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The align center is for that one table cell which could be the left table cell so it's centered in the left table cell which is to the... left.
Reply With Quote
  #5  
Old 11-25-2008, 12:13 PM
Greeksgal Greeksgal is offline
 
Join Date: Jul 2006
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So how would I use the centre table cell? Sorry to be a pain, I know nothing about coding unfortunately. Thanks x
Reply With Quote
  #6  
Old 11-25-2008, 01:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And I know nothing about your site layout, so I can't answer that. But, you would basically take the whole <form> and put it in the table cell you want. You basically added a whole <td> for your search bar and if you copy/pasted that, then you may be causing problems in the table with that. Usually you can't just add a new column without also adding a column to the other rows or you will have improper html on your page and cause weird things to happen.
Reply With Quote
  #7  
Old 12-01-2008, 03:45 PM
behcet behcet is offline
 
Join Date: Apr 2007
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello, i have a trouble. this code search any word but when we the word has extensions, the code cannot find the word(s) and users do not know this. for example, when i wrote "windows", code finds the "windows" topics. but when i wrote "windowsxp" the code finds nothing. how must i modify the code? thnx
Reply With Quote
  #8  
Old 12-01-2008, 03:54 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If there are no posts with exactly "windowsxp" then it will return nothing. I would have thought you meant "windows xp" though (with the space). That won't work unless you allow 2 character searches. If you are using fulltext search then that means recompiling mysql to allow 2 characters searches.
Reply With Quote
  #9  
Old 12-01-2008, 04:05 PM
behcet behcet is offline
 
Join Date: Apr 2007
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry but i dont mean that. i need to give an other example. when i wrote the search bar "thunder", the code finds me the only "thunder" words. i want to see "thundercats", "thuderbirds" or "thunderXXXXX" in the search results. i think u got it. thnx again my friend.
Quote:
Originally Posted by Lynne View Post
If there are no posts with exactly "windowsxp" then it will return nothing. I would have thought you meant "windows xp" though (with the space). That won't work unless you allow 2 character searches. If you are using fulltext search then that means recompiling mysql to allow 2 characters searches.
Reply With Quote
  #10  
Old 12-01-2008, 05:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you would need to type in "thunder*" to see all posts with anything like what you said. Or even "*thunder*" to get "catsthundercats". Or, if you are using fulltext search, I think there is some option added to the usergroups in usergroup manager that gives permissions regarding searching (sorry, but I don't use fulltext search and so I don't see the option but I could swear it was there when I tested out fulltext search on my test site before.)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04460 seconds
  • Memory Usage 2,252KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete