vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Plugin help (https://vborg.vbsupport.ru/showthread.php?t=288625)

ludachris 10-04-2012 04:21 AM

Plugin help
 
I have the Edit Time Limit setting turned on but have an exemption set so that not all usergroups have to deal with it. Here's the code:
Code:

if (is_member_of($vbulletin->userinfo, 5, 6, 7, 10, 11, 109))
{
    $vbulletin->options['edittimelimit'] = '0';
}

Can someone help me modify it so specific forum IDs are exempt as well?

kh99 10-04-2012 07:11 AM

You could do this:

Code:

if (is_member_of($vbulletin->userinfo, 5, 6, 7, 10, 11, 109) OR in_array($GLOBALS[forumid], array(1, 2, 3)))
{
    $vbulletin->options['edittimelimit'] = '0';
}


This will change the edit limit for everyone in forums 1, 2, and 3. If you wanted the limit changed only for certain usergroups in certain forums, then you'd change OR to AND.

ludachris 10-04-2012 01:45 PM

I get syntax errors up at the top of the page when I use that code. Maybe I should have mentioned this is for 3.8?

kh99 10-04-2012 01:49 PM

I don't think the version is the issue. But which hook are you using?

Edit: actually I think I was just missing a closing paren, which I've now added to the code above. Sorry about that.

ludachris 10-04-2012 02:35 PM

fetch_foruminfo

Should I change that?

kh99 10-04-2012 02:44 PM

I'm not sure offhand. If it's worked for you so far then it's probably OK. But just in case you missed my edit above, I think the problem was a missing closing paren.

ludachris 10-04-2012 03:49 PM

Yeah, that looked like the issue. Thanks for that, I probably could have looked closer and saw that myself. Much appreciated.


All times are GMT. The time now is 10:34 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.01179 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete