vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Custom search parameters to create "What's New" for specific sub forums (https://vborg.vbsupport.ru/showthread.php?t=269017)

Samhayne-STS 08-23-2011 06:41 PM

Custom search parameters to create "What's New" for specific sub forums
 
Hello vBulletin users :)

Our forum is located at http://www.spacetimestudios.com/forum.php As you may notice, we have 3 main areas to our forums: Pocket Legends, Star Legends and Spacetime Studios

Many of our users rely on the "What's New" button to find active discussion. We often receive requests to have a "What's New" search that's specific to each different area. I'd like to change the "What's New" button to be a drop down where you can choose to see what's new on all forums or specific to sub forum.

I see that the What's New button passes in parameters via the URL: http://www.spacetimestudios.com/sear...p=vBForum_Post

Does anyone know if it is possible to pass in parameters to create a search of new posts specific by sub forum, namely for each different area: Pocket Legends, Star Legends and Spacetime Studios.

Thank you in advance for your input!

SECTalk.com 08-23-2011 06:49 PM

I would like the same information. What other parameters can we use? What about thread prefixes or tags?

Thanksk

kh99 08-23-2011 07:27 PM

You can add '&include=1,2,3' to list the forums you want to include in the output. It looks like you need to list each sub forum as well.

Based on a quick look at the code (and not trying these at all), it looks like the possible parameters (when do=getnew) are: 'days', 'exclude', 'include', 'showposts', 'oldmethod', 'sortby', and 'noannounce'.

I know 'include' and 'exclude' are a comma separated list of forum ids.

The possible values for 'sortby' are: 'title', 'views', 'replycount', 'postusername', 'forum', and 'threadstart'.

I assume 'days' is the number of says to include, and 'showposts' is a boolean that shows posts instead of threads. I don't know what the other ones are.

Samhayne-STS 08-23-2011 07:29 PM

Awesome, thanks for digging into the code for me! I'll play with it and see what I can put together to make the searches I'm looking for.

kh99 08-23-2011 07:40 PM

I was thinking, there's a hook location search_before_process, you could probably write a plugin that would let you create your own parameters, for instance if $_REQUEST['section']== 'pocket_legends' then set $_REQUEST['include'] to a list of forums. You might even be able to automatically generate the list of child forums.

Samhayne-STS 08-23-2011 08:22 PM

Hmm, I see what you're saying, but I'm a community guy by trade. I only play a forum hacker on TV ;)

--------------- Added [DATE]1314135049[/DATE] at [TIME]1314135049[/TIME] ---------------

Yup, so this works for our Pocket Legends section:

Code:

http://www.spacetimestudios.com/search.php?do=getnew&contenttyp=vBForum_Post&include=4,5,6,8,9,10,11,12,13,14,15,16,20,23,25,26,32,35,36
I just put in the numbers of each sub forum. Kind of a pain if you want to add or delete sub forums.

SECTalk.com 08-24-2011 06:09 PM

So any possibility of narrowing a search by prefix? It is included on the search form I just don't know what variable to use in the URL.

It was possible in 3.8.

kh99 08-24-2011 07:04 PM

When you're doing a search with do=getnew or do=getdaily, it doesn't use the tag parameter. You could change that by editing search.php.

Find this (around line 481):
PHP Code:

//set critieria and sort
set_newitem_forums($criteria);
set_newitem_date($criteria$current_user$_REQUEST['do']);
set_getnew_sort($criteria$vbulletin->GPC['sortby']);

//check for any errors
$errors $criteria->get_errors(); 


and add some code like this:
PHP Code:

//set critieria and sort
set_newitem_forums($criteria);
set_newitem_date($criteria$current_user$_REQUEST['do']);
set_getnew_sort($criteria$vbulletin->GPC['sortby']);

if (
$vbulletin->options['threadtagging'] && $vbulletin->GPC['tag'])
    
$criteria->add_tag_filter(htmlspecialchars($vbulletin->GPC['tag']));

//check for any errors
$errors $criteria->get_errors(); 


There may be a way to do the same thing just by building a url with the right parameters (instead of using do=getnew and editing the code), but I'm not sure.

SECTalk.com 08-24-2011 07:05 PM

In 3.8, there was a do= parameter that you could use to process searches and it was simply do=process. I've tried that in conjunction with prefix, prefixid even using brackets after both and nothing has worked thus far.

I'll play with that code. If anyone has a simpler solution, please let us know.

kh99 08-24-2011 07:17 PM

Oh...doh! For some reason I read 'prefix' and thought 'tag'. I'll look again and see if there's anything for prefix.

--------------- Added [DATE]1314218439[/DATE] at [TIME]1314218439[/TIME] ---------------

OK, if you're using do=process then I think you want prefixchoice[], as in:

Code:

search.php?do=process&prefixchoice[]=foo&prfixchoice[]=bar......


All times are GMT. The time now is 05:01 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.01206 seconds
  • Memory Usage 1,746KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_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