wp-notify_members fatal error (Php4 to Php5.2)
-
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);
- The topic ‘wp-notify_members fatal error (Php4 to Php5.2)’ is closed to new replies.