PDA

View Full Version : how can i create a php script that adds templates?


Lurk
06-16-2004, 02:12 AM
how can i create a php script that adds templates?

as i've seen in some hacks, there's a script that adds templates in the installation process. How can i create a script like that?

Lurk
06-17-2004, 04:58 PM
well??? anyone??

Velocd
06-17-2004, 05:34 PM
Via an SQL query.



Assuming you are requiring global.php on the page.

$DB_site->query("
INSERT INTO template
(
styleid, title, template, template_un, templatetype,
dateline, username, version
)
VALUES
(
{your_style_id}, 'some_name', '".addslashes($your_template)."',
'$your_template', 'template', ".time().",
'".addslashes($bbuserinfo['username'])."', '{vBulletin version}'
)
");



It's not recommended to add templates this way. Also, I think you'll need to rebuild the style (with the $debug=1) via AdminCP.