WordPress.org

Plugin Directory

Changeset 604312


Ignore:
Timestamp:
09/26/12 19:10:04 (19 months ago)
Author:
MattyRob
Message:

Fix for deprecated is-blog_user() and DreamHost changes

Location:
subscribe2/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • subscribe2/trunk/admin/subscribers.php

    r579898 r604312  
    5050        } 
    5151        if ( isset($_POST['confirm']) ) { 
     52            global $current_user; 
     53            $this->ip = $current_user->user_login; 
    5254            foreach ( $_POST['confirm'] as $address ) { 
    5355                $this->toggle($this->sanitize_email($address)); 
     
    5658        } 
    5759        if ( isset($_POST['unconfirm']) ) { 
     60            global $current_user; 
     61            $this->ip = $current_user->user_login; 
    5862            foreach ( $_POST['unconfirm'] as $address ) { 
    5963                $this->toggle($this->sanitize_email($address)); 
  • subscribe2/trunk/classes/class-s2-core.php

    r598869 r604312  
    1212        $this->profile = "<p class=\"s2_message\">" . __('You may manage your subscription options from your', 'subscribe2') . " <a href=\"" . get_option('siteurl') . "/wp-admin/admin.php?page=s2\">" . __('profile', 'subscribe2') . "</a>.</p>"; 
    1313        if ( $this->s2_mu === true ) { 
    14             global $blog_id, $user_ID; 
    15             if ( !is_blog_user($blog_id) ) { 
     14            global $blog_id; 
     15            $user_ID = get_current_user_id(); 
     16            if ( !is_user_member_of_blog($user_ID, $blog_id) ) { 
    1617                // if we are on multisite and the user is not a member of this blog change the link 
    1718                $this->profile = "<p class=\"s2_message\"><a href=\"" . get_option('siteurl') . "/wp-admin/?s2mu_subscribe=" . $blog_id . "\">" . __('Subscribe', 'subscribe2') . "</a> " . __('to email notifications when this blog posts new content', 'subscribe2') . ".</p>"; 
     
    9394        maybe_add_column($this->public, 'ip', "ALTER TABLE $this->public ADD ip char(64) DEFAULT 'admin' NOT NULL AFTER date"); 
    9495        maybe_add_column($this->public, 'time', "ALTER TABLE $this->public ADD time TIME DEFAULT '00:00:00' NOT NULL AFTER date"); 
     96        maybe_add_column($this->public, 'conf_date', "ALTER TABLE $this->public ADD conf_date DATE AFTER ip"); 
     97        maybe_add_column($this->public, 'conf_time', "ALTER TABLE $this->public ADD conf_time TIME AFTER conf_date"); 
     98        maybe_add_column($this->public, 'conf_ip', "ALTER TABLE $this->public ADD conf_ip char(64) AFTER conf_time"); 
    9599 
    96100        // let's take the time to check process registered users 
     
    828832 
    829833        if ( '0' == $status ) { 
    830             $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET active='1' WHERE CAST(email as binary)=%s", $email)); 
    831         } else { 
    832             $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET active='0' WHERE CAST(email as binary)=%s", $email)); 
     834            $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET active='1', conf_date=CURDATE(), conf_time=CURTIME(), conf_ip=%s WHERE CAST(email as binary)=%s", $this->ip, $email)); 
     835        } else { 
     836            $wpdb->get_results($wpdb->prepare("UPDATE $this->public SET active='0' conf_date=CURDATE(), conf_time=CURTIME(), conf_ip=%s WHERE CAST(email as binary)=%s", $this->ip, $email)); 
    833837        } 
    834838    } // end toggle() 
  • subscribe2/trunk/classes/class-s2_multisite.php

    r564728 r604312  
    1616 
    1717                // if user is not a user of the current blog 
    18                 if ( !is_blog_user($sub_id) ) { 
     18                if ( !is_user_member_of_blog($user_ID, $sub_id) ) { 
    1919                    // add user to current blog as subscriber 
    2020                    add_user_to_blog($sub_id, $user_ID, 'subscriber'); 
Note: See TracChangeset for help on using the changeset viewer.