From 1b913c508285ba5b5bbf5c7a0c96ee857df44846 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 5 Jun 2005 23:29:07 +0000 Subject: [PATCH] r233: Removing template sets. Part 3 of 3 in a multi-stage commit. --- docs/recache.php | 4 ---- docs/schema_changes.sql | 4 +++- global.php | 35 +++----------------------------- includes/functions_datastore.php | 20 ------------------ 4 files changed, 6 insertions(+), 57 deletions(-) diff --git a/docs/recache.php b/docs/recache.php index c1b8b31..2a54fbd 100755 --- a/docs/recache.php +++ b/docs/recache.php @@ -44,10 +44,6 @@ build_products(); echo '

Products cached

'; -build_templatesets(); - -echo '

Template sets cached

'; - // $Id$ ?> \ No newline at end of file diff --git a/docs/schema_changes.sql b/docs/schema_changes.sql index ce200fc..c5aac84 100644 --- a/docs/schema_changes.sql +++ b/docs/schema_changes.sql @@ -56,4 +56,6 @@ ALTER TABLE `comment` ADD `hidden` INT(2) UNSIGNED NOT NULL; ALTER TABLE `bug` ADD `hiddenlastposttime` INT(10) UNSIGNED NOT NULL, ADD `hiddenlastpostby` INT(10) UNSIGNED NOT NULL; -ALTER TABLE `bug` ADD `duplicateof` INT(10) UNSIGNED NOT NULL AFTER `assignedto`, ADD `dependency` MEDIUMTEXT NOT NULL AFTER `duplicateof`; \ No newline at end of file +ALTER TABLE `bug` ADD `duplicateof` INT(10) UNSIGNED NOT NULL AFTER `assignedto`, ADD `dependency` MEDIUMTEXT NOT NULL AFTER `duplicateof`; + +DROP TABLE IF EXISTS `templateset`; \ No newline at end of file diff --git a/global.php b/global.php index da62dde..a40db63 100755 --- a/global.php +++ b/global.php @@ -12,38 +12,9 @@ require_once('./includes/init.php'); -// ################################################################### -// get the templateset -if ($bugsys->userinfo['userid']) -{ - $templatesetid = $bugsys->userinfo['templatesetid']; - $templateset = $bugsys->datastore['templateset']["$templatesetid"]; -} -if (!$templatesetid) -{ - foreach ($bugsys->datastore['templateset'] AS $templateset) - { - if ($templateset['default']) - { - $templatesetid = $templateset['templatesetid']; - $templateset = $bugsys->datastore['templateset']["$templatesetid"]; - } - } -} - -// ################################################################### -// load the template system -if (file_exists("./templates/$templateset[shortname]/tsinfo.php")) -{ - $bugsys->load('template_fs'); - $template->extension = 'tpl'; - $template->templatedir = $bugsys->fetch_sourcepath("templates/$templateset[shortname]/"); -} -else -{ - echo "template set info (templates/$templateset[shortname]/tsinfo.php) could not be loaded!"; - exit; -} +$bugsys->load('template_fs'); +$template->extension = 'tpl'; +$template->templatedir = $bugsys->fetch_sourcepath('templates/'); // ################################################################### // check for userinfo -- temp diff --git a/includes/functions_datastore.php b/includes/functions_datastore.php index 129cba3..82e51f6 100755 --- a/includes/functions_datastore.php +++ b/includes/functions_datastore.php @@ -216,26 +216,6 @@ function build_products() $bugsys->datastore['product'] = $tempstore; } -// ##################### Start build_templatesets #################### -function build_templatesets() -{ - global $bugsys; - - $templatesets = $bugsys->db->query("SELECT * FROM " . TABLE_PREFIX . "templateset"); - while ($templateset = $bugsys->db->fetch_array($templatesets)) - { - $tempstore["$templateset[templatesetid]"] = $templateset; - } - - $bugsys->db->query(" - ### replacing the template set cache ### - REPLACE INTO " . TABLE_PREFIX . "datastore (title, data) - VALUES ('templateset', '" . $bugsys->escape(serialize($tempstore)) . "')" - ); - - $bugsys->datastore['templateset'] = $tempstore; -} - /*=====================================================================*\ || ################################################################### || # $HeadURL$ -- 2.22.5