function mytwconnect_uninstall() { global $db, $PL, $cache, $lang; if (!$lang->mytwconnect) { $lang->load('mytwconnect'); } if (!file_exists(PLUGINLIBRARY)) { flash_message($lang->mytwconnect_pluginlibrary_missing, "error"); admin_redirect("index.php?module=config-plugins"); } $PL or (require_once PLUGINLIBRARY); // Drop settings $PL->settings_delete('mytwconnect'); // Delete our columns $db->query("ALTER TABLE " . TABLE_PREFIX . "users DROP `twavatar`, DROP `twbio`, DROP `twlocation`, DROP `mytw_uid`"); // Delete the plugin from cache $info = mytwconnect_info(); $shadePlugins = $cache->read('shade_plugins'); unset($shadePlugins[$info['name']]); $cache->update('shade_plugins', $shadePlugins); $PL->templates_delete('mytwconnect'); // Try to update templates require_once MYBB_ROOT . 'inc/adminfunctions_templates.php'; find_replace_templatesets('header_welcomeblock_guest', '#' . preg_quote('— <a href="{$mybb->settings[\'bburl\']}/mytwconnect.php?action=login">{$lang->mytwconnect_login}</a>') . '#i', ''); }
private function load_version() { global $cache; $this->info = mytwconnect_info(); $this->plugins = $cache->read('shade_plugins'); $this->old_version = $this->plugins[$this->info['name']]['version']; $this->version = $this->info['version']; }