Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2013, 05:11 PM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Adding Search Specific Forum Option

Hi,

I didn't want to bump an old thread so I thought I would create a new one.

I am trying to create a search function, similar to the one used here, where a member can search specific forums. Just like this post, I have found the forumchoice[] is not working on 4.2.0.

I have titleonly working, as it will only show me threads that have the search term(s) in their title but it will not search in a specific forum.

Here is my current code.
Code:
		<form action="search.php?{vb:raw session.sessionurl}do=process" method="post" id="footer_search" class="footer_search">
			<vb:comment><input type="hidden" name="s" value="{vb:raw session.sessionurl}" /></vb:comment>
			<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
			<input type="hidden" name="do" value="process" />

<input type="text" value="" name="query" class="textbox" tabindex="99" />
<select name="forumchoice[]">
            <option value="-1" selected="selected">All Forums</option>
            <option value="1">Forum 1</option>
            <option value="2">Forum 2</option>
            <option value="3">Forum 3</option>
            <option value="4">Forum 4</option>
            <option value="5">Forum 5</option>
          </select>
<select name="titleonly">
		<option value="0" selected="selected">All Posts</option>
		<option value="1" >Titles Only</option>
	</select>
			<input type="image" class="searchbutton" src="{vb:stylevar imgdir_button}/search<vb:if condition="$stylevar['textdirection'] == 'rtl'">_rtl</vb:if>.png" name="submit" onclick="document.getElementById('navbar_search').submit;" tabindex="100"/>

		</form>
I would love some help if anyone has any suggestions.
Reply With Quote
  #2  
Old 02-17-2013, 05:57 PM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone help me with this?
Reply With Quote
  #3  
Old 02-18-2013, 05:59 PM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Surely someone knows how I can fix this issue? I've been trying everything I can find on the forums to fix this problem.

Seems like nobody wants to help when it comes to making something that looks like or works like something here on vB.org.
Reply With Quote
  #4  
Old 03-05-2013, 09:25 AM
Black Snow Black Snow is offline
 
Join Date: Jul 2012
Location: Scotland
Posts: 471
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bah, guess I'll have to ask for help from somewhere else then.
Reply With Quote
  #5  
Old 07-28-2014, 06:43 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Having the same issue :-\ been googling for hours.. Just can't get forumchoice[]=xx or forumchoice=xx to work. Search results works fine, it refuses to use the specified Forumchoice (forum section) though. It searches forum-wide instead.
Reply With Quote
  #6  
Old 07-28-2014, 08:28 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...well, here's a list of what's being posted when I search from the search page using "single content type" of post and selecting some forums:

Code:
titleonly=0
searchuser=
starteronly=0
tag=
forumchoice%5B%5D=5
forumchoice%5B%5D=6
forumchoice%5B%5D=7
forumchoice%5B%5D=8
childforums=1
replyless=0
replylimit=
searchdate=0
beforeafter=after
sortby=dateline
order=descending
showposts=0
saveprefs=1
dosearch=Search+Now
searchthreadid=
s=
securitytoken=1406582637-cf67eb3a60e2ff5376b1527b3643f4ef0f2351cb
searchfromtype=vBForum%3APost
do=process
contenttypeid=1
So I'm guessing that the forumchoice[] fields are only used if some other option is set to a certain value (but sorry, I don't have time right now to figure out which one - maybe you can experiment).

Edit: glancing at the list, most of them are just options that I wouldn't think would affect whether or not forumchoice[] is used, so it seems like maybe you need do=process, contenttypeid=1, and/or dosearch=Search+Now.
Reply With Quote
  #7  
Old 07-28-2014, 09:06 PM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Attach a functional page of code that I can test as a PHP file (so I do not have to create it myself) and I will be glad to take a look at it.
Reply With Quote
  #8  
Old 07-29-2014, 09:44 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tbworld View Post
Attach a functional page of code that I can test as a PHP file (so I do not have to create it myself) and I will be glad to take a look at it.
I'm using a search code in a template though, for example:

Quote:
<a href="/search.php?do=finduser&userid={vb:raw post.userid}&contenttype=vBForum_Threads&showposts =0&forumchoice=35&forumchoice[]=35">test</a>
Using both forumchoice / forumchoice[] to make sure it "works", though it doesn't. Even when I use them separately.
Reply With Quote
  #9  
Old 07-29-2014, 10:16 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It does seem like forumchoice[] should work. "include" works, if what you're doing is coding a link like in your example, but it's a comma-separated list of ids so it wouldn't work with an option list (like the OP was asking about).
Reply With Quote
  #10  
Old 07-29-2014, 10:22 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So you are saying I can't get a section-search to work through a text link url search?
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 09:51 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.07144 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
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_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete