Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2008, 11:23 PM
Allnick Allnick is offline
 
Join Date: Feb 2006
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 02-26-2008, 02:54 PM
shovel's Avatar
shovel shovel is offline
 
Join Date: Mar 2002
Location: South Carolina, US
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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> 
Reply With Quote
  #3  
Old 02-26-2008, 06:50 PM
Allnick Allnick is offline
 
Join Date: Feb 2006
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you, Thank you, Thank you.

That worked perfectly.

I am very grateful for your help.
Reply With Quote
  #4  
Old 02-26-2008, 07:04 PM
shovel's Avatar
shovel shovel is offline
 
Join Date: Mar 2002
Location: South Carolina, US
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Absolutely. I'm glad I could help.
Reply With Quote
  #5  
Old 06-25-2009, 11:26 PM
Allnick Allnick is offline
 
Join Date: Feb 2006
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 06-26-2009, 12:34 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 06-26-2009, 12:52 AM
Allnick Allnick is offline
 
Join Date: Feb 2006
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 06-26-2009, 06:18 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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> 
Reply With Quote
  #9  
Old 06-26-2009, 06:37 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Haha, go figure. A space after the comma. I was thinking that but didn't think it would be right
Reply With Quote
  #10  
Old 06-28-2009, 07:13 PM
Allnick Allnick is offline
 
Join Date: Feb 2006
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Many thanks Dismounted.
It works perfectly. :up:
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:04 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06043 seconds
  • Memory Usage 2,257KB
  • Queries Executed 11 (?)
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_html
  • (3)bbcode_php
  • (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