[Solved] Deactivation Code Problem
#1
Okay, so, when I activate a plugin I'm working on, it edits one of the templates to add a link. However, when I deactivate the plugin, it doesn't remove the link that I added. I've tried 'isolating' it by giving it its own line on the template, but that doesn't seem to work. Here's the Deactivation code. If you need the part of the activation code where I add the link, let me know.

<?php
function modcp_deactivate()
{
	global $db;

	$db->delete_query(TABLE_PREFIX."settinggroups", "name='modcp' OR name='Mod CP'");
	$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN(
		'modcp_onoff',
		'modcp_ban',
		'modcp_ban_ip',
		'modcp_ban_email',
		'modcp_announce',
		'modcp_thread_queue',
		'modcp_post_queue'
	)");
	$db->delete_query(TABLE_PREFIX."templates", "title='header_welcomeblock_member_mod'");
	$db->query("DROP TABLE IF EXISTS ".TABLE_PREFIX."modoptions, ".TABLE_PREFIX."modsessions");

	// Attempt to modify header_welcome_block for the memeber template
	require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
	find_replace_templatesets("header_welcomeblock_member", '#{$modcplink}#', '', 0);
	
	if(isset($config[mod_dir]))
	{
		unset($config[mod_dir]);
	}
	
	echo "<script language=\"JavaScript\">
		  	parent.nav.location.href =  \"./index.php?".SID."&action=navigation\";
		  </script>";
}
?>

Please do not PM me about problems you might be having with MyBB. Post a thread, and someone on the support or development team will take a look at it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)