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() . ")"); } } } ?>