View Full Version : [RELEASE] Url'ed image hack
IMAGE URL HACK
ok conan, here it is ;)
you can use it as follow: url to image here
In global.php find:
// change neccessary " back to "
ABOVE that add:
// URL'ED IMAGE HACK
$text=eregi_replace("\\[imgurl=\"([^\"]*)\"\\]([^\\[]*)\\[\\/imgurl\\]","<a href=\"\\1\" target=_blank><img src=\"\\2\" border=\"0\"></a>",$text);
$text=eregi_replace("\\[imgurl=([^\"]*)\\]([^\\[]*)\\[\\/imgurl\\]","<a href=\"\\1\" target=_blank><img src=\"\\2\" border=\"0\"></a>",$text);
All I can say is.... SWEET!
~Chris
i'm away for a few days and look at this.. great stuff .. 1.1.4 compatible ?
I've 'hacked' global.php to work it like this:
[url=... ][img ]...[ /img][ /url]
I think this is a more clean and logical solution and it was not really a hack but moreless a matter of replacing some lines
Originally posted by Mas*Mind
I've 'hacked' global.php to work it like this:
[url=... ][img ]...[ /img][ /url]
I think this is a more clean and logical solution and it was not really a hack but moreless a matter of replacing some lines
Can you post the full hack's code and instructions please?
Thanks,
Bira
Menno 1000 thanks man!
Awesome job!
and I just added 4 custom VB codes to allow this to be done.
= <a href=
= >
= <img src=
= ></a>
Thanks guys
Mas*Mind: Sure, you could, using that construction actually means typing more, and mose BB'ers are *very* lazy ;)
Ofcourse it would be cleaner, but hey, I supply instead of inovate :)
eva2000: yeah, this stuff is so standart is should work on all vB versions
In action:
http://beta.jelsoft.com/showthread.php?postid=678
:)
heh and I just added it to the todo list :)
Perhaps it should have a border to show that it is a link?
Originally posted by freddie
heh and I just added it to the todo list :)
Perhaps it should have a border to show that it is a link?
I am not really big on borders around images, but thats just my opinion. Maybe make it an option? Possibly http://www.image.com ??
~Chris
I hate borders also but sometimes you need to them to point out the obvious to AOL users
/me runs
global.php:
just make sure that:
if ($dobbimagecode==1) {
// do https://vborg.vbsupport.ru/
$bbcode=eregi_replace("\\[img\\]([^\\[]*)\\[/img\\]","<img src=\"\\1\" border=0>",$bbcode);
}
is above:
// do xxx
$bbcode=eregi_replace("\\[url\\]www.([^\\[]*)\\[/url\\]","<a href=\"http://www.\\1\" target=_blank>\\1</a>",$bbcode);
$bbcode=eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=_blank>\\1</a>",$bbcode);
Freddie > Plz no borders, borders are really ugly...There is'n't any border around the VB toplogo is there?
Sorry I just like giving forum admins the ability to make that choice for themself. There are alot of admins who aren't HTML snobs who might like borders but I am not going to make the change to add them so it is doubtful they will be added.
Originally posted by freddie
heh and I just added it to the todo list :)
Perhaps it should have a border to show that it is a link? :) I was making the preg changes, so I said "wth? Lets fix this..." :D
hm... if you want to add a border, let it be an extra option. That would satisfy both ends :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.