]>
src.bluestatic.org Git - bugdar.git/blob - docs/cache_templates.php
3 // takes all the templates in Bugdar and moves them to the database
7 require_once('./global.php');
9 $files = BSFunctions
::scan_directory('templates');
11 $db->query("TRUNCATE TABLE " . TABLE_PREFIX
. "template");
13 foreach ($files AS $path => $bits)
15 foreach ($bits AS $file)
17 if (BSFunctions
::fetch_extension($file) == 'tpl')
19 $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() . ")");