k added some more code at the end.
i have also tested it and noticed it only added the templates to 1 style how do i make it add to all styles
PHP Code:
foreach ($template as $temp){
$title = stripslashes($temp['title']);
$template = stripslashes($temp['template']);
$template_un = $template;
$template = compile_template($template);
if (!$preexists = $DB_site->query_first("SELECT templateid FROM " . TABLE_PREFIX . "template WHERE title = '" . addslashes($title) . "' AND styleid = $styleid"))
{
$result = $DB_site->query("
INSERT INTO " . TABLE_PREFIX . "template
(styleid, title, template, template_un, dateline, username, version)
VALUES
($styleid,
'" . addslashes("$title") . "',
'" . addslashes("$template") . "',
'" . addslashes("$template_un") . "',
" . TIMENOW . ",
'" . addslashes($bbuserinfo['username']) . "',
'" . addslashes($vboptions['templateversion']) . "')
");
}
}
build_all_styles();
print_form_header('install_templates', 'steptwo');
print_table_header("Templates Installation Script");
print_description_row("New templates added to styleid <b>$styleid</b><p>Click on \"Next\" to continue.");
print_submit_row("Next", 0);
}
// #############################################################################
// step 2
if ($_POST['do'] == "steptwo")
{
print_form_header('install_templates', '');
print_table_header("Template Installation Script");
print_description_row("Installation complete!<br><b>PLEASE DELETE THIS FILE!</b>");
}
?>