View Single Post
Old 10-28-2008, 9:07 AM
Coffee Coffee is offline
Join Date: Apr 2008
Posts: 377
iTrader: 2 / 100%

Open Letter - how can we make better?
Might want to consider doing this so the quoted pictures show up as links. It appears attachments are not enabled on this site so sent an email to you with an attached file.

Edit the file includes/class_bbcode.php

1. Find the function called: handle_bbcode_quote
2. Right before the last line of the function I added the following lines:

//### HACK BEGIN - Turn [img] to [url]
if ($this->contains_bbcode_img_tags($html))
$html = preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this-handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')", $html);
//### HACK END
return $html; // <----- Last line of function

What's happening there is that function is acting on the quoted response. Early in the function it strips smilies, does some tweaking depending on the user's browser version, and then at the very end, I added code to detect if there is a quoted bb image tag and if so, it applies a regular expression against the bb image code to make it so only the url is displayed. It seems to be escaping the bb code so the bb parser doesn't turn it into real img tags.
Reply With Quote