Page 1 of 1

Image Hyperlink

Posted: 23 Aug 2010, 14:07
by KukY13
This snippet will automatically place direct links to images you post using regular [img] BBCode.
It is all done really nice, in a form of a hyperlink image floating in lower left corner of the image.
You also get an unwanted indent of the image, but it looks pretty good! :D

First, upload this image to your images folder:
Hyperlink image.
Hyperlink image.
hyperlink.gif (905 Bytes) Viewed 4033 times
And do an edit:
[spoiler=includes/bbcode.php]Find:

Code: Select all

				'img'		=> '<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',
Replace with:

Code: Select all

				'img'		=> '<a target="_blank" style="position:relative;left:22px;" href="$1"><img style="max-width:10%" src="images/hyperlink.gif"/></a><img style="max-width:90%;" src="$1" alt="' . $user->lang['IMAGE'] . '" />',
[/spoiler]
Check any post on your forum containing pictures, and see it in action!
Demo: Any topic on my forum: http://kuky.99k.org/forums/viewtopic.php?f=12&t=63