Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2011, 06:41 PM
Samhayne-STS Samhayne-STS is offline
 
Join Date: May 2011
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 08-23-2011, 06:49 PM
SECTalk.com SECTalk.com is offline
 
Join Date: Feb 2009
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thanksk
Reply With Quote
  #3  
Old 08-23-2011, 07:27 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
2 благодарности(ей) от:
Glenn_E, Samhayne-STS
  #4  
Old 08-23-2011, 07:29 PM
Samhayne-STS Samhayne-STS is offline
 
Join Date: May 2011
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 08-23-2011, 07:40 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 08-23-2011, 08:22 PM
Samhayne-STS Samhayne-STS is offline
 
Join Date: May 2011
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 08-24-2011, 06:09 PM
SECTalk.com SECTalk.com is offline
 
Join Date: Feb 2009
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 08-24-2011, 07:04 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 08-24-2011, 07:05 PM
SECTalk.com SECTalk.com is offline
 
Join Date: Feb 2009
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 08-24-2011, 07:17 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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......
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:59 PM.


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.04315 seconds
  • Memory Usage 2,259KB
  • 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_php
  • (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
  • (2)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete