News:

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

Main Menu

Image Thumb Tag

Started by TGB, May 31, 2008, 09:13:34 PM

Previous topic - Next topic

TGB

Link to Mod

Image Thumb Tag 1.3 - TGB



Intro
Uses javascript to allow you a clickable thumbnail preview, click the thumbnail and you will see the large image explode before your eyes.

Install
This should (most of the time) Install automatically on the default theme and will work on any others without their own Post.template.php

Manually installing on your theme:

  • Place the thumb.gif in the "Themes/*theme*/images/bbc/" for all themes you want to use this with.
  • A single manual edit is required for all themes with their own Post.template.php

Open Themes/*theme*/Post.template.php, and FIND:
$context['bbc_tags'][] = array(
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),

ADD AFTER:

'thumb' => array('code' => 'thumb', 'before' => '[thumb]', 'after' => '[/thumb]', 'description' => $txt['thumb']),


Usage
This bbcode tag is used just as if it were the img tag, only it will be way cooler  :P.


[thumb]http://yoursite.cOm/image.png[/thumb]


Support
Check in this mods thread, do not pm me you will be ignored.

Changelog
1.3

  • Updated to work with SMF 2.0, yay
1.2

  • fixed the description error
1.1

  • alt attribute added, required by XHTML specification
  • strings are now in the language files
1.0

  • nothin here yet  8)

DEMO:  http://dchaven.com/forum/index.php?topic=15748
www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

jossanaijr


dimdom

Quote8: Undefined index: description
File: /home/---/---/---/Themes/default/languages/Post.english.php (eval?)
Line: 1031

After installing this mod, every time someone opens the post form, 3 errors like the above occurs.

There is no such line in the php file, of cource...

Any help?

***Teh GodFather***

Nice one mate... I'm glad i gave idea to someone...

jenggo

#4
Quote from: dimdom on June 04, 2008, 03:02:54 PM
Quote8: Undefined index: description
File: /home/---/---/---/Themes/default/languages/Post.english.php (eval?)
Line: 1031

After installing this mod, every time someone opens the post form, 3 errors like the above occurs.

There is no such line in the php file, of cource...

Any help?

Same with me..
Anyone know how to fix it?

Edited :

I found it..
On Post.template.php, add 'description' => $txt['thumb_tag']),
should look like this :

'thumb' => array('code' => 'thumb', 'before' => '[thumb]', 'after' => '[/thumb]', 'description' => $txt['thumb_tag']),
hxxp:forum.trupala.org [nonactive]

Babalui

Hi,
This mod works fine on my forum, after plain install procedure. Many thanks!

Just two questions:
1. I would like that pics are opened in a new window
2. How can I increase the size of thumbnail?

Cheers!

msvdm

Do you think to update the mod to work with SMF 2+ ?

quatermass

Can we get to see a demo of this working?

The demo link provide is broken.   :D



58tbird

Quote from: jenggo on June 14, 2008, 06:55:06 AM
Quote from: dimdom on June 04, 2008, 03:02:54 PM
Quote8: Undefined index: description
File: /home/---/---/---/Themes/default/languages/Post.english.php (eval?)
Line: 1031

After installing this mod, every time someone opens the post form, 3 errors like the above occurs.

There is no such line in the php file, of cource...

Any help?

Same with me..
Anyone know how to fix it?

Edited :

I found it..
On Post.template.php, add 'description' => $txt['thumb_tag']),
should look like this :

'thumb' => array('code' => 'thumb', 'before' => '[thumb]', 'after' => '[/thumb]', 'description' => $txt['thumb_tag']),


See the following threads:
http://www.simplemachines.org/community/index.php?topic=249676.msg1619715#msg1619715
and the solution: http://www.simplemachines.org/community/index.php?topic=249853.msg1621812#msg1621812

senyorito

The $txt['thumb_tag'] is already in use.  I suggest a different txt code to be used.  Remember that this particular description eval error in Post.english.php is referring to the description of the thumb.gif image in the post form when you hover the thumb image.  It is a tooltip that describes the button image.

To fix this error:

Themes/default/Post.template.php

FIND:

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


REPLACE WITH:

'thumb' => array('code' => 'thumb', 'before' => '[thumb]', 'after' => '[/thumb]', 'description' => $txt['thumb']),


Ok.  Now, you've added the description $txt['thumb'], which description is not in used.  The next thing that you have to do is to put the desired text for that code.

Themes/default/languages/Post.english.php

FIND:

?>


ADD BEFORE:


// Image Thumb Tag
$txt['thumb'] = 'Insert Thumbnail';



There you go.

Good luck!

4Kstore

nice works !!!

thanks (!)

¡¡NEW MOD: Sparkles User Names!!!

TGB

sorry for the delay, i've updated the mod.  ;)
www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

TGB

Updated to work with 2.0 RC5   Enjoy!
www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

waruna

Sorry to ask, why I can't see the 'Link to Mod' link?
Trust of Lust

TGB

www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

Inti31

Nice work! I implemented it into my testforum (RC5) - runs fine - just modified the language of that installer...

hxxp://aida32-inventory.netboom.de/smf/index.php?topic=1.msg1#msg1

one thing: How do I set the thumb-size - I would like to have the thumb a little bit bigger...?

Thx Inti31

my forum
my testforum


my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

TGB

in subs.php find:<img width="100" src="$1" style="cursor:pointer" title="' . $txt['thumb_tag'] . '" alt="' . $txt['thumb_tag'] . '" onclick="javascript:if (this.width == 100) this.removeAttribute(\'width\'); else this.width=100;" />',
play around with the width value, it is initially set at 100. 

if you would like to submit any translations I will include them in the mod with credits.
www.dreamcasthaven.com <----- Running SMF 1.1.16 & heavily modified
www.psxhaven.com <----- Running SMF 1.1.16 & heavily modified
www.romhaven.info <----- Running SMF 1.1.16 & heavily modified
www.bthaven.com <----- Running TT 2.06

Inti31

#17
Thx!

180 is a good value.
See: hxxp://aida32-inventory.netboom.de/smf/index.php?topic=1.msg1#msg1 (1st pic)

No need for credits - is not much to do...

Translation:
post.german-utf8.php
// Image Thumb Tag
$txt['thumb'] = 'Thumbnail einfügen';


Modifications.german-utf8.php
// Image Thumb Tag
$txt['thumb_tag'] = 'Klicke hier, dann öffnet sich das Bild in Originalgröße.';


cheers Inti31
my forum
my testforum


my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

MrCreatoR

Very usefull, thanx.

Just one small problem. If the image is smaller than the initial width, then it's inlarged, i supose we don't need to use the tag in this case, but i think the tag should check it somehow.

P.S
Here is a russian translation:

Quote <file name="$languagedir/Post.russian-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
// Image Thumb Tag
$txt['thumb'] = 'Вставить миниатюру';
]]></
add>
</operation>
</file>
<file name="$languagedir/Modifications.russian-utf8.php">
<operation>
<search position="end" />
<add><![CDATA[
// Image Thumb Tag
$txt['thumb_tag'] = 'Нажмите для отображения изображения в оригинальном размере.';
]]></
add>
</operation>
</file>

MrCreatoR

By the way, about the width issue, we can add an extra option to the tag, so the user will be able to set the thumb width himself:

Quote array(
'tag' => 'thumb',
'type' => 'unparsed_equals_content',
'content' => '<img width="$2" src="$1" style="cursor:pointer" title="' $txt['thumb_tag'] . '" alt="' $txt['thumb_tag'] . '" onclick="javascript:if (this.width == $2) this.removeAttribute(\'width\'); else this.width=$2;" />',
'disabled_after' => '($2)',
),

And the usage:

[thumb=150]http://farm1.static.flickr.com/83/263570357_e1b9792c7a.jpg[/thumb]

Advertisement: