PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 11-01-2005, 12:27 AM   #1
ENTHALPIE
Green Mole
 
Join Date: Oct 2005
Location: Yerres France
Posts: 17
Question default template

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
ENTHALPIE is offline   Reply With Quote
Old 11-01-2005, 05:08 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Look in the config file for something like the following:
Code:
// 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.html','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";
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 11-02-2005, 01:35 AM   #3
ENTHALPIE
Green Mole
 
Join Date: Oct 2005
Location: Yerres France
Posts: 17
Talking default template

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
ENTHALPIE is offline   Reply With Quote
Old 11-02-2005, 08:21 AM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Like this...
Code:
// 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.html','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...
Code:
// 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.html','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 = "";
}
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Oh where oh where can my template file be? george2 How-to Forum 2 10-03-2007 01:34 PM
default option should be to subscribe to threads you've created? rwillmer Feedback & News 0 08-27-2005 04:28 AM
Awesome Template Slider Feedback & News 1 12-16-2004 10:29 AM
Enhanced template manfred Mod Submissions 2 09-01-2004 03:00 PM
Default Depth tryangle How-to Forum 7 04-20-2004 11:48 AM


All times are GMT -8. The time now is 05:07 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.