Although it is not yet set up, we can start thinking about how we want the community page to work.
This is my proposal for the template section:
If we have all downloadable templates also installed on the server we can very easily have the following page:
A list of all templates (with or without thumbnail preview pictures - adding this would mean work for every template) with a view and a download link.
Clicking the download link obviously sends the .zip file, but the view link changes the template of the site directly and leads back to the currently displayed page.
Example for code page:
echo '<a href="'.$_SERVER['PHP_SELF'].'?template=round">Switch to round template</a>';
And the code to include in WB_PATH/index.php before line 236 in WB 2.3.1 (any version: directly before the comment //Figure out what template to use)
if ($_GET['template']!="")
if(file_exists(WB_PATH.'/templates/'.$_GET['template'].'/index.php'))
define('TEMPLATE',$_GET['template']);
We could have a simple loop over all files within, say, /media/templates, check if the respective template is also installed and if so display the "preview this template" link. With a small change of the install-template script, which copies the .zip file into the respective download directory, we could have this all automatically via template installation.
As soon as the user clicks any link in the menu, the standard template of the page is restored (automatically, because no template code is sent with the link)