<?php
// takes all the templates in Bugdar and moves them to the database
// SVN $Id$
chdir('..');
require_once('./global.php');
$files = BSFunctions::scan_directory('templates');
$db->query("TRUNCATE TABLE " . TABLE_PREFIX . "template");
foreach ($files AS $path => $bits)
{
foreach ($bits AS $file)
{
if (BSFunctions::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() . ")");
}
}
}
?>