Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2009, 06:16 PM
Rastus Rastus is offline
 
Join Date: Jun 2004
Location: San Antonio, Texas
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default vbulletin search times for different user groups

I need to change the search options for different user groups and I can't seem to do it. for example for registered users I want them to be able to perform a search like every 5 minutes or so and paid members to be able to search every 30 seconds or so.

Seems I read a thread either on here or vb.org and now I can't locate it. any help is appreciated.
Reply With Quote
  #2  
Old 08-29-2009, 07:05 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just write a plugin. Something like:
PHP Code:
if (in_array($vbulletin->userinfo['usergroupid'], array(x,y)))
{
    
$vbulletin->options['optionname'] = 'a';


(Find the option name in the page source for the vboptions page.)
Reply With Quote
  #3  
Old 08-29-2009, 07:55 PM
Rastus Rastus is offline
 
Join Date: Jun 2004
Location: San Antonio, Texas
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so something like this should work?

if (in_array($vbulletin->userinfo['10'], array(x,y)))
{
$vbulletin->options['optionsform'] = '30';
}
Reply With Quote
  #4  
Old 08-29-2009, 09:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, that wouldn't work (you need to leave the variable name alone).

Actually better (I don't know why I didn't use this):
PHP Code:
if (is_member_of($vbulletin->userinfox,y)) 
Where x,y are usergroupids (or even just one usergroupid)
Reply With Quote
  #5  
Old 08-29-2009, 11:54 PM
Rastus Rastus is offline
 
Join Date: Jun 2004
Location: San Antonio, Texas
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I used this and with the hook location "search_start" and it does not seem to work. 2 is the usergroup id I want restricted to 480 seconds (4 minutes between searchs)

PHP Code:
if (is_member_of($vbulletin->userinfo2))
{
$vbulletin->options['optionsform'] = '480';

Reply With Quote
  #6  
Old 09-14-2009, 06:48 PM
Rastus Rastus is offline
 
Join Date: Jun 2004
Location: San Antonio, Texas
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Just write a plugin. Something like:
PHP Code:
if (in_array($vbulletin->userinfo['usergroupid'], array(x,y)))
{
    
$vbulletin->options['optionname'] = 'a';


(Find the option name in the page source for the vboptions page.)
I'm still fighting this... where do I find the option name. ????
Reply With Quote
  #7  
Old 09-14-2009, 06:54 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Rastus View Post
I'm still fighting this... where do I find the option name. ????
Find the option in vboptions - it's in Message Search Options > Minimum Time Between Searches. View the page source around it and the option name is right there several time (I highlighted a couple of them in red):

Code:
<tbody id="tbody_error_enablesearches" style="display:none"><tr><td class="alt1 smallfont" colspan="2"><div style="padding:4px; border:solid 1px red; background-color:white; color:black"><strong>Error</strong>:<div id="span_error_enablesearches">1</div></div></td></tr></tbody><tbody><tr valign="top">
    <td class="optiontitle" title="$vbulletin->options['searchfloodtime']" colspan="2"><div class="smallfont" style="float:right"> <a href="options.php?do=editsetting&amp;varname=searchfloodtime">[Edit]</a>  <a href="options.php?do=removesetting&amp;varname=searchfloodtime">[Delete]</a> </div><div>Minimum Time Between Searches<a name="searchfloodtime"></a></div></td>
</tr>
</tbody><tbody id="tbody_searchfloodtime">
<tr valign="top">
    <td class="alt1"><div class="smallfont"title="$vbulletin->options['searchfloodtime']">The minimum time (in seconds) that must expire before the user can perform a new search.<br />
<br />
Set this to 0 to allow users to search as frequently as they want.</div></td>
    <td class="alt1"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr valign="top"><td><div id="ctrl_setting[searchfloodtime]"><input type="text" class="bginput" name="setting[searchfloodtime]" id="it_setting[searchfloodtime]_275" value="20" size="40" dir="ltr" tabindex="1" title="name=&quot;setting[searchfloodtime]&quot;" /></div></td><td align="right" style="padding-left:4px"><a class="helplink" href="#" onclick="js_open_help('options', 'options', 'searchfloodtime'); return false;"><img src="../cpstyles/vbtech/cp_help.gif" alt="" border="0" title="Click for help on this option" /></a> </td></tr></table></td>
</tr>
</tbody>
Reply With Quote
  #8  
Old 09-14-2009, 09:26 PM
Rastus Rastus is offline
 
Join Date: Jun 2004
Location: San Antonio, Texas
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks Lynne. :up: Life is all good now
Reply With Quote
  #9  
Old 01-10-2012, 07:00 PM
ludachris ludachris is offline
 
Join Date: Feb 2002
Posts: 287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just wanted to clarify - to make this work in 3.8, would the hook location be search_start for the plugin?
Reply With Quote
  #10  
Old 01-10-2012, 07:19 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can try that and see.
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 01:28 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.04460 seconds
  • Memory Usage 2,268KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (4)bbcode_php
  • (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