MyBB Community Forums

Full Version: How can i delete Templates in 1.4 Beta?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can i delete Templates in 1.4 Beta 2?
i dont see any delete link against my templates that i have added.....
Yes. i don't see any delete link either. Except for admincp, you can delete them via phpmyadmin.
Seems to me you can only delete custom template sets and custom templates which I would have thought is about right to stop you from breaking your forum.
alecf is correct. If you delete the required templates that MyBB uses then you risk screwing up your forum. You can revert modified templates and you can delete custom templates. And that is exactly how it should work.
no no these were old templates not the default one.

infact to delete a template first you must delete theme relating to it then you can delete the template Smile
(2008-07-16, 06:00 PM)unramped Wrote: [ -> ]no no these were old templates not the default one.

infact to delete a template first you must delete theme relating to it then you can delete the template Smile

Nope.

if($mybb->input['action'] == "delete_template")
{
	$plugins->run_hooks("admin_style_templates_delete_template");
	
	$query = $db->query("
		SELECT t.*, s.title as set_title
		FROM ".TABLE_PREFIX."templates t
		LEFT JOIN ".TABLE_PREFIX."templatesets s ON(t.sid=s.sid)
		WHERE t.tid='".intval($mybb->input['tid'])."' AND t.sid > '-2' AND t.sid = '{$sid}'
	");
	$template = $db->fetch_array($query);
	
	// Does the template not exist?
	if(!$template)
	{
		flash_message($lang->error_invalid_template, 'error');
		admin_redirect("index.php?module=style/templates");
	}
	
	// User clicked no
	if($mybb->input['no'])
	{
		admin_redirect("index.php?module=style/templates&sid={$template['sid']}{$expand_str2}");
	}

	if($mybb->request_method == "post")
	{
		// Delete the template
		$db->delete_query("templates", "tid='{$template['tid']}'");
		
		$plugins->run_hooks("admin_style_templates_delete_template_commit");

		// Log admin action
		log_admin_action($template['tid'], $template['title'], $template['sid'], $template['set_title']);

		flash_message($lang->success_template_deleted, 'success');
		admin_redirect("index.php?module=style/templates&sid={$template['sid']}{$expand_str2}");
	}
	else
	{		
		$page->output_confirm_action("index.php?module=style/templates&action=delete_template&sid={$template['sid']}{$expand_str}", $lang->confirm_template_deletion);
	}
}

Nothing in there that says you have to delete the themes it's connected too first.



Unless of course you mean template set.