I'd like to use Macros to control what functions/variables are used in order to test my PHP file. But I know PHP doesn't do Macros, so what would someone suggsest is an elegant way to do this? The reason for having the macros is so I can easily switch between one themeID and another while still having full control over each theme! Please ignore the fact that I've used some C constructs and others PHP!
For instance:
For instance:
Code:
#define themeID1
#ifdef themeID1
# define $BANNERNAME 'flowers.jpg'
#else
# ifdef themeID2
# define $BANNERNAME 'robots.jpg'
# endif
#endif
// Now I'm going to add this banner to my wordpress
// thematic theme!
function add_banner(){
global $BANNERNAME;
$styledir = get_styledir();
echo '<img src="'.$styledir.'/'.$bannerName.'">';
}
add_action('thematic_header','add_banner',3);
Comment