Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed to at least work with 2.1, for now

  • Loading branch information...
commit b5a89cbb339af45124bc4e35ff01df52470d7bcd 1 parent 81b2466
Austin Matzko authored

Showing 1 changed file with 16 additions and 12 deletions. Show diff stats Hide diff stats

  1. +16 12 filosofo-enroll-comments.php
28 filosofo-enroll-comments.php
@@ -3,12 +3,12 @@
3 3 Plugin Name: Filosofo Enroll Comments
4 4 Plugin URI: http://www.ilfilosofo.com/blog/enroll-comments/
5 5 Description: Filosofo Enroll Comments lets users sign up to receive emails when new comments appear.
6   -Version: 0.56
  6 +Version: 0.57
7 7 Author: Austin Matzko
8 8 Author URI: http://www.ilfilosofo.com/blog/
9 9 */
10 10
11   -/* Copyright 2005 Austin Matzko (email : if.website at gmail.com)
  11 +/* Copyright 2006 Austin Matzko (email : if.website at gmail.com)
12 12
13 13 This program is free software; you can redistribute it and/or modify
14 14 it under the terms of the GNU General Public License as published by
@@ -56,13 +56,13 @@ function activate_plugin() {
56 56
57 57 function add_enroll_checkbox($post_ID) {
58 58 global $user_ID;
59   - $notice = ($this->check_status($post_ID)) ? sprintf($this->manage_label, get_settings('siteurl') . '/wp-admin/profile.php?page=' . basename(__FILE__))
  59 + $notice = ($this->check_status($post_ID)) ? sprintf($this->manage_label, get_option('siteurl') . '/wp-admin/profile.php?page=' . basename(__FILE__))
60 60 : sprintf($this->checkbox_label, '<input type="checkbox" id="filosofo_enroll" name="filosofo_enroll" />');
61 61
62   - if ( get_settings('users_can_register') && !$this->check_status($post_ID) && !isset( $user_ID ) ) :
63   - $notice .= sprintf($this->no_comment_subscribe, get_settings('siteurl') . '/wp-register.php');
  62 + if ( get_option('users_can_register') && !$this->check_status($post_ID) && !isset( $user_ID ) ) :
  63 + $notice .= sprintf($this->no_comment_subscribe, get_option('siteurl') . '/wp-register.php');
64 64 elseif ( $user_ID && !$this->check_status($post_ID) ) :
65   - $notice .= sprintf($this->no_comment_subscribe, get_settings('siteurl') . '/wp-admin/profile.php?page=' .
  65 + $notice .= sprintf($this->no_comment_subscribe, get_option('siteurl') . '/wp-admin/profile.php?page=' .
66 66 basename(__FILE__) . '&amp;filosofo_ec_user_id=' . $user_ID . '&amp;check=' . $this->encode_user_id($user_ID) .
67 67 '&amp;post_to_enroll=' . $post_ID . '&amp;filosofo_ec_subscribe=subscribe');
68 68 endif;
@@ -154,7 +154,11 @@ function add_enrollee_post($user_ID,$comment_post_ID) {
154 154 }
155 155
156 156 function create_user() {
157   - require_once( ABSPATH . WPINC . '/registration-functions.php');
  157 + $old_regpath = ABSPATH . WPINC . '/registration-functions.php';
  158 + $new_regpath = ABSPATH . WPINC . '/registration.php';
  159 +
  160 + if ( file_exists( $old_regpath ) ) require_once( ABSPATH . WPINC . '/registration-functions.php');
  161 + else require_once( $new_regpath );
158 162
159 163 // get email prefix
160 164 $user_email = strtolower($_POST['email']);
@@ -197,14 +201,14 @@ function email_enrollees($comment_ID) {
197 201 $message .= sprintf(__('Web Site: %s'), $comment_data['comment_author_url']) . "\r\n";
198 202 $message .= sprintf(__('Message: %s'), $comment_data['comment_content']) . "\r\n";
199 203 $message .= "\r\n ------------------- \r\n";
200   - $message .= "\r\n" . sprintf(__('Manage your subscriptions by logging in here: %s'), get_settings('siteurl') . "/wp-login.php") . "\r\n";
  204 + $message .= "\r\n" . sprintf(__('Manage your subscriptions by logging in here: %s'), get_option('siteurl') . "/wp-login.php") . "\r\n";
201 205 foreach ($enrollees as $user_id) {
202 206 $message_custom = $message;
203 207 $message_custom .= $this->user_messages[$user_id];
204 208 $user = get_userdata($user_id);
205   - $unsubscribe_link = get_settings('siteurl') . '/index.php?' . 'filosofo_ec_user_id=' . $user_id . '&check=' . $this->encode_user_id($user_id) . '&filosofo_ec_post_id=' . $comment_post_ID . '&filosofo_ec_subscribe=unsubscribe&email=true';
  209 + $unsubscribe_link = get_option('siteurl') . '/index.php?' . 'filosofo_ec_user_id=' . $user_id . '&check=' . $this->encode_user_id($user_id) . '&filosofo_ec_post_id=' . $comment_post_ID . '&filosofo_ec_subscribe=unsubscribe&email=true';
206 210 $message_custom .= "\r\n" . sprintf(__('Unsubscribe From This Entry %s'),$unsubscribe_link) . "\r\n";
207   - wp_mail(stripslashes($user->user_email), sprintf(__('[%s] New Comment Posted to %s'), get_settings('blogname'), $title), $message_custom);
  211 + wp_mail(stripslashes($user->user_email), sprintf(__('[%s] New Comment Posted to %s'), get_option('blogname'), $title), $message_custom);
208 212 }
209 213 } //end function email_enrollees
210 214
@@ -234,7 +238,7 @@ function encode_user_id($user_id) {
234 238 function test_for_posts() {
235 239 global $user_ID;
236 240 if (isset($_REQUEST['filosofo_ec_subscribe'])) { //request for changes to enrollment
237   - if (trim($_REQUEST['check']) != $this->encode_user_id(trim($_REQUEST['filosofo_ec_user_id']))) die(sprintf(__('Your request has expired. Please <a href="%s">login</a> to manage your subscriptions.'), get_settings('siteurl') . "/wp-login.php"));
  241 + if (trim($_REQUEST['check']) != $this->encode_user_id(trim($_REQUEST['filosofo_ec_user_id']))) die(sprintf(__('Your request has expired. Please <a href="%s">login</a> to manage your subscriptions.'), get_option('siteurl') . "/wp-login.php"));
238 242 switch(trim($_REQUEST['filosofo_ec_subscribe'])) {
239 243 case 'subscribe':
240 244 foreach (array('page_to_enroll','post_to_enroll') as $option)
@@ -266,7 +270,7 @@ function user_subscription_page() {
266 270 ?><script type="text/javascript">
267 271 //<![CDATA[
268 272 function ajaxDelete(what, id) {
269   - ajaxDel = new sack('<?php echo get_settings('siteurl') . $_SERVER['PHP_SELF']; ?>?page=<?php echo basename(__FILE__); ?>&filosofo_ec_ajax_test=true');
  273 + ajaxDel = new sack('<?php echo get_option('siteurl') . $_SERVER['PHP_SELF']; ?>?page=<?php echo basename(__FILE__); ?>&filosofo_ec_ajax_test=true');
270 274 if ( ajaxDel.failed ) return true;
271 275 ajaxDel.myResponseElement = getResponseElement();
272 276 ajaxDel.method = 'POST';

0 comments on commit b5a89cb

Please sign in to comment.
Something went wrong with that request. Please try again.