Forum Moderators: coopster
You might have worked with theme based softwares like wordpress, phpbb and drupal etc. Where you can change your site looks and structure sometimes with just one click in the admin panel i.e changing theme.
I was about to make a customized discussion forum in php and want to use these theme system so that i can reuse this software for my other future projects and can control the looks and structure of the forum easily from a theme system.
What is the best approach to implement theme bases system? Also I am not using any template system like smarty etc. My software is pure, apache mod rewrite, php and mysql.
thank you.
Server Side Scripting in CSS Files [webmasterworld.com]
If you have got any chance to work with drupal or wordpress. You just copy a complete folder of different pages, not only css, to the theme folder and then from admin panel you can select that new theme and implement it on the site. NOT FOR INDIVIDUAL USERS like done on phpbb etc to personalize your visit experience. I am talking about themes like wordpress etc have. These themes not only changes style but the structure of the site too.
I am looking to make that kind of system from where i can make new themes and change them from the admin panel. Not only CSS styling but complete structure of the site with the same backend.
thank you very much
If you examine the way it's accomplished in phpbb the php script is simply creating all the variables and then parses the template page at the end of the script. For example this is last few lines in index.php :
page_header($user->lang['INDEX']);$template->set_filenames(array(
'body' => 'index_body.html')
);page_footer();
To simplify it, your php file:
<?php
$my_variable = 'This is my template';
include 'my_template.php';
?>
Your html template:
<p><?php echo $my_variable;?></p>
Note that phpbb does this differently, the template file is instead loaded into an array and parsed.