function com_uninstall()
{
    require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'defines.community.php';
    //for Joomla 1.6, in xml file, community has been renamed to JomSocial during installing plugins
    if (JVERSION >= '1.6') {
        $asset = JTable::getInstance('Asset');
        if ($asset->loadByName('com_community')) {
            $asset->delete();
        }
    }
    $db =& JFactory::getDBO();
    //remove jomsocialuser plugin during uninstall to prevent error during login/logout of joomla.
    $query = 'DELETE FROM ' . $db->nameQuote(PLUGIN_TABLE_NAME) . ' ' . 'WHERE ' . $db->nameQuote('element') . '=' . $db->quote('jomsocialuser') . ' AND ' . $db->nameQuote('folder') . '=' . $db->quote('user');
    $db->setQuery($query);
    $db->query();
    if (JVERSION >= '1.6') {
        $plugin_path = JPATH_ROOT . DS . 'plugins' . DS . 'user' . DS . 'jomsocialuser';
    } else {
        $plugin_path = JPATH_ROOT . DS . 'plugins' . DS . 'user';
    }
    if (JFile::exists($plugin_path . DS . 'jomsocialuser.php')) {
        JFile::delete($plugin_path . DS . 'jomsocialuser.php');
    }
    if (JFile::exists($plugin_path . DS . 'jomsocialuser.xml')) {
        JFile::delete($plugin_path . DS . 'jomsocialuser.xml');
    }
    removeBackupTemplate('blueface');
    removeBackupTemplate('bubble');
    removeBackupTemplate('blackout');
    return true;
}
function com_uninstall()
{
    require_once JPATH_ROOT . '/components/com_community/defines.community.php';
    $asset = JTable::getInstance('Asset');
    if ($asset->loadByName('com_community')) {
        $asset->delete();
    }
    $db = JFactory::getDBO();
    // Remove jomsocialuser plugin during uninstall to prevent error
    // during login/logout of Joomla.
    $query = 'DELETE FROM ' . $db->quoteName(PLUGIN_TABLE_NAME) . ' ' . 'WHERE ' . $db->quoteName('element') . '=' . $db->quote('jomsocialuser') . ' AND ' . $db->quoteName('folder') . '=' . $db->quote('user');
    $db->setQuery($query);
    $db->query();
    $pluginPath = JPATH_ROOT . '/plugins/user/jomsocialuser/';
    if (JFile::exists($pluginPath . 'jomsocialuser.php')) {
        JFile::delete($pluginPath . 'jomsocialuser.php');
    }
    if (JFile::exists($pluginPath . 'jomsocialuser.xml')) {
        JFile::delete($pluginPath . 'jomsocialuser.xml');
    }
    removeBackupTemplate('blueface');
    removeBackupTemplate('bubble');
    removeBackupTemplate('blackout');
    return true;
}
function com_uninstall()
{
    $db =& JFactory::getDBO();
    //remove jomsocialuser plugin during uninstall to prevent error during login/logout of joomla.
    $query = 'DELETE FROM ' . $db->nameQuote('#__plugins') . ' ' . 'WHERE ' . $db->nameQuote('element') . '=' . $db->quote('jomsocialuser') . ' AND ' . $db->nameQuote('folder') . '=' . $db->quote('user');
    $db->setQuery($query);
    $db->query();
    if (JFile::exists(JPATH_ROOT . DS . 'plugins' . DS . 'user' . 'jomsocialuser.php')) {
        JFile::delete(JPATH_ROOT . DS . 'plugins' . DS . 'user' . 'jomsocialuser.php');
    }
    if (JFile::exists(JPATH_ROOT . DS . 'plugins' . DS . 'user' . 'jomsocialuser.xml')) {
        JFile::delete(JPATH_ROOT . DS . 'plugins' . DS . 'user' . 'jomsocialuser.xml');
    }
    removeBackupTemplate('blueface');
    removeBackupTemplate('bubble');
    removeBackupTemplate('blackout');
    return true;
}