MyBB Community Forums

Full Version: Change this [img] MyCode to work with <img src= HTML
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to add a MyCode that triggers Highslide Zoom with HTML instead of just with MyBB code. I already have HTML turned on for the forum.

Example:
<img src="http://mysite.com/image.jpg">

The expression is:
\[img\](.*?)\[/img\]

Replaced with:
<a href="$1" class="highslide" onclick="return hs.expand(this)"><img style="max-width:300px;" src="$1" alt="İmage" title="Larger İmage" /></a>

What I tried was using the expression:
\<img\(.*?)\>\

But this completely crashed the forum.  Big Grin



Any ideas?
You can override the [img] tag, using the first expression.

Or, if you want a specific tag, this one may work:
<img=(.*?)>

But if you really want a specific one, don't use html tags, you'd better try one of the followings:
\[himg=(.*?)\]
\[himg\](.*?)\[/himg\]