Image in mycode not parsing correctly
#1
I have the following code that I use:

Regular expression:
\[award\](.*?), (.*?), (.*?), (.*?)\[/award\]

Replacement:
<div style="clear:both;border:2px solid #90BBF0;width:550px;">
<div style="border:2px solid #618CDF;">
<div style="border:2px solid #3D69C2;padding:10px;background-color:#000;color:#FAFAFA;">$1 has been awarded the <span style="color:#F00;font-weight:bold;">$2</span> with the following citation: 
<br /><br />
<center><img src="$3" /></center>

<p style="font-style:italic;">"$4"</p>
</div>
</div>
</div>

Usage:
[award]John Doe, Example award, http://www.example.com/images/example.gif , Test caption[/award]

When I test it in the admin sandbox, it works. See the attached screenshot:
   

In the actual post it doesn't work, as something is parsing the image out to look like this:
<img src="%3Ca%20href=" http:="" www.example.com="" images="" example.gif"="" target="_blank">http://www.example.com/images/example.gif " /&gt;

Can someone help me find what is parsing it like that and maybe resolve the issue?
Reply
#2
assuming that you use the award images from your own forum's images directory, use code like this :
[award]John Doe, Example award, images/example.gif , Test caption[/award]
Reply
#3
Thank you, that works great. My forum is on a subdomain and the images on the main domain, so the absolute URL was a problem. I never thought to do it this way, so much appreciated.
Reply


Forum Jump:


Users browsing this thread: