PDA

View Full Version : [RELEASE] Url'ed image hack


12-18-2000, 10:07 AM
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);

12-18-2000, 10:15 AM
All I can say is.... SWEET!

~Chris

12-18-2000, 02:57 PM
i'm away for a few days and look at this.. great stuff .. 1.1.4 compatible ?

12-18-2000, 04:08 PM
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

12-19-2000, 12:08 AM
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

12-19-2000, 01:09 AM
Menno 1000 thanks man!
Awesome job!

12-19-2000, 02:47 AM
and I just added 4 custom VB codes to allow this to be done.

= <a href=
= >
= <img src=
= ></a>

12-19-2000, 09:27 AM
Great HAck. good job.

12-19-2000, 12:33 PM
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

12-19-2000, 03:38 PM
In action:

http://beta.jelsoft.com/showthread.php?postid=678

:)

12-19-2000, 04:06 PM
heh and I just added it to the todo list :)

Perhaps it should have a border to show that it is a link?

12-19-2000, 04:15 PM
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

12-19-2000, 04:18 PM
I hate borders also but sometimes you need to them to point out the obvious to AOL users

/me runs

12-19-2000, 04:26 PM
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?

12-19-2000, 04:35 PM
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.

12-19-2000, 05:34 PM
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

12-20-2000, 08:20 AM
hm... if you want to add a border, let it be an extra option. That would satisfy both ends :)