• I am using wp-notify_members plugin originally written by Aaron Campbell but no longer supported. My host requires that I convert to at least Php 5.2 and preferably 5.4.
    I get loads of errors on 5.4 but seem to be getting only one so far on 5.2 in subject plugin. The host says they will move to 5.4 in 2014. This is the error message:

    Fatal error: Using $this when not in object context in /homepages/14/d119..etc…/htdocs/blog/wp-content/plugins/wp-notify_members.php on line 209

    Since I am not a PHP programmer I am wondering if anyone can offer me a simple fix for this problem… I am including the 9 various lines where $this is used.. Thanks in advance…

    * Plugin Name: Notify Members (wp_notify_members.php)
    * Plugin URI: http://xavisys.com/blog/2006/12/31/wordpress-notification-plugin/
    * Description: This will allow your members to sign up to be notified of all posts or comments
    * Version: 0.2.2
    * Author: Aaron D. Campbell
    * Author URI: http://xavisys.com/blog/2006/12/31/wordpress-notification-plugin/
    ======== ============ ============
    Delivers email to recipients in plaintext
    */
    function mail ($emails = array(), $subject = ‘$subject’, $message = ‘$message ‘, $type=’text’) {
    global $comment, $post, $user, $subject, $message, $post_link, $blogname;

    if (empty($emails)) { return; }
    // Set sender details
    209 if (” == $this->myname) {
    $admin = get_userdata(1);
    211 $this->myname = $admin->display_name;
    212 $this->myemail = $admin->user_email;
    }
    $headers = “MIME-Version: 1.0\n” .
    “From: wordpress@” . preg_replace(‘#^www\.#’, ”, strtolower($_SERVER[‘SERVER_NAME’])) . “\n” .
    “Content-Type: text/plain; charset=\”” . get_option(‘blog_charset’) . “\”\n”;
    217 $headers .= “Return-Path: <” . $this->myemail . “>\n”;
    218 $headers .= “Reply-To: ” . $this->myemail . “\n”;
    $headers .= “X-Mailer:PHP” . phpversion() . “\n”;
    $headers .= “Precedence: list\nList-Id: ” . get_settings(‘blogname’) . “\n”;

    241 if ( (! empty($email)) && ($this->myemail != $email) ) {

    272 if ( (!empty($email)) && ($this->myemail != $email) ) {

    285 @wp_mail($this->myemail, $subject, $message, $newheaders);

    289 @wp_mail($this->myemail, $subject, $message, $headers);

Viewing 1 replies (of 1 total)
  • Thread Starter mydavisfamily

    (@mydavisfamily)

    Just received an email from my host that early next week they are deactivating Msql4 and pushing for php5.2.
    Hopefully someone will be able to help on a quick fix for this or I might be faced with a Fatal Error each time anyone posts or comments on my site. I’ve temporarily reverted back to Php4. I tried removing the $this-> from each occurrence but then get somehting like “parse error unexpected “=” line 211 or something like that…

    Thanks in advance.

Viewing 1 replies (of 1 total)
  • The topic ‘wp-notify_members fatal error (Php4 to Php5.2)’ is closed to new replies.