PDA


View Full Version : Anyway of getting module to recognize the $stylevar?


KW802
08-18-2005, 02:11 PM
I'm working on switching over from a navigation module that is a hard-coded HTML template to instead be based upon the new 2.x Site Navigation module.

When dealing with the level marks, is it possible to get the module to recognize the $stylevar variables?

Right now I can use something like....<img src="$stylevar[imgdir_misc]/navbits_start.gif" />.... and that will use the navbits that correspond to whatever style the visitor is currently using.

However, trying to do that with the module displays the literal text instead of interpreting the variables. Instead I would have to hard-code the tag to be something like....http://www.coolscifi.com/forums/images/misc/navbits_finallink.gif.... but then I lose the graphics being dynamically changed based upon the style.

Thoughts? :o

sean
08-18-2005, 02:16 PM
Would this work by any chance? I wouldn't be suprised if it didn't, lol.

http://www.coolscifi.com/forums/$stylevar[imgdir_misc]/navbits_finallink.gif

also one more thing, if you leave it like this

<img src="$stylevar[imgdir_misc]/navbits_start.gif" /> wouldn't it still work with every style if you put the full path to the folders within the style manager of vbulletin? by that I mean instead of having images/misc in the style manager, have the full url/path to the folder, that way the navbits_start should work fine, not sure.

KW802
08-18-2005, 02:21 PM
No, right now neither would work because the module isn't parsing the $stylevar to it's actual value so both of them would still display the literal text.

Brian
08-18-2005, 03:44 PM
/modules/navigation.php - Look for:
if ($npage['level'] == 1)

Add above:
eval('$mod_options[\'portal_navigation_mark1\'] = "' . addslashes($mod_options['portal_navigation_mark1']) . '";');


Then you should be able to use your $stylevar variables. :)

KW802
08-18-2005, 04:00 PM
Brian, that worked perfectly, thank you! :cool:

Under the line to be added I made a copy of the line and changed the 'mark1' to be 'mark2' to handle the second level graphic as well.

Now should I bug you about putting it as a default in the module? :p

Brian
08-18-2005, 04:04 PM
I don't see any reason not to, so I've just added that to the dev files. :)