vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   stylevar[imgdir_misc] in CMS widget (https://vborg.vbsupport.ru/showthread.php?t=239132)

Sadikb 03-26-2010 09:53 AM

stylevar[imgdir_misc] in CMS widget
 
Hi

I am creating a widget where i need the stylevar[imgdir_misc] and other image directory paths, but i am drawing a blank on these. Can someone please point me in the right direction. Thanks.

Vaupell 03-26-2010 10:24 AM

{vb:stylevar imgdir_misc} = link to misc Dir inside img folder.
and

{vb:stylevar imgdir_<FOLDERNAME>} most of the time
Weither its true always im not sure, but it is for bottons and misc.

i only use bottons and misc, for standard img dir's.

Sadikb 03-26-2010 04:47 PM

Hi, sorry i think i should have been more specific. I mean in my PHP Direct Execution widget, when I do
PHP Code:

echo $stylevar[imgdir_misc]; 

, it's blank. What am i missing?

Vaupell 03-27-2010 07:19 AM

I dont think it is defined in global for use in php..

so you have to define it yourself,
maybe if using costum images for your mod, create your own img folder
sub inside the /images/modcostumimagesfolder/

and remember to add a blank index.html file.

Its easy to define in your script..
here is the test i just did to check if stylevar is defined in global.

PHP Code:

<?php
require_once('./global.php');
 
// set fixed defs
$folder $stylevar['imgdir_misc'];
$misc_folder './images/misc/';
$img 'calendar.gif';
 
// echo's + test
 
echo 'hello <br />';
echo 
'Folder name : ';
echo 
$folder '<br />';
echo 
'Image name : ';
echo 
$folder $img .'<br />';
echo 
'<img src="'$folder $img .'" /> <br />';
echo 
'-------- <br />';
echo 
'Folder 2 name : ';
echo 
$misc_folder '<br />';
echo 
'<img src="'$misc_folder $img .'" />';
?>


Sadikb 03-29-2010 02:27 PM

Hi

for the benefit of anyone else looking for this, we can use the php code below to define image directories

PHP Code:

$imgdir_misc $vbulletin->stylevars['imgdir_misc']['imagedir']; 


Lee Roberts 01-04-2014 07:21 PM

Quote:

Originally Posted by Sadikb (Post 2012320)
Hi

for the benefit of anyone else looking for this, we can use the php code below to define image directories

PHP Code:

$imgdir_misc $vbulletin->stylevars['imgdir_misc']['imagedir']; 


Thanks for posting this back Sadikb, this helped me today.

.Me


All times are GMT. The time now is 02:30 AM.

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.02065 seconds
  • Memory Usage 1,732KB
  • 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
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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