Beispiel #1
0
function events_delete($id, $what)
{
    global $wpdb, $userdata, $events_config;
    if ($id > 0) {
        if ($what == 'event') {
            $SQL = "DELETE FROM `{$wpdb->prefix}events` WHERE `id` = {$id}";
            if ($wpdb->query($SQL) == FALSE) {
                die(mysql_error());
            }
        } else {
            if ($what == 'category') {
                $SQL = "DELETE FROM `{$wpdb->prefix}events_categories` WHERE `id` = {$id}";
                if ($wpdb->query($SQL) == FALSE) {
                    die(mysql_error());
                }
            } else {
                events_return('error');
                exit;
            }
        }
    }
}
Beispiel #2
0
function events_plugin_uninstall()
{
    global $wpdb;
    // Deactivate Plugin
    $current = get_settings('active_plugins');
    array_splice($current, array_search("wp-events/wp-events.php", $current), 1);
    update_option('active_plugins', $current);
    do_action('deactivate_' . trim($_GET['plugin']));
    // Drop MySQL Tables
    $SQL = "DROP TABLE `" . $wpdb->prefix . "events`";
    mysql_query($SQL) or die(__('An unexpected error occured') . "<br />" . mysql_error());
    $SQL2 = "DROP TABLE `" . $wpdb->prefix . "events_categories`";
    mysql_query($SQL2) or die(__('An unexpected error occured') . "<br />" . mysql_error());
    // Delete Option
    delete_option('events_config');
    delete_option('events_template');
    delete_option('events_language');
    events_return('uninstall');
}
Beispiel #3
0
function events_plugin_uninstall()
{
    global $wpdb;
    // Deactivate Plugin
    $current = get_settings('active_plugins');
    array_splice($current, array_search("wp-events/wp-events.php", $current), 1);
    update_option('active_plugins', $current);
    do_action('deactivate_' . trim($_GET['plugin']));
    // Drop MySQL Tables
    $wpdb->query("DROP TABLE `{$wpdb->prefix}events`");
    $wpdb->query("DROP TABLE `{$wpdb->prefix}events_categories`");
    // Delete Option
    delete_option('events_config');
    delete_option('events_template');
    delete_option('events_language');
    events_return('uninstall');
}