Editing default IMG bbcode

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
User avatar
Kami-sama
Registered User
Posts: 137
Joined: Sat May 26, 2018 3:07 pm

Editing default IMG bbcode

Post by Kami-sama »

Hello everyone!

I've noticed that people usually create separate IMG tag, to have an option uploading image with size.
Well I prefer making the default tag work correctly. Sooo... this was the easy part making adjustments in bbcode.php:

Line 475:

Code: Select all

'img'		=> '<img src="$1" style="width:$2px; height:$3px;" class="postimage" alt="' . $user->lang['IMAGE'] . '" />',
Line 534:

Code: Select all

'img'					=> array('{URL}'		=> '$1', '{NUMBER1}'		=> '$2', '{NUMBER2}'=> '$3'),

I am having trouble adjusting this line 271:

Code: Select all

'#\[img:$uid\](.*?)\[/img:$uid\]#s'		=> $this->bbcode_tpl('img', $bbcode_id),

How should I specify two optional numbers there?
Something like: [img=([\-\+]?\d+):$uid\] ?
Post Reply

Return to “phpBB Custom Coding”