Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin Tips & Tricks

Reply
 
Thread Tools
Show Threads Sitewide by Prefix [Tutorial]
shlomot's Avatar
shlomot
Join Date: Apr 2007
Posts: 246

 

Haifa, Israel
Show Printable Version Email this Page Subscription
shlomot shlomot is offline 11-06-2008, 10:00 PM

Numerous questions have been posted throughout vB forums on how to perform a site-wide search (or filtering) and show only those threads with a specific prefix.

The goal is to construct a link - that is used as a tab, text-link, or even in the text-rich title box of the prefix itself - that once clicked it presents threads or posts with that prefix from all the forums on the board.

Principally, this is a complex task to perform because the search for the prefixed threads or posts should consider user and forum permissions, so once user is prohibited from viewing threads in one forum - threads from that forum shouldn't be displayed in the site-wide search, etc.

Luckily, VB provides us with great advance-search capabilities, and searching for threads or posts that are assigned a specific prefix is among them.

Thus, the search string: http://www.yoursite.com/search.php?prefixchoice[]=Video should do the trick.

However, the problem is that this link only leads users to the advanced search form, with the search criteria already in place, but users still have to activate the search.

The secret lays in adding the following parameter to the search string:

do=process

From now on, if you want a search criteria to be activated without showing the visitor that search form again, just add do=process to the string.

Before: search.php?prefixchoice[]=Video

After: search.php?do=process&prefixchoice[]=Video


About Clickable Prefix
Webmasters often plan on making their prefix clickable. Good MODs have been published to this effect, but if you just want to do it yourself, place the following text (or a similar one) in the Title (Rich Text) box of the prefix:

<span><a href="search.php?do=process&prefixchoice[]=Video" style="color: red;"><b>Video</b></a></span>

This coding answers also questions about how to assign different colors to an HTML link.
Reply With Quote
  #12  
Old 07-25-2009, 04:32 PM
esperone esperone is offline
 
Join Date: Feb 2006
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks. this is very usefull.
Reply With Quote
  #13  
Old 02-18-2010, 07:33 AM
acanuck acanuck is offline
 
Join Date: Feb 2009
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This doesn't seem to work with vb4 anymore. Any idea how I can get this to work with vb4?
Reply With Quote
  #14  
Old 06-14-2011, 10:35 AM
MagicThemeParks's Avatar
MagicThemeParks MagicThemeParks is offline
 
Join Date: Sep 2009
Posts: 850
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It didn't work for me if I have multiple words in the search term. Do I have to place a particular character into the search code to show correctly?
Reply With Quote
Reply

Thread Tools

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 07:44 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.03612 seconds
  • Memory Usage 2,218KB
  • Queries Executed 20 (?)
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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (4)post_thanks_box
  • (2)post_thanks_box_bit
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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