Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
Bugdar - Blob - ViewGit - Blue Static
<?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() . ")");
		}
	}
}

?>