View Full Version : default template
ENTHALPIE
10-31-2005, 11:27 PM
Hi
certainly a stupid question but i did'nt see it . I saw how to remove the choice in templates but my question is :
how to put a default template for everybody ?
regards
Charter
11-01-2005, 04:08 PM
Look in the config file for something like the following:
// this snippet is from PhpDig 1.8.8 RC1 //
// this chunk of code NEEDS to be here for security - checks to see that $template is set to a valid value
if (isset($_REQUEST['template_demo'])) {
$template_demo = $_REQUEST['template_demo'];
}
$templates_array = array('black.html','bluegrey.html','corporate.html','green.html','grey.html ','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.ht ml','terminal.html','yellow.html','gaagle.html');
if(isset($template_demo) && in_array($template_demo, $templates_array)) {
$template = "$relative_script_path/templates/$template_demo";
} else {
$template = "$relative_script_path/templates/phpdig.html";
}
// alternatively force the $template value to a valid value
// $template = "$relative_script_path/templates/phpdig.html";
// if using array, set $template = "array";
// if using classic, set $template = "classic";
ENTHALPIE
11-02-2005, 12:35 AM
Hi
I do that ...
// template file and style - checks to see that template is set to a valid value
if (isset($_REQUEST['template_demo'])) { $template_demo = $_REQUEST['template_demo']; }
$templates_array = array('black.html','bluegrey.html','corporate.html','green.html','grey.html ','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.ht ml','terminal.html','yellow.html','gaagle.html');
if(isset($template_demo) && in_array($template_demo, $templates_array)) {
$template = "$relative_script_path/templates/$template_demo";
} else {
$template = "$relative_script_path/templates/linear.html";
}
// template file and style - alternatively force the template value
// $template = "$relative_script_path/templates/phpdig.html";
// if using array, set $template = "array";
// if using classic, set $template = "classic";
// now set $template_demo to clean $template filename or empty string
if (($template != "linear") && ($template != "linear")) {
$template_demo = substr($template,strrpos($template,"/")+1); // get filename.ext from $template variable
} else {
$template_demo = "linear";
}
Look's OK
regards
Charter
11-02-2005, 07:21 AM
Like this...
// template file and style - checks to see that template is set to a valid value
if (isset($_REQUEST['template_demo'])) { $template_demo = $_REQUEST['template_demo']; }
$templates_array = array('black.html','bluegrey.html','corporate.html','green.html','grey.html ','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.ht ml','terminal.html','yellow.html','gaagle.html');
if(isset($template_demo) && in_array($template_demo, $templates_array)) {
$template = "$relative_script_path/templates/$template_demo";
} else {
$template = "$relative_script_path/templates/phpdig.html";
}
$template = "$relative_script_path/templates/linear.html";
// template file and style - alternatively force the template value
// $template = "$relative_script_path/templates/phpdig.html";
// if using array, set $template = "array";
// if using classic, set $template = "classic";
// now set $template_demo to clean $template filename or empty string
if (($template != "array") && ($template != "classic")) {
$template_demo = substr($template,strrpos($template,"/")+1); // get filename.ext from $template variable
} else {
$template_demo = "";
}
Or like this...
// template file and style - checks to see that template is set to a valid value
if (isset($_REQUEST['template_demo'])) { $template_demo = $_REQUEST['template_demo']; }
$templates_array = array('black.html','bluegrey.html','corporate.html','green.html','grey.html ','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.ht ml','terminal.html','yellow.html','gaagle.html');
if(isset($template_demo) && in_array($template_demo, $templates_array)) {
$template = "$relative_script_path/templates/linear.html";
} else {
$template = "$relative_script_path/templates/linear.html";
}
// template file and style - alternatively force the template value
// $template = "$relative_script_path/templates/phpdig.html";
// if using array, set $template = "array";
// if using classic, set $template = "classic";
// now set $template_demo to clean $template filename or empty string
if (($template != "array") && ($template != "classic")) {
$template_demo = substr($template,strrpos($template,"/")+1); // get filename.ext from $template variable
} else {
$template_demo = "";
}
vBulletin® v3.7.3, Copyright ©2000-2025, Jelsoft Enterprises Ltd.