>>
Site Map
>>
Forums
>>
Blocks 7x
Forum module - topics in forum:
Blocks 7x - Discussions regarding PHP-Nuke Blocks. 7x
Block Images to match themes [Resolved]
Okay so I have a few custom html blocks and I have a question. Is there a way to make it so that when a user switches themes, the image changes to match that theme in the block?
For example, I'm using a small image for a bullet down my menus, and I want the bullet to be different in the themes so that it doesn't look odd in another theme.
If this is possible can you point me in the right direction on how to do this? My brain is fried lately *sighs*
Thank you in advance

You'd need to use the $ThemeSel function like I do on the forum block.
You'd need to add something like
| Code: : |
| <img src=\"themes/$ThemeSel/blocks/images/bullet.gif\"> |
You dar are my hero.. *SMOOCH*
thank you 
Let's hope it works then eh. 
hmmm no such luck i guess LOL! it doesn't work. *scratches head* $ThemeSel is a global variable isn't it?
Sorry, yes, the blocks would need to be made in php format and $ThemeSel added to the global
i've got the block in php format.. i'll have to look up into making that a global. Thank you 
Just open up a standard nuke block and copy it.
Example.
| Code: : |
| global $prefix, $dbi, $sitename, $admin, $bgcolor1, $bgcolor2, $bgcolor4, $ThemeSel; |
Heh.. funny that's about what I was going to do.
If all else fails I usually go back and see how the original works and figure it out from there.
Sweet it works! *hugs you* 
Hmm not a super important issue.. Everything works great except for the Admin panel. The ThemeSel isn't working there. Is there something I need to edit in the admin folder?
Not sure TBH, do you have $admin in the global?
nope. i don't, should i? LOL
even when I add that it doesn't change anything. *sighs*
Dunno what to suggest. 
That's okay. I'll go through it later and try and figure it out. Maybe $ThemeSel needs to be in the global for some of the admin files or something.
Got it! Added $ThemeSel to header.php file. Just in case anyone else comes along and has the same prob. 