vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   $ImagePath = $stylevar - Problem ... (https://vborg.vbsupport.ru/showthread.php?t=319170)

jagtpf 06-22-2015 06:18 AM

$ImagePath = $stylevar - Problem ...
 
Hi all,

The following statement

$ImagePath = $stylevar[imgdir_misc].'/critique/nocritique.png';

worked in vB3, in a plugin script.

In vB4 it returns the text '/critique/nocritique.png' !!

Sub folder and image file both exist within the images/misc folders.

It suggests that the stylevar is no longer acceptable in php, or the syntax has altered a wee bit. I can only find stylevar reference in vBulletin docs under templates.

Could anyone suggest where I'm going wrong...

The plugin adds an appropriate image on ['postbit_userinfo_right_after_posts'] (or it should do !!!), and this is the only bit that's not working correctly.

Thanks in antic.

Easy5s.net 06-22-2015 06:28 AM

try $ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc'). '/critique/nocritique.png';

jagtpf 06-22-2015 10:07 AM

Quote:

Originally Posted by Easy5s.net (Post 2548347)
try $ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc'). '/critique/nocritique.png';

Thank you - unfortunately very little difference - that returns ...

images/misc/critique/nocritique.png (slightly more than the above. again no errors in debug)

[The full statement in the php files is written ;

$template_hook['postbit_userinfo_right_after_posts'] .=
'<br /><dt>Critique Level</dt><br /> <dd>' .$ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc'). '/critique/nocritique.png'. '</dd>';

which yields the display of

Critique Level: images/misc/critique/nocritique.png]

kh99 06-22-2015 10:43 AM

So what you want is for the image to be displayed? Then you'd need an img tag in there, like maybe:

Code:

$ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc').'/critique/nocritique.png';
$template_hook['postbit_userinfo_right_after_posts'] .=
'<br /><dt>Critique Level</dt><br /> <dd><img src="' . $ImagePath . '"/></dd>';


jagtpf 06-22-2015 10:53 AM

Quote:

Originally Posted by kh99 (Post 2548365)
So what you want is for the image to be displayed? Then you'd need an img tag in there, like maybe:

Code:

$ImagePath = vB_Template_Runtime::fetchStyleVar('imgdir_misc').'/critique/nocritique.png';
$template_hook['postbit_userinfo_right_after_posts'] .=
'<br /><dt>Critique Level</dt><br /> <dd><img src="' . $ImagePath . '"/></dd>';


Thank you.

That's solved it for me. :)

I have a slight alignment issue, but you've cracked it !:D


All times are GMT. The time now is 10:51 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.01096 seconds
  • Memory Usage 1,720KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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