News:

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

Main Menu

Image Align

Started by TraderJake, October 07, 2006, 09:26:28 AM

Previous topic - Next topic

MATTEK

Is this like In Line Attachments but for img bbc? If so, I'd like to see it updated for RC3 and 4. My site has a lot of reviews and ILA is filling up my attachment folder like no other.
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

MATTEK

Does anyone know of anything similar to this available for 2.0?
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

Mr. Jinx

Quote from: MATTEK on February 01, 2011, 02:20:28 AM
Is this like In Line Attachments but for img bbc? If so, I'd like to see it updated for RC3 and 4. My site has a lot of reviews and ILA is filling up my attachment folder like no other.
This is a small mod that aligns images to the left, right or center. I'm running it on RC4 without problems.

MATTEK

Quote from: Mr. Jinx on February 02, 2011, 04:06:45 PM
Quote from: MATTEK on February 01, 2011, 02:20:28 AM
Is this like In Line Attachments but for img bbc? If so, I'd like to see it updated for RC3 and 4. My site has a lot of reviews and ILA is filling up my attachment folder like no other.
This is a small mod that aligns images to the left, right or center. I'm running it on RC4 without problems.

So it's compatible with 2.0?

And does it  make the image appear within the text like a standard review?
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

MATTEK

I just tried to install it on 2.0 RC4 and it says it's incompatible.
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

Mr. Jinx

You are right. This mod hasn't been updated.
For SMF 2.0 RC4 do the following:

In \Soruces\Subs.php
FIND:


array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),


REPLACE WITH:

array(
'tag' => 'img',
'type' => 'unparsed_content',
'parameters' => array(
'alt' => array('optional' => true),
'width' => array('optional' => true, 'value' => ' width="$1"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'),
'align' => array('optional' => true, 'value' => ' align="$1"', 'match' => '(left|right|middle|top|bottom)'),
),
'content' => '<img src="$1" alt="{alt}"{width}{height}{align} class="bbc_img resized" />',
'validate' => create_function('&$tag, &$data, $disabled', '
$data = strtr($data, array(\'<br />\' => \'\'));
if (strpos($data, \'http://\') !== 0 && strpos($data, \'https://\') !== 0)
$data = \'http://\' . $data;
'),
'disabled_content' => '($1)',
),


Example:
[img align=right]image.png[/img]


Basile Sebastiano

#27
I tried with SMF 2.0 and it works well. I think this mod should be default by SMF as the alignment of the text.
thanks!
One question: How do I add tags hspace = "5" vspace = "5"
S. Basile

Advertisement: