vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to show img tags in a custom template? (https://vborg.vbsupport.ru/showthread.php?t=246959)

BirdOPrey5 07-20-2010 02:01 PM

How to show img tags in a custom template?
 
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,

kh99 07-21-2010 02:30 PM

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.


All times are GMT. The time now is 09:15 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01045 seconds
  • Memory Usage 1,706KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete