I'm generating dynamic content with some PHP invoked through {CUSTOM_HEADER}. The generated content needs to be slightly different between two different themes. Is there any cpg variable the PHP can check to know which theme is running?
There is a global array ($CONFIG) that gets its values under include/init.inc.php
You can find theme value by checking this:
$CONFIG['theme']
Sami, I'm relatively new to PHP.
Just to test the variable I tried:
global $CONFIG['theme'];
echo $CONFIG['theme'];
but I got a syntax error.
Have I missed something obvious?
Sami, Now OK.
Just realised the global declaration should have been:
global $CONFIG;
Thanks for your help
Yes ,To use a global variable under a function you need to declare it as a global under that function
for more info check this :
http://us2.php.net/global
Sami,
Yes, I remembered I needed the global declaration, but I hadn't realised I needed to delare the array name rather than just the specific array index. With you guys' help and support it's all working nicely now.
My original implementation of CPG is at:
http://www.miltonmalsorhistory.org.uk/gallery/index.php?theme=mmhs
but my new theme integrates it into the site better:
http://www.miltonmalsorhistory.org.uk/gallery/index.php?theme=mmhs2
I've still got some "tidying up" to do, but it should all be "downhill" from here.
Thanks again for a great script.