View Full Version : How to show img tags in a custom template?
BirdOPrey5
07-20-2010, 02:01 PM
I am displaying a custom template and have sucessfully got bbcode and smilies to show but for some reason [ img ] tags are showing a link to the file instead of displaying the actual image. Anyone know how to fix this? I searched though "parse img" and even :eek: "img tag" and got nothing relevant,
If you look at the parse function (includes/class_bbcode.php around line 258), there are a number of switches that get set based on what kind of text is being parsed. One of them ($dobbimagecode) controls whether to parse images to a link or to image code. If you don't pass a "forumid" (which is really a string, apparently) as the second parameter to the parse() function (and I see from the other thread that you're passing "0"), it defaults to links.
So I guess maybe you could try passing something else. It looks like the functions expects strings which are used by a switch statement. That's probably what you want (I think you said you were parsing for the signature, and that's one of the strings), but if not, another possibility might be to put a plugin on the bbcode_parse_start hook and set the variables yourself. You could make up your own string for $forumid, then you could check for it and set things up any way you want.
BirdOPrey5
07-21-2010, 03:05 PM
awesome, thanks... once I changed "0" to a valid forum id it worked fine. Thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.