vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   Show Threads Sitewide by Prefix [Tutorial] (https://vborg.vbsupport.ru/showthread.php?t=195647)

shlomot 11-06-2008 10:00 PM

Show Threads Sitewide by Prefix [Tutorial]
 
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.

shlomot 11-07-2008 05:32 AM

Reserved for listing known bugs and issues.

Spank 11-07-2008 09:59 AM

Simple and useful. Thanks :)

Magnumutz 11-07-2008 02:44 PM

Isn't this just a template edit?
Why did you file it under products?

shlomot 11-07-2008 03:02 PM

It isn't even a template edit.

I filed it under products because:
  1. Many members are looking for this solution throughout the site;
  2. Ongoing support might be required;
  3. The use of prefixes is under-rated and the post here may increase awareness to this important feature.

Quote:

Originally Posted by Magnumutz (Post 1661221)
Isn't this just a template edit?
Why did you file it under products?


GrendelKhan{TSU 11-11-2008 08:18 AM

love it. will implement. :)

Quote:

Originally Posted by shlomot (Post 1661243)
It isn't even a template edit.


I filed it under products because:
  1. Many members are looking for this solution throughout the site;
  2. Ongoing support might be required;
  3. The use of prefixes is under-rated and the post here may increase awareness to this important feature.


agreed :)

punchbowl 11-11-2008 09:21 AM

Is it possible to hide threads of a specific prefix from a group?

e.g. MEMBERS ONLY: A thread for members only

won't show for guests?

shlomot 11-11-2008 10:09 AM

I'd love to say YES, but the answer is NO.

The prefix permissions (that can be set per prefix-set or each prefix individually) are directed at who can use that prefix in their threads, and are not about who can watch threads of a specific prefix.

Also, threads from forums that are not accessible to "non-members" won't show up in the search results.

But if you refer to filtering out of certain threads from the result-set, I'm afraid it's impossible.

I hope that vB 4 will allow permission management of prefixes for viewing also.

Quote:

Originally Posted by punchbowl (Post 1663436)
Is it possible to hide threads of a specific prefix from a group?

e.g. MEMBERS ONLY: A thread for members only

won't show for guests?


punchbowl 11-11-2008 10:19 AM

Cheers for the answer - pity!

Princeton 11-11-2008 02:01 PM

moved to Articles


All times are GMT. The time now is 01:01 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.01489 seconds
  • Memory Usage 1,736KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete