I have made a huge vB hack that I want to release tomarrow. I started the install script, but for some reason when I install my templates with the following code, the dont show up in the admin CP. They show up in the mysql, but not admin cp for some reason.
PHP Code:
require_once('./includes/adminfunctions_template.php');
function insert_template($name, $content)
{
global $DB_site;
$template = compile_template($content);
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "template WHERE title = '$name' AND styleid = '".$vboptions['templateversion']."'");
$DB_site->query("INSERT INTO " . TABLE_PREFIX . "template (templateid, title, template, template_un, styleid, templatetype, dateline, username, version) VALUES (NULL, '$name', '" . addslashes($template) . "', '" . addslashes($content) ."', '".$vboptions['templateversion']."', 'template', '" . time() . "', 'vBDownloads', '3.0.6')");
echo '<span class="smallfont">Created Template - ' . $name . '</span><br />';
}
PHP Code:
$templates = array(
'test' => '<style type="text/css">
<!--
.redalert
{
background: #FF0000;
color: #000000;
}
-->
</style>',
);
PHP Code:
foreach ($templates AS $name => $content)
{
insert_template($name);
}