vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   I have restricted font size in threads to size 2, but want one forum unrestricted. (https://vborg.vbsupport.ru/showthread.php?t=171455)

Allnick 02-25-2008 11:23 PM

I have restricted font size in threads to size 2, but want one forum unrestricted.
 
I asked at vbulletin.com and was told some PHP codeing would be required, and this was the best place to ask.

Basically, I have restricted the maximum font size members can use to size 2 in all my forums, via the style manager>toolbar menu options>Available size.

I need to have one foum unrestricted to allow the default of up to size 7, without having to switch editor mode.

Can anyone advise please?

shovel 02-26-2008 02:54 PM

Actually it's just a style change away really. Find the template called "editor_clientscript" (if you can't find it, do a template look-up using keyword "sizeoptions"). Within that template you'll notice you have the following...

PHP Code:

var sizeoptions = new Array($vBeditJs[size_options_array]); 

What you can replace it with is the following. Obviously you'd just put the forum id that's unrestricted rather than what I have. It should look like this...

PHP Code:

<if condition="$forumid == 4"> <!-- unrestricted forum id -->
var 
sizeoptions = new Array(1,2,3,4,5,6,7); <!-- unrestricted sizes -->
<else />
var 
sizeoptions = new Array($vBeditJs[size_options_array]); <!-- default sizes -->
</if> 


Allnick 02-26-2008 06:50 PM

Thank you, Thank you, Thank you.

That worked perfectly.:)

I am very grateful for your help.

shovel 02-26-2008 07:04 PM

Absolutely. I'm glad I could help. :)

Allnick 06-25-2009 11:26 PM

My forums have progressed slightly, and I now need to have three forums with unrestricted text size.

I've tried editing the editor_clientscript template as below....

<if condition="$forumid == x,xx,xxx"> <!-- unrestricted forum id -->
var sizeoptions = new Array(1,2,3,4,5,6,7); <!-- unrestricted sizes -->
<else />
var sizeoptions = new Array($vBeditJs[size_options_array]); <!-- default sizes -->
</if>

I get an error message on clicking "Save".......error on line 6, unexpected "," ..or words to that effect.
I assume using a comma to seperate multiple forums doesn't work.

I'm still a novice at codeing, and would appreciate help with the correct code for this.

Many Thanks.

HMBeaty 06-26-2009 12:34 AM

Try this

HTML Code:

<if condition="$forumid == 4" AND "$forumid == 5" AND "$forumid == 6"> <!-- unrestricted forum id -->
var sizeoptions = new Array(1,2,3,4,5,6,7); <!-- unrestricted sizes -->
<else />
var sizeoptions = new Array($vBeditJs[size_options_array]); <!-- default sizes -->
</if>

Not 100% sure if thats correct but its worth a shot

Allnick 06-26-2009 12:52 AM

Thanks for trying...........

Error message as follows.

The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mywebsite/www/www/vB/includes/adminfunctions_template.php(3596) : eval()'d code on line 6

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

Dismounted 06-26-2009 06:18 AM

PHP Code:

<if condition="in_array($forumid, array(4, 5, 6))"> <!-- unrestricted forum id -->
var 
sizeoptions = new Array(1,2,3,4,5,6,7); <!-- unrestricted sizes -->
<else />
var 
sizeoptions = new Array($vBeditJs[size_options_array]); <!-- default sizes -->
</if> 


HMBeaty 06-26-2009 06:37 AM

Haha, go figure. A space after the comma. I was thinking that but didn't think it would be right

Allnick 06-28-2009 07:13 PM

Many thanks Dismounted.
It works perfectly. :up:

chuckc 10-03-2009 01:54 AM

Quote:

Originally Posted by Allnick (Post 1451061)

Basically, I have restricted the maximum font size members can use to size 2 in all my forums, via the style manager>toolbar menu options>Available size.


I'm looking for a way to prevent posting in fonts larger than size 4.

The method given does not prevent larger fonts. The method below only removes larger fonts from a pull-down. One can still type in a size larger than Size 4.


How do I prevent large fonts from appearing?

chuckc 10-07-2009 03:35 PM

So... Anyone out there have a way to prevent fonts from being larger than a certain size?

Lynne 10-07-2009 04:37 PM

You could use Replacement Variables to replace <font size="7"> with <font size="2"> or whatever. (Do for font sizes 5 through 7)


All times are GMT. The time now is 05:49 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.01025 seconds
  • Memory Usage 1,748KB
  • 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_html_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)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