From b75fc3df2d30f820bfcd9d54660aea44adf35b3e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 20 Jul 2007 17:00:15 +0000 Subject: [PATCH] r1592: Adding a file that caches all the templates in Bugdar to the database --- docs/cache_templates.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/cache_templates.php diff --git a/docs/cache_templates.php b/docs/cache_templates.php new file mode 100644 index 0000000..3310f60 --- /dev/null +++ b/docs/cache_templates.php @@ -0,0 +1,24 @@ +scandir('templates'); + +$db->query("TRUNCATE TABLE " . TABLE_PREFIX . "template"); + +foreach ($files AS $path => $bits) +{ + foreach ($bits AS $file) + { + if ($funct->fetch_extension($file) == 'tpl') + { + $db->query("INSERT INTO " . TABLE_PREFIX . "template (filename, template, timestamp) VALUES ('$path" . substr($file, 0, strlen($file) - 4) . "', '" . $db->escape_string($template->_parse(file_get_contents("templates/$path$file"))) . "', " . time() . ")"); + } + } +} + +?> \ No newline at end of file -- 2.22.5