vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to set a MAX character limit per forum (not per board)? (https://vborg.vbsupport.ru/showthread.php?t=290407)

bzcomputers 11-09-2012 01:49 PM

How to set a MAX character limit per forum (not per board)?
 
I have a group of forums (about 10) I would like to limit the max character limit for posting to be something less that what the other forums on the board are. Currently VB options only allows you to set a universal board setting that affects all forums.

Can this be done be inserting a conditional somewhere and adding the forums in question into an array for that conditional?

kh99 11-09-2012 02:04 PM

Quote:

Originally Posted by bzcomputers (Post 2379684)
Can this be done be inserting a conditional somewhere and adding the forums in question into an array for that conditional?

That should work. If you use a hook like global_init_setup_complete and code like this:

Code:

global $forumid, $vbulletin;
if (in_array($forumid, array(1, 2, 3))) // change 1, 2, 3 to your list of forum ids
{
    $vbulletin->options['postmaxchars'] = X; // change X to new char limit
}


bzcomputers 11-09-2012 02:19 PM

Get this error:

Quote:

Warning: in_array() expects at most 3 parameters, 10 given in [path]/global.php(37) : eval()'d code on line 2

kh99 11-09-2012 02:21 PM

Oh, yeah, sorry. I was thinking about is_member_of() which works like that. Anyway, I fixed the code above.

bzcomputers 11-09-2012 02:41 PM

Works great, thanks!


All times are GMT. The time now is 01:34 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.01143 seconds
  • Memory Usage 1,719KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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