News - Features - Downloads - Forum - Team - Support - Switch View: Screen
Login - Registrierung - Passwort vergessen
Codepaste - Details
Weitere Infos zum Codepaste

Name Different templates per mod/action
Autor nl Mindcrime
CMS-Version ClanSphere 2008
Datei index.php
Datum 26.11.2008 um 17:31 Uhr
Beschreibung This is just a quick hack for being able to switch to different main templates depending on the module and action that was taken.

Depending on the mod and/or action use a different template than the default index.htm if set in the file system/runstartup/mod_template.php. The file system/runstartup/mod_template should look like this (just an example and these index2.htm and index3.htm should exist in your templates/YOU_CHOSEN_TEMPLATE directory):

<?php
global $cs_mod_templates;

/*
* If the value of the mod key is not an array => use that template for all actions
* If the value of the mod key is an array, only use that template for that mod and that specific action
*/
$cs_mod_templates = array(
'access' => array('manage' => 'index2.htm'),
'affiliates' => 'index2.htm',
'board' => 'index2.htm',
'clansphere' => 'index2.htm',
'database' => 'index2.htm',
'explorer' => 'index2.htm',
'wars' => array('edit' => 'index2.htm', 'manage' => 'index2.htm'),
'news' => array('create' => 'index2.htm', 'edit' => 'index2.htm', 'manage' => 'index2.htm'),
'users' => array('home' => 'index3.htm')
);

?>

In our example we use index2.html to have more space available for content (board/forum needs more width) while index3.html is used for showing some members / logged on only stuff that you don't wont to show on other pages...
Alter Code Alter Code +-
 
1.
1. / 2. / ... 
 echo cs_template($cs_micro,$cs_main,$account);
Neuer Code Neuer Code +-
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
1. / 2. / ... 
         /* use another main template depending on the mod */
        
$cs_main_template 'index.htm';
        if (
is_array($cs_mod_templates) && isset($cs_mod_templates[$cs_main['mod']]))
        {
                if (
is_array($cs_mod_templates[$cs_main['mod']]))
                {
                        if (isset(
$cs_mod_templates[$cs_main['mod']][$cs_main['action']]))
                        {
                                
$cs_main_template $cs_mod_templates[$cs_main['mod']][$cs_main['action']];
                        }
                }
                else
                        
$cs_main_template $cs_mod_templates[$cs_main['mod']];
        }
        echo 
cs_template($cs_micro,$cs_main,$account,$cs_main_template);
Zurück - Übersicht


Bitte Login benutzen, um Kommentare zu schreiben.


ClanSphere Project - Mailus - Imprint - Disclaimer - Scriptinfo