Url shown as a blank image (?)

Started by Ascot, April 13, 2012, 10:54:06 PM

Previous topic - Next topic

Ascot

I'm having a weird issue. My url are parsing as a blank image as you can see in the attached pic.
I've check and compare img and url bbcode arrays to a fresh subs.php but all seems to match.


Here you can check an example, just look at the blank image.


Any idea on how to fix this?
Hope someone can help me
My forum version is 2.0.2

Colin

Take a look at the source code

<a href="http://www.AnimeFall.com.ar"><img src="http://www.AnimeFall.com.ar" class="bbc_link" target="_blank"></a>

Notice the IMG tags in there. Here is what it should go to.

<a href="http://www.AnimeFall.com.ar" target="_blank">http://www.AnimeFall.com.ar</a>
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Colin

That being said, edit the post and make sure there are no [IMG] tags inside the [URL] tag.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

NanoSector

Also, can you attach your Subs.php here, so we can check it for errors?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Ascot

#4
The problem is i never used img tags before the url.
Here's the code when i edit the post
Tambien puedes hacerlo de forma manual copiando el enlace [url=http://www.AnimeFall.com.ar]http://www.AnimeFall.com.ar[/url]

I've attached my subs.php
it have some changes on img bbcode  at line 1313 added by "BBcode with style" Mod, but i think it's not the problem.

Also, as you can see in the example above, the url doesn't link to destination. It does the blank image.

Guess it's caused by the code to set url images as images but it shouldn't be happening since it must work only with url finished at jpg, png, gif, bmp etc..

Ascot


if (strpos($message, '<a href') !== false && !strpos($message ,'quote'))
{
    //show up images without inserting them between [img] tags ;)
$message = preg_replace('~<a href="(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))"(.*?)>(.*?)(\.(?i)(jpg|jpeg|gif|png|bmp))</a>~i', '<img src="$1$2" alt="" />', $message);
}


This is the piece of code making some troubles, I use it for embedding img urls as images.
i didn't have problems with this before. :(
Now it's making that weird error.
It doesn't embed only img urls, it does embed all urls.

NanoSector

Why can't you do [url=blah][img]myimage.png[/img][/url] instead?

That code seems like a bridge for lazy people to me..
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Ascot

since social networks makes all so easy (including image and video embedding), most  of people want it easy.  I can't fight against lazyness and i really don't want my forum to be complicated and cumbersome. i want it as simple as possible for users. because it's a reality ):
I mean, if you don't find a way to fight against social networks, your forum simply dies.

Advertisement: