vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vbulletin search times for different user groups (https://vborg.vbsupport.ru/showthread.php?t=222052)

Rastus 08-29-2009 06:16 PM

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.

Lynne 08-29-2009 07:05 PM

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.)

Rastus 08-29-2009 07:55 PM

so something like this should work?

if (in_array($vbulletin->userinfo['10'], array(x,y)))
{
$vbulletin->options['optionsform'] = '30';
}

Lynne 08-29-2009 09:32 PM

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)

Rastus 08-29-2009 11:54 PM

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';



Rastus 09-14-2009 06:48 PM

Quote:

Originally Posted by Lynne (Post 1876514)
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. ????

Lynne 09-14-2009 06:54 PM

Quote:

Originally Posted by Rastus (Post 1884755)
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>


Rastus 09-14-2009 09:26 PM

thanks Lynne. :up: Life is all good now

ludachris 01-10-2012 07:00 PM

Just wanted to clarify - to make this work in 3.8, would the hook location be search_start for the plugin?

Lynne 01-10-2012 07:19 PM

You can try that and see.


All times are GMT. The time now is 01:15 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.01373 seconds
  • Memory Usage 1,750KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (2)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