Quote:
Originally Posted by deathemperor
I use this:
PHP Code:
function template_insert($name, $content)
{
global $DB_site;
$template = compile_template($content);
$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) ."', '-1', 'template', '" . time() . "', 'USERNAME', '3.0.7')");
}
-1 mean the default style I think but I didn't test for all style, maybe you should query all styleid and then use a while loop for that function.
|
Hello deathemperor,
Thank you very much. But does it makes sense to place my new templates in all styles? I was thinking of doing that because the most common problem that people are posting is:
"I get a blank white page. Your hack doesn't work."
And you can read this in 90% of the hack threads. If I would install my templates in all styles, I would eliminate one possible error cause.
Do you agree with me?
Cheers,
Pseudomizer