News:

Wondering if this will always be free?  See why free is better.

Main Menu

[Tip/Trick] IMG BBC - Border Parameter

Started by MS Modders Team, September 18, 2010, 08:36:23 AM

Previous topic - Next topic

MS Modders Team

This simply adds an optional parameter (border) to the [img][/img] tags so that you can have images with a border in posts.

It's a quick three edits, so lets get started!



First of all, lets add the parameter...

./Sources/Subs.php
The first of which, adds the actual parameter.
Code (Find) Select

'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),

Code (Add After) Select

// SMF Modders; IMG BBC Border Parameter
'border' => array('optional' => true, 'value' => ' border="$1"', 'match' => '(\d+)'),

The second, adds the parameter to the tag, if specified.
Code (Find) Select

'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',

Code (Replace) Select

'content' => '<img src="$1" alt="{alt}"{width}{height}{border} class="resized" />',





Now that we have the IMG BBC Border Parameter set up...we need to remove SMF's default border which is defined to 0px. Without this edit, the border parameter will have no effect.

./Themes/default/css/index.css
Code (Find) Select

.bbc_img
{
border: 0;
}

Code (Replace) Select

.bbc_img
{
/* border: 0; */
}


Please move this to the Tips and Tricks board if this is something useful.

As this is a quite small adaption, we are not going to submit it to the SMF Mod Site. However, for your ease of using this Tip/Trick we have attached a Package to complete these edits. Please note that the SMF Customization Team has not approved nor reviewed the attached package and the package comes without warranty for anyone who uses it.

Also note that this has only been tested and written directly for SMF 2.0 RC2 & RC3.

The SMF Modders Team
Please do not send us PMs. If you have a question, ask in our forum.
http://smfmodders.com/index.php

MS Modders Team

Please do not send us PMs. If you have a question, ask in our forum.
http://smfmodders.com/index.php

Advertisement: