MyBB Community Forums

Full Version: n00b question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I am working on the MyWindows plugin right now. I have years and years of PHP experience, but this is my first plugin. How do you add a template on plugin install?

Thanks,

Zack
Insert it using sql.


$template = array(
		"tid"		=> NULL,
		"title"		=> 'template_name',
		"template"	=> $db->escape_string('<strong>Template HTML</strong>
'),
		"sid"		=> "-1",
		"version"	=> "1.0",
		"dateline"	=> "",
	);

	$db->insert_query("templates", $template);