WordPress.org

Plugin Directory

Changeset 536985


Ignore:
Timestamp:
04/26/12 21:37:50 (2 years ago)
Author:
jmdodd
Message:

General cleanup

Location:
bbpress-email-notifications/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bbpress-email-notifications/trunk/bbpress-email-notifications.php

    r536906 r536985  
    33Plugin Name: bbPress Email Notifications 
    44Description: Provide notification emails and controls for bbPress subscriptions, merge, and split functions.  
    5 Version: 0.1.2 
     5Version: 0.2 
    66Author: Jennifer M. Dodd 
    77Author URI: http://uncommoncontent.com/ 
  • bbpress-email-notifications/trunk/includes/ucc-ben-loader.php

    r536906 r536985  
    1111    public static $headers; 
    1212    public static $unsubscribe; 
     13    public static $defaults; 
    1314     
    1415    public function __construct() { 
    1516        self::$instance = $this; 
    1617        add_action( 'bbp_init', array( $this, 'init' ), 11 ); 
    17         $this->version = '2012042603'; 
     18        $this->version = '2012042605'; 
    1819        $this->headers = "MIME-Version: 1.0\r\nContent-Type: text/html; charset=ISO-8859-1\r\n"; 
     20 
     21        $defaults = array(); 
     22        $defaults['subscriptions'] = apply_filters( 'ucc_ben_default_subscriptions', 'yes' ); 
     23        $defaults['merge'] = apply_filters( 'ucc_ben_default_merge', 'yes' ); 
     24        $defaults['split'] = apply_filters( 'ucc_ben_default_split', 'yes' ); 
     25        $this->defaults = $defaults; 
     26         
    1927    } 
    2028 
     
    2533 
    2634            $this->unsubscribe = __( '<br /><br />You can manage your email subscriptions in your Member Profile > Settings > Notifications.', 'bbpress-email-notifications' ); 
    27  
    28             // Make a better unsubscribe page for BuddyPress users of bbPress. 
    29             // add_action( 'bp_subscription_settings' ); 
    3035        } else { // Otherwise use WordPress user profile. 
    3136            add_action( 'edit_user_profile', array( &$this, 'wp_notification_settings' ) ); 
     
    4853 
    4954        if ( ! $subscriptions = get_user_meta( $bp->displayed_user->id, 'notification_bbpress_subscriptions', true ) ) 
    50             $subscriptions = 'yes'; 
     55            $subscriptions = $this->defaults['subscriptions']; 
    5156 
    5257        if ( ! $notify_on_merge = get_user_meta( $bp->displayed_user->id, 'notification_bbpress_merge', true ) ) 
    53             $notify_on_merge = 'no'; 
     58            $notify_on_merge = $this->defaults['merge']; 
    5459 
    5560        if ( ! $notify_on_split = get_user_meta( $bp->displayed_user->id, 'notification_bbpress_split', true ) ) 
    56             $notify_on_split = 'no'; 
     61            $notify_on_split = $this->defaults['split']; 
    5762         
    5863        ?> 
     
    98103    public function wp_notification_settings( $user ) { 
    99104        if ( ! $subscriptions = get_user_meta( $user->ID, 'notification_bbpress_subscriptions', true ) ) 
    100             $subscriptions = 'yes'; 
     105            $subscriptions = $this->defaults['subscriptions']; 
    101106 
    102107        if ( ! $notify_on_merge = get_user_meta( $user->ID, 'notification_bbpress_merge', true ) ) 
    103             $notify_on_merge = 'no'; 
     108            $notify_on_merge = $this->defaults['merge']; 
    104109 
    105110        if ( ! $notify_on_split = get_user_meta( $user->ID, 'notification_bbpress_split', true ) ) 
    106             $notify_on_split = 'no'; 
     111            $notify_on_split = $this->defaults['split']; 
    107112 
    108113        ?> 
     
    174179        foreach ( (array) $user_ids as $user_id ) { 
    175180            $notify_me = get_user_meta( $user_id, 'notification_bbpress_subscriptions', true ); 
    176             if ( ( $notify_me == 'yes' ) || ! $notify_me )  
     181            if ( ( $notify_me == 'yes' ) || ( $this->defaults['subscriptions'] == 'yes' ) )  
    177182                $cleaned_user_ids[] = $user_id; 
    178183        } 
     
    183188    public function notify_on_merge( $destination_topic_id, $source_topic_id ) { 
    184189        $author_id = bbp_get_topic_author_id( $source_topic_id ); 
    185         if ( 'yes' == get_user_meta( $author_id, 'notification_bbpress_merge', true ) ) { 
     190        $notify_me = get_user_meta( $author_id, 'notification_bbpress_merge', true ); 
     191        if ( ( $notify_me == 'yes' ) || ( $this->defaults['merge'] == 'yes' ) ) { 
    186192            $to = bbp_get_topic_author_email( $source_topic_id ); 
    187193            $to = apply_filters( 'ucc_ben_notify_on_merge_to', $to, $destination_topic_id, $source_topic_id ); 
     
    207213    public function notify_on_split( $from_reply_id, $source_topic_id, $destination_topic_id ) { 
    208214        $author_id = bbp_get_reply_author_id( $from_reply_id ); 
    209         if ( 'yes' ==  get_user_meta( $author_id, 'notification_bbpress_split', true ) ) { 
     215        $notify_me = get_user_meta( $author_id, 'notification_bbpress_split', true ); 
     216        if ( ( $notify_me == 'yes' ) || ( $this->defaults['split'] == 'yes' ) ) { 
    210217            $to = bbp_get_reply_author_email( $from_reply_id ); 
    211218            $to = apply_filters( 'ucc_ben_notify_on_split_to', $to, $from_reply_id, $source_topic_id, $destination_topic_id ); 
     
    231238 
    232239new UCC_bbPress_Email_Notifications; 
    233  
  • bbpress-email-notifications/trunk/languages/bbpress-email-notifications.pot

    r536906 r536985  
    33msgid "" 
    44msgstr "" 
    5 "Project-Id-Version: bbPress Email Notifications 0.1.2\n" 
     5"Project-Id-Version: bbPress Email Notifications 0.2\n" 
    66"Report-Msgid-Bugs-To: http://wordpress.org/tag/bbpress-email-notifications\n" 
    7 "POT-Creation-Date: 2012-04-26 17:35:10+00:00\n" 
     7"POT-Creation-Date: 2012-04-26 21:29:30+00:00\n" 
    88"MIME-Version: 1.0\n" 
    99"Content-Type: text/plain; charset=UTF-8\n" 
     
    1313"Language-Team: LANGUAGE <LL@li.org>\n" 
    1414 
    15 #: includes/ucc-ben-loader.php:26 
     15#: includes/ucc-ben-loader.php:34 
    1616msgid "" 
    1717"<br /><br />You can manage your email subscriptions in your Member Profile > " 
     
    1919msgstr "" 
    2020 
    21 #: includes/ucc-ben-loader.php:36 
     21#: includes/ucc-ben-loader.php:41 
    2222msgid "" 
    2323"<br /><br />You can manage your email subscriptions in your User Profile." 
    2424msgstr "" 
    2525 
    26 #: includes/ucc-ben-loader.php:64 
     26#: includes/ucc-ben-loader.php:69 
    2727msgid "Forums" 
    2828msgstr "" 
    2929 
    30 #: includes/ucc-ben-loader.php:65 includes/ucc-ben-loader.php:117 
     30#: includes/ucc-ben-loader.php:70 includes/ucc-ben-loader.php:122 
    3131msgid "Yes" 
    3232msgstr "" 
    3333 
    34 #: includes/ucc-ben-loader.php:66 includes/ucc-ben-loader.php:118 
     34#: includes/ucc-ben-loader.php:71 includes/ucc-ben-loader.php:123 
    3535msgid "No" 
    3636msgstr "" 
    3737 
    38 #: includes/ucc-ben-loader.php:73 includes/ucc-ben-loader.php:125 
     38#: includes/ucc-ben-loader.php:78 includes/ucc-ben-loader.php:130 
    3939msgid "" 
    4040"A topic you have subscribed to receives a new reply<br /><em>(This overrides " 
     
    4242msgstr "" 
    4343 
    44 #: includes/ucc-ben-loader.php:79 includes/ucc-ben-loader.php:131 
     44#: includes/ucc-ben-loader.php:84 includes/ucc-ben-loader.php:136 
    4545msgid "A topic that you posted is merged into an existing topic" 
    4646msgstr "" 
    4747 
    48 #: includes/ucc-ben-loader.php:85 includes/ucc-ben-loader.php:137 
     48#: includes/ucc-ben-loader.php:90 includes/ucc-ben-loader.php:142 
    4949msgid "A reply that you posted is split into a new topic" 
    5050msgstr "" 
    5151 
    52 #: includes/ucc-ben-loader.php:110 
     52#: includes/ucc-ben-loader.php:115 
    5353msgid "Forum Notifications" 
    5454msgstr "" 
    5555 
    56 #: includes/ucc-ben-loader.php:116 
     56#: includes/ucc-ben-loader.php:121 
    5757msgid "Notify me via email when:" 
    5858msgstr "" 
    5959 
    60 #: includes/ucc-ben-loader.php:191 
     60#: includes/ucc-ben-loader.php:197 
    6161msgid "[%1$s] %2$s Merge Notification" 
    6262msgstr "" 
    6363 
    64 #: includes/ucc-ben-loader.php:197 
     64#: includes/ucc-ben-loader.php:203 
    6565msgid "Your topic %1$s has been merged into topic %2$s." 
    6666msgstr "" 
    6767 
    68 #: includes/ucc-ben-loader.php:215 
     68#: includes/ucc-ben-loader.php:222 
    6969msgid "[%1$s] %2$s Split Notification" 
    7070msgstr "" 
    7171 
    72 #: includes/ucc-ben-loader.php:221 
     72#: includes/ucc-ben-loader.php:228 
    7373msgid "Your reply in topic %1$s has been split to topic %2$s." 
    7474msgstr "" 
  • bbpress-email-notifications/trunk/readme.txt

    r536906 r536985  
    44Requires at least: 3.2.1  
    55Tested up to: 3.3.2 
    6 Stable tag: 0.1.2 
     6Stable tag: 0.2 
    77 
    88Provide notification emails and controls for bbPress subscriptions, merge, and split functions. 
     
    1212bbPress Email Notifications provides users with various email notifications relating to forum changes, as well 
    1313as the ability to turn these notifications off. It overrides the bbPress-provided 'Subscribe' function,  
    14 allowing users to turn all subscribed topic notifications off and on in one location. It also gives BuddyPress  
    15 users a Settings > Subscriptions tab from which to manage their bbPress subscriptions. WordPress users can 
    16 update their preferences at Users > Your Profile. 
     14allowing users to turn all subscribed topic notifications off and on in one location.  
    1715 
    18 This plugin deals solely with bbPress plugin forums, and not with BuddyPress's group forums.  
     16BuddyPress users can update their bbPress email preferences at Member > Settings > Notifications. WordPress 
     17users can update their preferences at Users > Your Profile. 
     18 
     19This plugin deals solely with bbPress plugin forums, and not with BuddyPress group forums.  
    1920 
    2021Filters are available for modification of plugin behavior.  
     
    2627 
    2728== Changelog == 
     29 
     30= 0.2 = 
     31* Add filters for default behavior. 
     32* Fix readme.txt for feature description. 
    2833 
    2934= 0.1.2 = 
     
    3742 
    3843== Upgrade Notice == 
     44 
     45= 0.2 = 
     46* General cleanup. 
    3947 
    4048= 0.1.2 = 
Note: See TracChangeset for help on using the changeset viewer.