View Full Version : stylevar[imgdir_misc] in CMS widget
Sadikb
03-26-2010, 09:53 AM
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
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
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, 03:27 PM
Hi
for the benefit of anyone else looking for this, we can use the php code below to define image directories
$imgdir_misc = $vbulletin->stylevars['imgdir_misc']['imagedir'];
Lee Roberts
01-04-2014, 08:21 PM
Hi
for the benefit of anyone else looking for this, we can use the php code below to define image directories
$imgdir_misc = $vbulletin->stylevars['imgdir_misc']['imagedir'];
Thanks for posting this back Sadikb, this helped me today.
.Me
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.