Help with custom bbcode related to text size

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
MustardCat
Registered User
Posts: 1
Joined: Fri Aug 18, 2017 11:45 pm

Help with custom bbcode related to text size

Post by MustardCat »

Currently I'm using bbcode for text size that matches what is currently used on this board, such as:

size 50 = tiny
size 85 = small
size 100 = normal
size 150 = large
size 200 = huge


But I need to add support for bbcode that is to be copied over from a vbulletin board. Users will be manually copying posts that contain bbcode for size that looks like this:

Code: Select all

[size="6"]Some text[/size]
The size can range 1 - 7, 7 being the largest. Obviously this makes the text microscopic when used with phpBB. (It does still work with those quotes in there.)


I don't know php but I do know a little c++ so I need help on how exactly to code this. Here is an example in pseudocode of what I want to do:

if size = 1
set font-size to 50%

if size = 2
set font-size to 100%

if size = 3
set font-size to 120%

if size = 4
set font-size to 140%

if size = 5
set font-size to 160%

if size = 6
set font-size to 180%

if size = 7
set font-size to 200%

I would like this to function in addition to (not replace) the default bbcode for size, since I don't want people formatting future posts using the old sizes. I'm essentially trying to add backwards compatibility that bumps those smaller sizes from vbulletin into readable text.

I've looked through bbcode.php a bit but I'm lost, I need some help from someone who knows what they are doing. Thank you.
Post Reply

Return to “phpBB Custom Coding”