News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Image Thumbnail

Started by ***Teh GodFather***, January 23, 2008, 11:46:48 PM

Previous topic - Next topic

***Teh GodFather***

Link to Mod



IMAGE THUMBNAIL v1.0
By Tomahawk



Introduction
Enables you use bbcode to post large images which will be preview with a link to full image using imgt bbcode

Installation
Installs automatically on Default theme and any theme without a custom Post.template.php

To manually install this modification on other themes;
- place the imgt.gif in the "Themes/{ThemeName}/images/bbc" for EVERY THEME.
- A single manual edit is required FOR EACH THEME with a custom Post.template.php

Open Themes/{themename}/Post.template.php, and FIND:

$context['bbc_tags'][] = array(
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),

ADD AFTER:

'imgt' => array('code' => 'imgt', 'before' => '[imgt]', 'after' => '[/imgt]'),


If you are still having trouble, I recommend the Modification Parser by Daniel 15

How Do I Use This Mod?
This bbcode tag is used like img tag, only this tag will not show full image, but only a preview.


[imgt]url_to_image[/imgt]


Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Changelog
1.0
o Initial release

Sectomy

great work !

is it possible to make an Pop Up box for adding the Url ? like the "image Pop Up" mod ?


greets

secy

***Teh GodFather***

I will try to add it to next version of mod, but I'm a bit busy right now...

myaicons

is there a screenshot or demo of this mod ?
i scratch your back you scratch my back...
funny thing about my back is its located on my...

slackerpunk

will this add the bbcode button automatically or do you have to manually input [imgt][/imgt]

Sectomy

theres a bbcode button (the big "T") and it adds the tag to your editor field....

***Teh GodFather***

It adds button on default theme, but you have to add it manually to other themes, check the readme file...

goldenboy48

The resized image looks very weird...Its not properly scaled...

***Teh GodFather***

It depends on source image...

goldenboy48

Quote from: ***Teh GodFather*** on February 07, 2008, 09:24:21 AM
It depends on source image...

The source image is a perfect high quality image.

http://www.cricinfo.com/db/PICTURES/CMS/86300/86338.jpg

I think it resizes the image to a perfect square...Please make it do like 30% of the original image or sth. :D

***Teh GodFather***

It resizes it to 100x90 px... I will try to add it to the next version, but I'm not so good with php...

goldenboy48

Quote from: ***Teh GodFather*** on February 08, 2008, 02:15:25 PM
It resizes it to 100x90 px... I will try to add it to the next version, but I'm not so good with php...

Oh ok! If you could take out the next version fast, that would be very appreciated. Take the help of the tech guys on this forum for the next version ;) :D

goldenboy48

#12
Ok, I edited your mod to resize the height and width to 25%.

But I would like to wrap text around those images [I already have float mod] but I don't know how make it work?

Any help Tom or others?

Edit Got it! End result - http://ecric.net/smftest under "Recent Article"

Tom, If you would like me to share the edited mod package with you, please tell me. I'll give it you. :D

Btw, does anyone know how to use GD technology with this mod so that resized images are of good quality.

Thanks

goldenboy48

Btw, does anyone know how to use GD technology with this mod so that resized images are of good quality.

Any PHP pros know how to do this?

4b11l

Hello,

I just want to say that I absolutely love this mod along with karl's lightbox mod.

I was wandering if there is a way to automatically turn [img] tags into this tag, [imgt]. I've went and disabled the [img] tag completely and if someone was to manually post an [img] tag, is there a way to automatically turn it into your [imgt] tag? Thanks.

***Teh GodFather***

Well, you could just edit it directly in file Subs.php, find where [img] tag is and replace it with [imgt] and then just remove "t"...

4b11l

I tried that but all current [img] tags now look like ( ) with the image link inside. :-\

***Teh GodFather***

It is very simple... Justi find this in 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} border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),
array(
'tag' => 'img',
'type' => 'unparsed_content',
'content' => '<img src="$1" alt="" border="0" />',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
'disabled_content' => '($1)',
),


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


with
'width' => array('optional' => true, 'value' => ' width="{your width}"', 'match' => '(\d+)'),
'height' => array('optional' => true, 'value' => ' height="{your height}"', 'match' => '(\d+)'),

lvzifer

is this modification to make thumbnail bigger ? it's to small ?? if not how could I do that ?

4b11l

Thanks Teh Godfather, that worked perfectly.

Quote from: PanesarV on February 09, 2008, 07:03:43 PM

Edit Got it! End result - http://ecric.net/smftest under "Recent Article"


Bro, I am trying to figure this out too. Would you be able to help me out on the resize keeping the aspect ratio. Thanks.

Advertisement: