From 3434d2fc37fc2db6801044ebb19541058b65271a Mon Sep 17 00:00:00 2001 From: Patrick Lockley Date: Mon, 12 Nov 2012 16:07:07 +0000 Subject: [PATCH] Added new function to get the template framework git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/branches/1.9@482 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641 --- website_code/php/template_library.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/website_code/php/template_library.php b/website_code/php/template_library.php index e4a5938490..08d4da0805 100644 --- a/website_code/php/template_library.php +++ b/website_code/php/template_library.php @@ -24,3 +24,18 @@ function get_maximum_template_number(){ } +function get_template_type($template_id){ + + global $xerte_toolkits_site; + + $row = db_query_one("SELECT template_framework as frame, {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails.template_name as tname FROM {$xerte_toolkits_site->database_table_prefix}templatedetails, {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails WHERE {$xerte_toolkits_site->database_table_prefix}templatedetails.template_type_id = {$xerte_toolkits_site->database_table_prefix}originaltemplatesdetails.template_type_id and template_id = ?", array($template_id)); + + if($row == false) { + receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "CRITICAL", "Failed to get template type", "Failed to get the template type"); + } + else { + return $row['frame'] . "_" . $row['tname']; + } + +} +