// All rights reserved. This script is part of PHPWCMS. The PHPWCMS web content management system is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html A copy is found in the textfile GPL.txt and important notices to the license from the author is found in LICENSE.txt distributed with these scripts. This script is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. This copyright notice MUST APPEAR in all copies of the script! *************************************************************************************/ // ---------------------------------------------------------------- // obligate check for phpwcms constants if (!defined('PHPWCMS_ROOT')) { die("You Cannot Access This Script Directly, Have a Nice Day."); } // ---------------------------------------------------------------- reset($phpwcms['js_lib']); // reset $phpwcms['js_lib'] to get first element as default $template = array( "name" => '', "default" => 0, "layout" => '', "css" => array(), "htmlhead" => '', "jsonload" => '', "headertext" => '', "maintext" => '', "footertext" => '', "lefttext" => '', "righttext" => '', "errortext" => '', 'feloginurl' => '', 'jslib' => key($phpwcms['js_lib']), 'jslibload' => 0, 'frontendjs' => 0, 'googleapi' => 1 ); if(!isset($_GET["s"])) { // check if template should be edited ?> \n'."\n"; echo '\n".'\n\n"; $row_count++; } mysql_free_result($result); } // end listing ?>
"; //#F9FAFB echo ''.html_specialchars($row["template_name"]).""; echo ($row["template_default"]) ? " (".$BL['be_admin_tmpl_default'].")" : ""; echo "'; echo ''; echo ''; // ERICH COPY TEMPLATE 7.6.2005 echo ''; echo ''; // ERICH COPY TEMPLATE END 7.6.2005 echo ''; echo ''; echo ''."
0 then get template info from database $sql = "UPDATE ".DB_PREPEND."phpwcms_template SET ". "template_name='".aporeplace($template["name"])."', ". "template_default=".$template["default"].", ". "template_var='".aporeplace(serialize($template))."' ". "WHERE template_id=".$template["id"]; } else { // if ID = 0 then show create new template form $sql = "INSERT INTO ".DB_PREPEND."phpwcms_template (". "template_name, template_default, template_var) VALUES ('". aporeplace($template["name"])."', ".$template["default"].", '". aporeplace(serialize($template))."')"; } // update or insert data entry @mysql_query($sql, $db) or die("error while updating or inserting template datas"); if(empty($template["id"]) || $createcopy == 1) { $template["id"] = mysql_insert_id($db); } //now proof for default template definition if($template["default"]) { mysql_query("UPDATE ".DB_PREPEND."phpwcms_template SET template_default=0 ". "WHERE template_id != ".$template["id"], $db); } update_cache(); headerRedirect(PHPWCMS_URL."phpwcms.php?do=admin&p=11&s=".$template["id"]); } if($template["id"]) { // read the given template datas from db $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_template WHERE template_id=".$template["id"]." LIMIT 1"; if($result = mysql_query($sql, $db)) { if($row = mysql_fetch_array($result, MYSQL_ASSOC)) { unset($template); $template = unserialize($row["template_var"]); $template["id"] = $row["template_id"]; $template["default"] = $row["template_default"]; // compatibility for older releases where only // 1 css file could be stored per template if(is_string($template['css'])) { $template['css'] = array($template['css']); } if(empty($template['jslib'])) { $template['jslib'] = key($phpwcms['js_lib']); } if(empty($template['jslibload'])) { $template['jslibload'] = 0; } if(empty($template['frontendjs'])) { $template['frontendjs'] = 0; } if(!isset($template['googleapi'])) { $template['googleapi'] = 1; } elseif(empty($template['googleapi'])) { $template['googleapi'] = 0; } } mysql_free_result($result); } } // show form ?>
" method="post" name="blocks" target="_self" id="blocks"> '; echo ''; echo '\n"; // list custom blocks foreach($custom_blocks as $value) { $custom_block = html_specialchars($value); echo ''; echo '\n\n"; echo ''; echo '\n\n"; echo ''."\n"; } echo ''; } ?>
:
'; } else { echo ''; } ?>   />
'.html_specialchars($row['pagelayout_name']).''."\n"; } mysql_free_result($result); } if($opt) { echo ''; } else { echo $BL['be_admin_tmpl_nolayout'].' ('.$BL['be_admin_page_add'].')'; } ?>
 
config/phpwcms/conf.template_default.inc.php
:


 

<head>  
  />    />
 
/>
" size="50" />
  " size="50" />
    
'; echo ''; echo "
'.$custom_block." {".$custom_block."}
 
 " />