Upgrade betatesters needed

"xaplo" <[email protected]> Tue, 3 Sep 2002 19:29:17 +0100
Newsgroups gmane.comp.web.envolution.devel
Message-ID <[email protected]>
Finished upgrade script from 
 
- PN .714
- PN .714 + Encompass
- PN .72
- PN .72 + Encompass
 
I have tested it and it seems to work flawlesly, but will like that
someone else test it, just to make sure it works ok.
 
The upgrade script should work from any version of Postnuke >= .71
(actually .71, .712, .713, .714, .72, .721) with or without Encompass.
 
The changelog:
- Corrected bug on Encompass tables creation from PN .71 without
Encompass
- Added comaptibilty to upgrade from .72 and versions .71, .712 and .713
- Cleaned code
- Check if previous installation of User Points exists, and upgrade it.
- Insert at least a story if there isnt one (nasty bug on Envolution,
failing if there are no stories)
 
Steps:
 
1.- Backup your database
2.- Backup your database ;)
3.- Replace attached files on directory install/
4.- Upgrade
5.- Submit bugs
 
NOTE: at upgrade screen you are presented only a button to upgrade from
"Postnuke .714". That is the script, that needs be changed when
everything is tested.
 
As stated on the upgrade steps, config.php isnt overwrited. It shouldnt
as you already have your old config.php, which is still valid. Else, you
will need to edit your config.php and add your connection info.
 
Saludos,
 
Marino Carlos (aka xaplo)
http://www.envolution-hispano.org
pn714.php (application/octet-stream, 9.9 KB)
<?php
// $Id: pn71-2.php,v 1.0.1 2002/09/03 13:19:19 xaplo Exp $
// Upgrade from PostNuke .714 and .72 to Envolution 1.0
//
// Note that this is upgrade script uses ADODB instead
// of raw mysql
//
// Adapted by xaplo from Postnuke.
//
// Log:
// - Make upgradable from .72
// - Clean code
// - New function (in update_functions) SaveConfigValue

global $dbconn, $pntable, $prefix;

include_once("install/Encompass.php");

// Save / upgrade module vars
SaveConfigValue('/PNConfig','allowuserdelete',0,0);
SaveConfigValue('/PNConfig','senddeleteemail',0,0);
SaveConfigValue('/PNConfig','sendaddemail',0,0);
SaveConfigValue('/PNConfig','allowuserpass',0,0);
SaveConfigValue('/PNConfig','blkusrreg',0,0);
SaveConfigValue('/PNConfig','senduserpass',0,0);
SaveConfigValue('/PNConfig','pncuaver','1.2',1);
SaveConfigValue('/PNConfig','pncuaadvreg',0,0);
SaveConfigValue('/PNConfig','Default_Theme','Envolved',1);
SaveConfigValue('/PNConfig','Version_ID','Envolution',1);
SaveConfigValue('/PNConfig','Version_Num','1.0.0',1);
SaveConfigValue('/PNConfig','Version_Sub','Resolve',1);
SaveConfigValue('/PNConfig','UseCompression',0,0);
SaveConfigValue('/PNConfig','htmlentities',1,0);					  
SaveConfigValue('/PNConfig','collapseable',1,0);		

// Change permissions for 'Mail users' to 'MailUsers' in user permissions
$upcolumn = $pntable['user_perms_column'];
$result = $dbconn->Execute("SELECT $upcolumn[pid],
                                   $upcolumn[component]
                            FROM $pntable[user_perms]");
$foundrecords = !$result->EOF;
while(list($pid, $component) = $result->fields) {
    $result->MoveNext();

    if (preg_match('/Mail users/', $component)) {
        $component = preg_replace('/Mail users/', 'MailUsers', $component);
        $dbconn->Execute("UPDATE $pntable[user_perms]
                          SET $upcolumn[component] = '" . addslashes($component) . "'
                          WHERE $upcolumn[pid] = $pid");
    }
}
if ($foundrecords) {
    $result->Close();
}

// Add in reminder to remove the install.php file
$bcolumn = $pntable['blocks_column'];
$dbconn->Execute("INSERT INTO $pntable[blocks]
                    ($bcolumn[bid],
                     $bcolumn[bkey],
                     $bcolumn[title],
                     $bcolumn[content],
                     $bcolumn[url],
                     $bcolumn[mid],
                     $bcolumn[position],
                     $bcolumn[weight],
                     $bcolumn[active],
                     $bcolumn[refresh],
                     $bcolumn[last_update],
                     $bcolumn[language])
                  VALUES
                    (0,
                     'html',
                     'Reminder',
                     'Please remember to remove the following files from your Envolution directory
                     <p>
                     &middot;<b>install.php</b> file
                     <p>
                     &middot;<b>install</b> directory
                     <p>
                     If you do not remove these files then users can obtain the password to your database!',
                     '',
                     0,
                     'l',
                     0.5,
                     1,
                     0,
                     0,
                     '')");

					 
UpdateEncompass();

//
// User Points table
//
if (!CheckTableExists("user_points")) {
  $dbconn->Execute("DROP TABLE ".$prefix."_user_points");
}

// Create User Points table
$result = $dbconn->Execute("CREATE TABLE ".$prefix."_user_points (
  uid int(11) NOT NULL default '0',
  uname varchar(25) NOT NULL default '',
  stories int(11) NOT NULL default '0',
  comments int(11) NOT NULL default '0',
  pollcomm int(11) NOT NULL default '0',
  downloads int(11) NOT NULL default '0',
  dloadvotes int(11) NOT NULL default '0',
  links int(11) NOT NULL default '0',
  linkvotes int(11) NOT NULL default '0',
  reviews int(11) NOT NULL default '0',
  reviewcomm int(11) NOT NULL default '0',
  posts int(11) NOT NULL default '0',
  points int(13) NOT NULL default '0',
  PRIMARY KEY  (uid)
)");

$dbconn->Execute("INSERT INTO ".$prefix."_user_points VALUES ('-1', '0000000000', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");


// Create User delete request table
$result = $dbconn->Execute("CREATE TABLE ".$prefix."_users_delrequest (
  pn_uid int(11) NOT NULL default '0',
  pn_name varchar(60) NOT NULL default '',
  pn_uname varchar(25) NOT NULL default '',
  pn_email varchar(60) NOT NULL default '',
  pn_pass varchar(40) NOT NULL default '',
  PRIMARY KEY  (pn_uid)
)");

$result = $dbconn->Execute("SELECT MAX(pn_id) FROM ".$prefix."_modules");
list($maxpnid) = $result->fields;

$maxpnid++;

// Update modules
$result = $dbconn->Execute("SELECT pn_name FROM ".$prefix."_modules where pn_name='Encompass'");
$foundrecords = !$result->EOF;                 

if ($foundrecords) {
$result = $dbconn->Execute("DELETE FROM ".$prefix."_modules WHERE pn_name='Encompass'");
}
$result = $dbconn->Execute("INSERT INTO ".$prefix."_modules 
							VALUES ($maxpnid,
									'Encompass',
									2,
									'Encompass',
									'Encompass Theme Engine',
									43,
									'Encompass',
									'0.926',
									1,
									0,
									3)")
or die("<b>"._NOTUPDATED.$prefix."_modules (Encompass)</b>");

$maxpnid++;

$result = $dbconn->Execute("SELECT pn_name FROM ".$prefix."_modules where pn_name='Frontpage'");
$foundrecords = !$result->EOF;                 

if ($foundrecords) {
$result = $dbconn->Execute("DELETE FROM ".$prefix."_modules WHERE pn_name='Frontpage'");
}$result = $dbconn->Execute("INSERT INTO ".$prefix."_modules 
							VALUES ($maxpnid,
									'Frontpage',
									2,
									'Frontpage',
									'Encompass FrontPage Module',
									44,
									'Frontpage',
									'0.91-1a',
									0,
									1,
									3)")
or die("<b>"._NOTUPDATED.$prefix."_modules (Frontpage)</b>");

$maxpnid++;

$result = $dbconn->Execute("SELECT pn_name FROM ".$prefix."_modules where pn_name='User_Points'");
$foundrecords = !$result->EOF;                 

if ($foundrecords) {
$result = $dbconn->Execute("DELETE FROM ".$prefix."_modules WHERE pn_name='User_Points'");
}
$result = $dbconn->Execute("INSERT INTO ".$prefix."_modules 
							VALUES ($maxpnid,
									'User_Points',
									2,
									'User Points',
									'Member Points Module',
									45,
									'NS-User_Points',
									'0.22a-1',
									1,
									0,
									3)")
or die("<b>"._NOTUPDATED.$prefix."_modules (User_Points)</b>");

$maxpnid++;

$result = $dbconn->Execute("SELECT pn_name FROM ".$prefix."_modules where pn_name='Your_Account'");
$foundrecords = !$result->EOF;                 

if ($foundrecords) {
$result = $dbconn->Execute("DELETE FROM ".$prefix."_modules WHERE pn_name='Your_Account'");
}
$result = $dbconn->Execute("INSERT INTO ".$prefix."_modules 
							VALUES ($maxpnid,
									'Your_Account',
									2,
									'Your Account',
									'User options',
									0,
									'NS-Your_Account',
									'0.8',
									0,
									0,
									3)")
or die("<b>"._NOTUPDATED.$prefix."_modules (Your_Account)</b>");

$maxpnid++;

$result = $dbconn->Execute("SELECT pn_name FROM ".$prefix."_modules where pn_name='Past_Nuke'");
$foundrecords = !$result->EOF;                 

if ($foundrecords) {
$result = $dbconn->Execute("DELETE FROM ".$prefix."_modules WHERE pn_name='Past_Nuke'");
}
$result = $dbconn->Execute("INSERT INTO ".$prefix."_modules 
							VALUES ($maxpnid,
									'Past_Nuke',
									1,
									'Past Nuke',
									'Old Postnuke Admin compatibility',
									0,
									'NS-Past_Nuke',
									'1.0',
									1,
									0,
									1)")
or die("<b>"._NOTUPDATED.$prefix."_modules (Past_Nuke)</b>");

$maxpnid++;

$result = $dbconn->Execute("SELECT pn_name FROM ".$prefix."_modules where pn_name='NewUser'");
$foundrecords = !$result->EOF;                 

if ($foundrecords) {
$result = $dbconn->Execute("DELETE FROM ".$prefix."_modules WHERE pn_name='NewUser'");
}
$result = $dbconn->Execute("INSERT INTO ".$prefix."_modules 
							VALUES ($maxpnid,
									'NewUser',
									1,
									'NewUser',
									'New User for Envolution.',
									21,
									'NS-NewUser',
									'0.5',
									0,
									0,
									3)")
or die("<b>"._NOTUPDATED.$prefix."_modules (NewUser)</b>");

$maxpnid++;

$result = $dbconn->Execute("SELECT pn_name FROM ".$prefix."_modules where pn_name='postbbcode'");
$foundrecords = !$result->EOF;                 

if ($foundrecords) {
$result = $dbconn->Execute("DELETE FROM ".$prefix."_modules WHERE pn_name='postbbcode'");
}
$result = $dbconn->Execute("INSERT INTO ".$prefix."_modules 
							VALUES ($maxpnid,
									'postbbcode',
									1,
									'postbbcode',
									'BBcode for use in Envolution.',
									46,
									'postbbcode',
									'0.1',
									0,
									1,
									3)")
or die("<b>"._NOTUPDATED.$prefix."_modules (postbbcode)</b>");

// Check there is at least 1 story
$result = $dbconn->Execute("SELECT * FROM ".$prefix."_stories");
if ($result->EOF) {
  // Insert at least a new
$dbconn->Execute("INSERT INTO ".$prefix."_stories
                                VALUES (1,
                                                1,
                                                '1',
                                                '"._ENCOREF8."',
                                                '2002-05-31 09:07:11',
                                                '"._ENCOREF9.".',
                                                '',
                                                0,
                                                0,
                                                1,
                                                '"._VOC60."',
                                                '',
                                                0,
                                                '',
                                                '',
                                                0,
                                                0)");
  
}
?>
update_functions.php (application/octet-stream, 6.3 KB)
<?php
// File: $Id: Exp $ $Name:  $
// ----------------------------------------------------------------------------
// Envolution Content Management System
// Copyright (C) 2002 by the Envolution Development Team.
// http://www.envolution.com/
// ----------------------------------------------------------------------------
// Based on:
// Postnuke Content Management System - www.postnuke.com
// PHP-NUKE Web Portal System - http://phpnuke.org/
// ----------------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program 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.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------------
// Original Author of file:
// Purpose of file: Include the functions needed for the table validation
// ----------------------------------------------------------------------------

/************************************************************************/
/* Function: CheckForField                                              */
/* Purpose: Returns true if field exists, false otherwise               */
/************************************************************************/
function CheckForField($field_name, $table_name)
{
    $result = mysql_query("desc $GLOBALS[prefix]_$table_name");
    while ($row = mysql_fetch_array($result)) {
        if ($row[Field] == $field_name) {
            return (true);
        }
    }

    return(false);
}

/***********************************************************************/
/* Function: GetFieldType                                              */
/* Purpose: Returns a string containing the datatype, false on error   */
/***********************************************************************/
function GetFieldType($field_name, $table_name)
{
    $result = mysql_query("desc $GLOBALS[prefix]_$table_name");
    while ($row = mysql_fetch_array($result)) {
        if ($row[Field] == $field_name) {
            return ($row[Type]);
        }
    }
    return (false);
}

/************************************************************************/
/* Function: CheckTableExists                                           */
/* Purpose: Returns true if the table exists.  False if not             */
/************************************************************************/
function CheckTableExists($table_name)
{
    $result = mysql_list_tables($GLOBALS[dbname]);
    while ($row = mysql_fetch_row($result))
    {
        if ($row[0] == "$GLOBALS[prefix]_$table_name")
        {
            return true;
        }
    }
    return false;
}

/************************************************************************/
/* Function: GetFields                                                  */
/* Purpose: Returns an array of the fields                              */
/************************************************************************/
function GetFields($table_name)
{
    $result = mysql_list_fields($GLOBALS[dbname], "$GLOBALS[prefix]_$table_name");
    $total = mysql_num_fields($result);
    for ($i = 0; $i < $total; $i++)
    {
        // name
        $field_name = mysql_field_name($result, $i);
        // type & size
        $result2 = mysql_query("desc $GLOBALS[prefix]_$table_name");
        while ($row = mysql_fetch_array($result2))
        {
            if ($row[Field] == $field_name)
            {
                $field_type = $row[Type];
                $field_default = $row['Default'];
            }
        }
        if (strstr($field_type, '('))
        {
            $data = explode('(', $field_type);
            $data2 = explode(')', $data[1]);
            $field_type = $data[0];
            $field_size = $data2[0];
        } else {
            $field_size = mysql_field_len($result, $i);
        }
        // flags
        $field_flags = '';
        $flags = explode(' ',mysql_field_flags($result, $i));
        foreach ($flags as $k=>$v)
        { // just makes things easer :-)
            $field_flags[$v] = true;
        }
        // put it all together
        $fields[$field_name] = array (
            'type'              => $field_type,
            'def'               => $field_default,
            'auto_increment'    => $field_flags[auto_increment],
            'binary'            => $field_flags[binary],
            'blob'              => $field_flags[blob],
            'enum'              => $field_flags[enum],
            'multiple_key'      => $field_flags[multiple_key],
            'not_null'          => $field_flags[not_null],
            'primary_key'       => $field_flags[primary_key],
            'timestamp'         => $field_flags[timestamp],
            'unique_key'        => $field_flags[unique_key],
            'unsigned'          => $field_flags[unsigned],
            'zerofill'          => $field_flags[zero_fill]
        );
        switch ($field_type)
        { // need to add enum/set code someday
            case 'float':
            case 'decimal':
                $fsize = explode(',',$field_size);
                $fields[$field_name][size] = $fsize[0];
                $fields[$field_name][fraction] = $fsize[1];
                break;
            default:
                $fields[$field_name][size] = $field_size;
                break;
        }
    }
    return $fields;
}

function SaveConfigValue($module, $name, $value, $overwrite) {
  $dbconn = $GLOBALS[dbconn];
  $prefix = $GLOBALS[prefix];
  
  $result = $dbconn->Execute("SELECT pn_value from ".$prefix."_module_vars WHERE pn_name='".$name."' AND pn_modname='".$module."'");
  if ($result->EOF) {
    $dbconn->Execute("INSERT INTO ".$prefix."_module_vars (pn_modname,pn_name,pn_value) VALUES ('".$module."','".$name."','".serialize($value)."')");
  } else {
    if ($overwrite) {
      $dbconn->Execute("UPDATE ".$prefix."_module_vars SET pn_value='".serialize($value)."' WHERE pn_modname='".$module."' AND pn_name='".$name."'" );
	}
  }
  
}
?>
Encompass.php (application/octet-stream, 15.3 KB)
<?php
//
// Upgrade script for module Emcompass used with Postnuke to Encompass Theme Engine used in
// Envolution 1.0
//
// Version: 1.0.0
// Date: 2002/09/02
// Author: Marino Carlos
// 
include_once("install/update_functions.php");

function UpdateEncompass() {

  $dbconn = $GLOBALS[dbconn];
  $prefix = $GLOBALS[prefix];
  $numthemes = 7; // number of new themes with Envolution
  
  // Check for previuos installed version of Encompass
  if (CheckTableExists("theme_config")) {
    $result = $dbconn->Execute("RENAME TABLE ".$prefix."_theme_config to tempup_theme_config" );
  }
  if (CheckTableExists("theme_zones")){
    $result = $dbconn->Execute("RENAME TABLE ".$prefix."_theme_zones to tempup_theme_zones" );
  }
  
  if (!CheckTableExists("theme_layout")) {
    $result = $dbconn->Execute("CREATE TABLE ".$prefix."_theme_layout (
			skin_id int(3) NOT NULL default '0',
			zone_label varchar(20) NOT NULL default '',
			tpl_file varchar(20) NOT NULL default '',
		KEY (skin_id))")  ;
  }
  
  if (!CheckTableExists("theme_skins")) {
    $result = $dbconn->Execute("CREATE TABLE ".$prefix."_theme_skins (
			skin_id int(3) NOT NULL auto_increment,
			name varchar(60) NOT NULL default '',
			is_active int(1) NOT NULL default '0',
			is_multicolor int(1) NOT NULL default '0',
			bgcolor1 varchar(12) NOT NULL default '#FFFFFF',
			bgcolor2 varchar(12) NOT NULL default '#FFFFFF',
			bgcolor3 varchar(12) NOT NULL default '#FFFFFF',
			bgcolor4 varchar(12) NOT NULL default '#FFFFFF',
			bgcolor5 varchar(12) NOT NULL default '#FFFFFF',
			bgcolor6 varchar(12) NOT NULL default '#FFFFFF',
			sepcolor varchar(12) NOT NULL default '#000000',
			textcolor1 varchar(12) NOT NULL default '#000000',
			textcolor2 varchar(12) NOT NULL default '#000000',
		PRIMARY KEY  (skin_id))");
  }
  
  // Try to create the table. Will fail if it exists. Not the most elegant, but does the work.
  $result = $dbconn->Execute("CREATE TABLE ".$prefix."_theme_config (
			name varchar(20) NOT NULL default '',
			skin_id int(3) NOT NULL NOT NULL default '1',
			description varchar(60) NOT NULL default '',
			setting varchar(10) NOT NULL default '',
			data varchar(150) NOT NULL default '',
		KEY (skin_id))");  
  
  // Try to create the table. Will fail if it exists. Not the most elegant, but does the work.
  $result = $dbconn->Execute("CREATE TABLE ".$prefix."_theme_zones (
			zone_id int(3) NOT NULL auto_increment,
			skin_id int(3) NOT NULL default '1',
			name varchar(40) NOT NULL default 'No Name',
			label varchar(20) NOT NULL default 'addon',
			type int(1) NOT NULL default '1',
			is_active int(1) NOT NULL default '0',
		PRIMARY KEY  (zone_id),
		KEY (skin_id))");
  
  // Get all the skins already installed on the system.
  // If there are previously installed skins, insert the config and zones on their tables,
  // asigning the correct skin_id
  
  $result = $dbconn->Execute("SELECT DISTINCT skin_id from ".$prefix."_theme_skins");
  while (!$result->EOF) {
    list($skinid) = $result->fields;
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_config (name,skin_id,description,setting,data) SELECT name,$skinid,description,setting,data FROM tempup_theme_config");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (zone_id,skin_id,name,label,type,is_active) SELECT zone_id,$skinid,name,label,type,is_active FROM tempup_theme_zones");
	$result->MoveNext();
  }

  // We don need old config and zones tables any more. Data should be converted in the new tables at this point
  $dbconn->Execute("DROP TABLE tempup_theme_config");
  $dbconn->Execute("DROP TABLE tempup_theme_zones");
  
  // Get the max number for skin_id. We will insert new skins from that number + 1
  $result = $dbconn->Execute("SELECT MAX(skin_id) FROM ".$prefix."_theme_skins");
  if (!$result->EOF) {
    list($maxskinid) = $result->fields;
  } else {
    $maxskinid = 0;
  }

  //Insert skin LogicII
  $dbconn->Execute("INSERT INTO ".$prefix."_theme_skins
                                VALUES (".($maxskinid + 1).",
                                                'LogicII',
                                                1,
                                                0,
                                                '#EFEFEF',
                                                '#C1C2C3',
                                                '#CFCFBB',
                                                '#F7F7F0',
                                                '#FFFFFF',
                                                '#000066',
                                                '#D1CDD2',
                                                '#000000',
                                                '#000000')");

  // Insert skin Envolved
  $dbconn->Execute("INSERT INTO ".$prefix."_theme_skins
                                VALUES (".($maxskinid + 2).",
                                                'Envolved',
                                                1,
                                                0,
                                                '#415E74',
                                                '#415E74',
                                                '#415E74',
                                                '#415E74',
                                                '#99B7CC',
                                                '#415E74',
                                                '#415E74',
                                                '#FFFFFF',
                                                '#FFFFFF')");
  // Insert skin LiquidLogic
  $dbconn->Execute("INSERT INTO ".$prefix."_theme_skins
                                VALUES (".($maxskinid + 3).",
                                                'LiquidLogic',
                                                1,
                                                0,
                                                '#999999',
                                                '#0066CC',
                                                '#999999',
                                                '#CCCCCC',
                                                '#FFFFFF',
                                                '#0066CC',
                                                '#D1CDD2',
                                                '#000000',
                                                '#000000')");
  // Insert skin DuskyBlue
  $dbconn->Execute("INSERT INTO ".$prefix."_theme_skins
                                VALUES (".($maxskinid + 4).",
                                                'DuskyBlue',
                                                1,
                                                0,
                                                '#FFFFFF',
                                                '#CFD5E9',
                                                '#A5B4C4',
                                                '#778899',
                                                '#333333',
                                                '#000000',
                                                '#000000',
                                                '#000000',
                                                '#FFFFFF')");
  // Insert skin X-Indus
  $dbconn->Execute("INSERT INTO ".$prefix."_theme_skins
                                VALUES (".($maxskinid + 5).",
                                                'X-Indus',
                                                1,
                                                0,
                                                '#FFFFFF',
                                                '#D9D9FC',
                                                '#999999',
                                                '#D9D9FC',
                                                '#FFFFFF',
                                                '#0066CC',
                                                '#D1CDD2',
                                                '#000000',
                                                '#000000')");

  // Insert skin PiterpanV2												
  $dbconn->Execute("INSERT INTO ".$prefix."_theme_skins
                                VALUES (".($maxskinid + 6).",
                                                'PiterpanV2',
                                                1,
                                                0,
                                                '#FEFEFE',
                                                '#FEFEFE',
                                                '#E9EDF5',
                                                '#E9EDF5',
                                                '#003058',
                                                '#000066',
                                                '#505050',
                                                '#505050',
                                                '#505050')");
  
  // Insert configuration, zones and layout for the newly inserted skins.
  // $maxskinid still has the max skin_id that was on the table prior to the insertion
  // of new themes. Just insert a copy of settings for all the new skins.
  
  for ($i=1;$i<$numthemes;$i++) {
    $maxskinid ++;
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_config
                                VALUES ('pagewidth',$maxskinid,'"._ENPAGEWIDTH."','100%','')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_config
                                VALUES ('lcolwidth',$maxskinid,'"._ENLCOLWIDTH."','140','')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_config
                                VALUES ('rcolwidth',$maxskinid,'"._ENRCOLWIDTH."','170','')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_config
                                VALUES ('indexcol',$maxskinid,'"._ENINDEXCOL."','1','')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_config
                                VALUES ('righton',$maxskinid,'"._ENRIGHTON."','0','')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_config
                                VALUES ('iblkwidth',$maxskinid,'"._ENINBLKWIDTH."','145','')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'master1','master1.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'master2','master2.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'lsblock','lsblock.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'rsblock','rsblock.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'table1','table1.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'table2','table2.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'News-index','News-index.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'News-article','News-article.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid,'News-index2','News-index2.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'topcenter', 'topcenter2.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'tcblock', 'tcblock.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'botcenter', 'botcenter.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'bcblock', 'bcblock.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'inblock', 'inblock.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'isblock', 'isblock.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'dsblock', 'dsblock.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_layout
                                VALUES ($maxskinid, 'mainmenu', 'mainmenu.tpl')");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENMASTER1."', 'master1', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENMASTER2."', 'master2', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENOPENTABLE1."', 'table1', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENOPENTABLE2."', 'table2', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENLEFTSIDEB."', 'lsblock', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENRIGHTSIDEB."', 'rsblock', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENNEWSINDEX."', 'News-index', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENNEWSART."', 'News-article', 0, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENNEWSINDEX2."', 'News-index2', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENTOPCENTERBLOCK."', 'topcenter', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENTOPCENTERBOX."', 'tcblock', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENBOTCENTERBLOCK."', 'botcenter', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENBOTCENTERBOX."', 'bcblock', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENINNER."', 'inblock', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENDEFAULTSIDEB."', 'isblock', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENDEFAULTSIDE."', 'dsblock', 1, 1)");
	$dbconn->Execute("INSERT INTO ".$prefix."_theme_zones (skin_id,name,label,type,is_active)
                                VALUES ($maxskinid, '"._ENMAINMENUB."', 'mainmenu', 1, 1)");

  }
  // That's all folks
}
?>