phpBB-style Font Size BBCode

Started by dougiefresh, May 25, 2013, 08:19:00 PM

Previous topic - Next topic

dougiefresh

Link to Mod



PHPBB FONT SIZE BBCODE v2.4
By Dougiefresh -> Link to Mod



Introduction
This modification adds the phpBB-style font size BBcode to the forum, where the parameter in the size bbcode is a percentage from 10% to 999% (without the percentage sign).

This code allows users to use size syntax like this:
[size=150][/size]
[size=150%][/size]


Admin Settings
There are no admin settings to this mod.  To disable, you must uninstall this mod.

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on SMF 2.1 Beta 1, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2015 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

WasdMan

Can you send a picture about what is it really?

Shambles

Nice and tidy mod :)

To be honest, though, it would look far better if the BBcode was presented with the % sign, like

[size=50%] This is half-sized text [/size]

rather than

[size=50] This is half-sized text [/size]


All in my own opinion, of course...

dougiefresh

Quote from: WasdMan on June 01, 2013, 03:56:57 PM
Can you send a picture about what is it really?
I've updated the first post with additional information about the usage of the new size syntax.  I hope this helps you.

Quote from: Shambles on June 01, 2013, 04:07:27 PM
Nice and tidy mod :)

To be honest, though, it would look far better if the BBcode was presented with the % sign, like
[size=50%] This is half-sized text [/size]
rather than
[size=50] This is half-sized text [/size]
All in my own opinion, of course...
I like the idea.  It's been implemented in version 2.0 of this mod, which has been uploaded.  Thanks!

EDIT: Both the phpBB-style and the percentage sign syntax work with this mod now....  Just wanted to clarify!  :P  Enjoy!

Shambles

Very good Dougiefresh :)

Your mod is now twice 200% the mod it first was ;)

dougiefresh

Uploaded v2.1 - December 6th, 2014
o Added code to disable creation of the validation code if BBCode is disabled.

dougiefresh

Uploaded v2.2 - January 19th, 2015
o License change to Simplified BSD.  No functionality change.

dougiefresh

Uploaded v2.3 - April 4th, 2015
o Updated for SMF 2.1 Beta 1

dougiefresh

Uploaded v2.4 - October 23rd, 2018
o No functionality change.
o Updated documentation to point to new website.

Marina3

Fatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.
How to correct this error?

Steve

@Marina3 - What version of SMF are you running?
DO NOT pm me for support!

dodos26

Quote from: Marina3 on December 10, 2022, 07:11:30 AMFatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.
How to correct this error?

Back to 7.4 php dont use php 8.

Marina3

I use SMF 2.1.4 and php 8.2.
Fatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.   

Error in this code:
'validate' => isset($disabled['size']) ? null : create_function('&$tag, &$data, $disabled', '
$data = str_replace(\'%\', \'\', $data);'
            ),

Sesquipedalian

Quote from: Marina3 on September 12, 2023, 06:06:48 AMI use SMF 2.1.4 and php 8.2.
Fatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.   

Error in this code:
'validate' => isset($disabled['size']) ? null : create_function('&$tag, &$data, $disabled', '
$data = str_replace(\'%\', \'\', $data);'
            ),

That means the mod is incompatible with PHP 8. It would need to be updated before it could work on your server.

The author of this modification has not logged in here in quite some time, so it is unlikely that he will update it himself anytime soon. However, the license does allow others to edit and redistribute copies, so you could post in the Help Wanted board to ask if anyone could update it for you.

I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Diego Andrés

@Marina3 You could test if the MOD works correctly after installing this other MOD: https://custom.simplemachines.org/index.php?mod=4300

SMF Tricks - Free & Premium Responsive Themes for SMF.

GL700Wing

I've just submitted a hooks-only SMF 2.1 version of this mod for approval.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

GL700Wing

Quote from: GL700Wing on September 12, 2023, 11:17:15 PMI've just submitted a hooks-only SMF 2.1 version of this mod for approval.
@Marina3 : The SMF 2.1 mod is now available - see phpBB Font Size BBCode for SMF 2.1.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Advertisement: