Hotte
04-23-2001, 10:00 PM
When using other Templates than the default (ie german templates) than it is usefull to copy this set to a new one before altering them.
File to edit: ./admin/template.php
Around line 235 add the following Code before
// ###################### Start Modify #######################
if ($action=="modify") {
// ###################### Start copyset #######################
if ($action=="copyset") {
$oldset=$DB_site->query_first("SELECT * from templateset where templatesetid=$templateset");
$DB_site->query("INSERT INTO templateset (templatesetid,title) VALUES (NULL,'Copy of ".$oldset[title]."')");
$newset=$DB_site->insert_id();
$sets=$DB_site->query("SELECT * from template where templatesetid=$templateset and title != 'options'");
while($set=$DB_site->fetch_array($sets)){
$DB_site->query("INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,$newset,'".addslashes($set[title])."','".addslashes($set[template])."')");
}
echo "<p>copied!</p>";
$action="modify";
}
In action modify around line 357 add
makelinkcode("copy","template.php?s=$session[sessionhash]&action=copyset&templateset=$templateset[templatesetid]").
between
makelinkcode("collapse groups","template.php?s=$session[sessionhash]&action=modify&expandset=$templateset[templatesetid]").
"<ul>\n";
File to edit: ./admin/template.php
Around line 235 add the following Code before
// ###################### Start Modify #######################
if ($action=="modify") {
// ###################### Start copyset #######################
if ($action=="copyset") {
$oldset=$DB_site->query_first("SELECT * from templateset where templatesetid=$templateset");
$DB_site->query("INSERT INTO templateset (templatesetid,title) VALUES (NULL,'Copy of ".$oldset[title]."')");
$newset=$DB_site->insert_id();
$sets=$DB_site->query("SELECT * from template where templatesetid=$templateset and title != 'options'");
while($set=$DB_site->fetch_array($sets)){
$DB_site->query("INSERT INTO template (templateid,templatesetid,title,template) VALUES (NULL,$newset,'".addslashes($set[title])."','".addslashes($set[template])."')");
}
echo "<p>copied!</p>";
$action="modify";
}
In action modify around line 357 add
makelinkcode("copy","template.php?s=$session[sessionhash]&action=copyset&templateset=$templateset[templatesetid]").
between
makelinkcode("collapse groups","template.php?s=$session[sessionhash]&action=modify&expandset=$templateset[templatesetid]").
"<ul>\n";