Font Family Select Box

Mod BBCode Database
BBCodes that need some file editing or extra files
There is no support here! Only Read Access!
Locked
User avatar
BBCode Bot
BBCoder IV
BBCoder IV
Posts: 239
Joined: 04 Mar 2010, 15:04
Location: bbcode table

Font Family Select Box

Post by BBCode Bot »

Font Family Select Box

Author: opalelement
Description: The Font Family BBCode inserts a dropdown selectbox with several fonts to choose from
Image

Installation: Open/styles/yourstyle/template/posting_buttons.html
Find:

Code: Select all

<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
		<option value="50">{L_FONT_TINY}</option>
		<option value="85">{L_FONT_SMALL}</option>
		<option value="100" selected="selected">{L_FONT_NORMAL}</option>
		<option value="150">{L_FONT_LARGE}</option>
		<option value="200">{L_FONT_HUGE}</option>
	</select>
Add after, on a new line:

Code: Select all

<select name="addbbcodefont" onchange="bbfontstyle('[font=' + this.form.addbbcodefont.options[this.form.addbbcodefont.selectedIndex].value + ']', '[/font]');this.form.addbbcodefont.selectedIndex = 6;" title="Font style: [font=Tahoma]text[/font]">
      <option style="font-family: Tahoma;" value="Tahoma">Tahoma</option>
      <option style="font-family: Verdana;" value="Verdana">Verdana</option>
      <option style="font-family: Arial Black;" value="Arial Black">Arial Black</option>
      <option style="font-family: Comic Sans MS;" value="Comic Sans MS">Comic Sans MS</option>
      <option style="font-family: Lucida Console;" value="Lucida Console">Lucida Console</option>
      <option style="font-family: Palatino Linotype;" value="Palatino Linotype">Palatino Linotype</option>
      <option value="" selected="selected">Font Family</option>
      <option style="font-family: MS Sans Serif4;" value="MS Sans Serif4">MS Sans Serif4</option>
      <option style="font-family: System;" value="System">System</option>
      <option style="font-family: Georgia1;" value="Georgia1">Georgia1</option>
      <option style="font-family: Impact;" value="Impact">Impact</option>
      <option style="font-family: Courier;" value="Courier">Courier</option>
      <option style="font-family: Symbol;" value="Symbol">Symbol</option>
   </select>

We also need to create a BBCode
BBCode:

Code: Select all

[font={SIMPLETEXT}]{TEXT}[/font]
HTML:

Code: Select all

<span style="font-family:{SIMPLETEXT};">{TEXT}</span>
Helpline:

Code: Select all

No helpline and remember to set "Display on posting" to no
Example:

Code: Select all

[font=Tahoma]Hello world[/font]
[font=Verdana]Hello world[/font]
[font=Arial Black]Hello world[/font]
[font=Comic Sans MS]Hello world[/font]
[font=Lucida Console]Hello world[/font]
[font=Palatino Linotype]Hello world[/font]
[font=MS Sans Serif4]Hello world[/font]
[font=System]Hello world[/font]
[font=Georgia1]Hello world[/font]
[font=Impact]Hello world[/font]
[font=Courier]Hello world[/font]
[font=Wingdings]Hello world[/font]
Demo:
[font=Tahoma]Hello world[/font]
[font=Verdana]Hello world[/font]
[font=Arial Black]Hello world[/font]
[font=Comic Sans MS]Hello world[/font]
[font=Lucida Console]Hello world[/font]
[font=Palatino Linotype]Hello world[/font]
[font=MS Sans Serif4]Hello world[/font]
[font=System]Hello world[/font]
[font=Georgia1]Hello world[/font]
[font=Impact]Hello world[/font]
[font=Courier]Hello world[/font]
[font=Wingdings]Hello world[/font]
User avatar
eman80
BBCoder II
BBCoder II
Posts: 10
Joined: 12 Mar 2010, 10:14
Location: Saudi Arabia
Contact:

Re: Font Family Select Box

Post by eman80 »

Thanks for this useful BBcode :thumb:
I Love phpBB
Arkshine
BBCoder I
BBCoder I
Posts: 4
Joined: 27 Jul 2010, 00:37

Re: Font Family Select Box

Post by Arkshine »

Thanks for the bbcode. :)

I see well the dropdown select box, butthe font names are not rendered ? Any ideas why ?
Last edited by Arkshine on 28 Jul 2010, 00:50, edited 1 time in total.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Re: Font Family Select Box

Post by Stoker »

*No, but check your edits and post a link to your site
Board rules! No PM support
Arkshine
BBCoder I
BBCoder I
Posts: 4
Joined: 27 Jul 2010, 00:37

Re: Font Family Select Box

Post by Arkshine »

It's a test board on my computer (using xampp), with prosilver. My edits are correct and also it's just a copy-paste... I've changed nothing else. All is working fine, just the style in the dropdown selectbox seems to be ignored. I've searched randomly to find a solution, I've found a mod BBCodeBox where the same thing happens and the style is well specificied for each <option>. ( not installed, but seen on the demo forum )

To be sure you understand, you should see something like :
font.png
Locked