View Full Version : how to insert image before [img] bb code
columbusgeek
12-09-2009, 04:53 PM
I have a need to insert a image before images inserted via bbcode. It will sort of serve as a header before the images are viewed.
For example it could be a image, that says this image is resized. (that is not exactly my plan, but a good example)
How or where can I insert this call to pull the image in, only when a [img] bb code is used?
Lynne
12-09-2009, 05:53 PM
Have you tried looking at the class_bbcode.php file and at the function for the image bbcode?
columbusgeek
12-09-2009, 06:18 PM
Good suggestion.
That is abit out of my reach, but I am willing to try for it.
do I append my image to this area? I tried a few things but failed.
// do xxx
$bbcode = preg_replace('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_img_match('\\1')", $bbcode);
Lynne
12-09-2009, 07:42 PM
I don't know exactly where to do it since I really don't understand exactly what you are trying to do. I'm just suggesting that that may be the function you want to try to modify to do what you want.
columbusgeek
12-09-2009, 08:17 PM
maybe a graphic will help convey my thoughts better.
Lynne
12-09-2009, 09:07 PM
OK, well you can try to add it around where that code it. After they do the preg_replace, I suppose you can just append your code to the front of it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.