<?php
/**
 * Adodis Blog package
 * @author J-Extension <contact@jextn.com>
 * @link http://www.jextn.com
 * @copyright (C) 2012 - 2013 J-Extension
 * @license GNU/GPL, see LICENSE.php for full license.
**/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
function com_uninstall() 
{
	$db			= & JFactory::getDBO();

	
	if(JFolder::exists(JPATH_ROOT.DS.'plugins'.DS.'user'.DS.'adodisblogusers')){
		JFolder::delete(JPATH_ROOT.DS.'plugins'.DS.'user'.DS.'adodisblogusers');
	}
	
	//Code for uninstall the Adodis Blog User plugin
	$query			= $db->getQuery(true);
	
	$query->select('extension_id');
	$query->from('#__extensions');
	$query->where("element = 'adodisblogusers'");
	$db->setQuery( $query);

	$extension_id 				= $db->loadResult();
	
	$query = "DELETE  FROM `#__extensions` WHERE `element`='adodisblogusers' AND `type` = 'plugin'";
	$db->setQuery( $query );
	$db->query();
	// Code ended for uninstall jeTestimonial plugin

	echo '<p> <b> <span style="color:#009933"> Adodis Blog Component and Plugin has been Uninstalled successfully </span></b> </p>';
}
?>

