WordPress.org

Plugin Directory

Changeset 1709769


Ignore:
Timestamp:
08/07/17 18:55:27 (6 weeks ago)
Author:
boonebgorges
Message:

Update files for 3.7.2 release.

Location:
buddypress-group-email-subscription/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • buddypress-group-email-subscription/trunk/bp-activity-subscription-digest.php

    r1624005 r1709769  
    6767    $subject = apply_filters( 'ass_digest_subject', "$title [$blogname]", $blogname, $title, $type ); 
    6868 
    69     $footer = "\n\n<div {$ass_email_css['footer']}>"; 
     69    $footer = "\n\n<div class=\"digest-footer\" {$ass_email_css['footer']}>"; 
    7070    $footer .= sprintf( __( "You have received this message because you are subscribed to receive a digest of activity in some of your groups on %s.", 'bp-ass' ), $blogname ); 
    7171    $footer = apply_filters( 'ass_digest_footer', $footer, $type ); 
     
    169169        $group_activity_ids = apply_filters( 'ass_digest_group_activity_ids', @$group_activity_ids ); 
    170170 
    171         $header = "<div {$ass_email_css['title']}>$title " . __('at', 'bp-ass')." <a href='" . $bp->root_domain . "'>$blogname</a></div>\n\n"; 
     171        $header = "<div class=\"digest-header\" {$ass_email_css['title']}>$title " . __('at', 'bp-ass')." <a href='" . $bp->root_domain . "'>$blogname</a></div>\n\n"; 
    172172        $message = apply_filters( 'ass_digest_header', $header, $title, $ass_email_css['title'] ); 
    173173 
    174174        // loop through each group for this user 
     175        $has_group_activity = false; 
    175176        foreach ( $group_activity_ids as $group_id => $activity_ids ) { 
    176177            // check to see if our activity IDs exist 
     
    179180            $activity_ids = array_keys( $activity_ids ); 
    180181 
     182            // Activities could have been deleted since being recorded for digest emails. 
     183            if ( empty( $activity_ids ) ) { 
     184                continue; 
     185            } 
     186 
     187            $has_group_activity = true; 
     188 
    181189            $group_name = $groups_info[ $group_id ][ 'name' ]; 
    182190            $group_slug = $groups_info[ $group_id ][ 'slug' ]; 
     
    185193            // Might be nice here to link to anchor tags in the message. 
    186194            if ( 'dig' == $type ) { 
    187                 $summary .= apply_filters( 'ass_digest_summary', "<li {$ass_email_css['summary']}><a href='{$group_permalink}'>$group_name</a> " . sprintf( __( '(%s items)', 'bp-ass' ), count( $activity_ids ) ) ."</li>\n", $ass_email_css['summary'], $group_slug, $group_name, $activity_ids ); 
     195                $summary .= apply_filters( 'ass_digest_summary', "<li class=\"digest-group-summary\" {$ass_email_css['summary']}><a href='{$group_permalink}'>$group_name</a> " . sprintf( __( '(%s items)', 'bp-ass' ), count( $activity_ids ) ) ."</li>\n", $ass_email_css['summary'], $group_slug, $group_name, $activity_ids ); 
    188196            } 
    189197 
     
    192200        } 
    193201 
     202        // If there's nothing to send, skip this use. 
     203        if ( ! $has_group_activity ) { 
     204            continue; 
     205        } 
     206 
     207 
    194208        // reset the user's sub array removing those sent 
    195209        $group_activity_ids_array[$type] = $group_activity_ids; 
     
    197211        // show group summary for digest, and follow help text for weekly summary 
    198212        if ( 'dig' == $type ) { 
    199             $message .= apply_filters( 'ass_digest_summary_full', __( 'Group Summary', 'bp-ass') . ":\n<ul {$ass_email_css['summary_ul']}>" .  $summary . "</ul>", $ass_email_css['summary_ul'], $summary ); 
     213            $message .= apply_filters( 'ass_digest_summary_full', __( 'Group Summary', 'bp-ass') . ":\n<ul class=\"digest-group-summaries\" {$ass_email_css['summary_ul']}>" .  $summary . "</ul>", $ass_email_css['summary_ul'], $summary ); 
    200214        } 
    201215 
     
    216230        if ( bp_get_option( 'ass-global-unsubscribe-link' ) == 'yes' ) { 
    217231            $unsubscribe_link = "$userdomain?bpass-action=unsubscribe&access_key=" . md5( $user_id . 'unsubscribe' . wp_salt() ); 
    218             $unsubscribe_message .= "\n\n<br><br><a href=\"$unsubscribe_link\">" . __( 'Disable these notifications for all my groups at once.', 'bp-ass' ) . '</a>'; 
     232            $unsubscribe_message .= "\n\n<br><br><a class=\"digest-unsubscribe-link\" href=\"$unsubscribe_link\">" . __( 'Disable these notifications for all my groups at once.', 'bp-ass' ) . '</a>'; 
    219233        } 
    220234 
     
    401415 
    402416    $group_permalink = bp_get_group_permalink( groups_get_group( array( 'group_id' => $group_id ) ) ); 
    403     $group_name_link = '<a href="'.$group_permalink.'" name="'.$group_slug.'">'.$group_name.'</a>'; 
     417    $group_name_link = '<a class="item-group-group-link" href="'.$group_permalink.'" name="'.$group_slug.'">'.$group_name.'</a>'; 
    404418 
    405419    $userdomain = ass_digest_get_user_domain( $user_id ); 
     
    409423    // add the group title bar 
    410424    if ( $type == 'dig' ) { 
    411         $group_message = "\n---\n\n<div {$ass_email_css['group_title']}>". sprintf( __( 'Group: %s', 'bp-ass' ), $group_name_link ) . "</div>\n\n"; 
     425        $group_message = "\n---\n\n<div class=\"item-group-title\" {$ass_email_css['group_title']}>". sprintf( __( 'Group: %s', 'bp-ass' ), $group_name_link ) . "</div>\n\n"; 
    412426    } elseif ( $type == 'sum' ) { 
    413         $group_message = "\n---\n\n<div {$ass_email_css['group_title']}>". sprintf( __( 'Group: %s weekly summary', 'bp-ass' ), $group_name_link ) . "</div>\n"; 
     427        $group_message = "\n---\n\n<div class=\"item-group-title\" {$ass_email_css['group_title']}>". sprintf( __( 'Group: %s weekly summary', 'bp-ass' ), $group_name_link ) . "</div>\n"; 
    414428    } 
    415429 
    416430    // add change email settings link 
    417     $group_message .= "\n<div {$ass_email_css['change_email']}>"; 
     431    $group_message .= "\n<div class=\"item-group-settings-link\" {$ass_email_css['change_email']}>"; 
    418432    $group_message .= __('To disable these notifications for this group click ', 'bp-ass'). " <a href=\"$unsubscribe_link\">" . __( 'unsubscribe', 'bp-ass' ) . '</a> - '; 
    419433    $group_message .=  __('change ', 'bp-ass') . '<a href="' . $gnotifications_link . '">' . __( 'email options', 'bp-ass' ) . '</a>'; 
     
    482496 
    483497    //$item_message = strip_tags( $action ) . ": \n"; 
    484     $item_message =  "<div {$ass_email_css['item_div']}>"; 
    485     $item_message .=  "<span {$ass_email_css['item_action']}>" . $action . ": "; 
    486     $item_message .= "<span {$ass_email_css['item_date']}>" . sprintf( __('at %s, %s', 'bp-ass'), $time_posted, $date_posted ) ."</span>"; 
     498    $item_message =  "<div class=\"digest-item\" {$ass_email_css['item_div']}>"; 
     499    $item_message .=  "<span class=\"digest-item-action\" {$ass_email_css['item_action']}>" . $action . ": "; 
     500    $item_message .= "<span class=\"digest-item-timestamp\" {$ass_email_css['item_date']}>" . sprintf( __('at %s, %s', 'bp-ass'), $time_posted, $date_posted ) ."</span>"; 
    487501    $item_message .=  "</span>\n"; 
    488502 
    489503    // activity content 
    490504    if ( ! empty( $item->content ) ) 
    491         $item_message .= "<br><span {$ass_email_css['item_content']}>" . apply_filters( 'ass_digest_content', $item->content, $item, $type ) . "</span>"; 
     505        $item_message .= "<br><span class=\"digest-item-content\" {$ass_email_css['item_content']}>" . apply_filters( 'ass_digest_content', $item->content, $item, $type ) . "</span>"; 
    492506 
    493507    // view link 
     
    498512    } 
    499513 
    500     $item_message .= ' - <a href="' . ass_get_login_redirect_url( $view_link ) .'">' . __( 'View', 'bp-ass' ) . '</a>'; 
     514    $item_message .= ' - <a class="digest-item-view-link" href="' . ass_get_login_redirect_url( $view_link ) .'">' . __( 'View', 'bp-ass' ) . '</a>'; 
    501515 
    502516    $item_message .= "</div>\n\n"; 
     
    697711    wp_clear_scheduled_hook( 'ass_digest_event' ); 
    698712 
     713    /* 
     714     * Not using bp_get_root_blog_id() since it might not be available during 
     715     * activation time. 
     716     */ 
     717    if ( defined( 'BP_ROOT_BLOG' ) ) { 
     718        /** This filter is documented in /wp-content/plugins/buddypress/bp-core/bp-core-functions.php */ 
     719        $blog_id = (int) apply_filters( 'bp_get_root_blog_id', constant( 'BP_ROOT_BLOG' ) ); 
     720    } else { 
     721        $blog_id = 1; 
     722    } 
     723 
    699724    // Custom BP root blog, so set up cron on BP sub-site. 
    700     if ( ! bp_is_root_blog() ) { 
    701         switch_to_blog( bp_get_root_blog_id() ); 
     725    if ( 1 !== $blog_id ) { 
     726        switch_to_blog( $blog_id ); 
    702727        wp_clear_scheduled_hook( 'ass_digest_event' ); 
    703728    } 
  • buddypress-group-email-subscription/trunk/bp-activity-subscription-functions.php

    r1624005 r1709769  
    403403                // Sending time! 
    404404                ass_send_email( 'bp-ges-single', $user->user_email, array( 
    405                     'tokens'  => $user_message_args, 
    406                     'subject' => $subject, 
    407                     'content' => $user_message 
     405                    'tokens'   => $user_message_args, 
     406                    'subject'  => $subject, 
     407                    'content'  => $user_message, 
     408                    'activity' => $activity_obj 
    408409                ) ); 
    409410 
     
    11761177        return; 
    11771178 
    1178     $default_gsub = apply_filters( 'ass_default_subscription_level', groups_get_groupmeta( $groups_member->group_id, 'ass_default_subscription' ), $groups_member->group_id ); 
     1179    $default_gsub = ass_get_default_subscription( $groups_member->group_id ); 
    11791180 
    11801181    if ( $default_gsub ) { 
     
    12111212 
    12121213 
    1213 // Get the default subscription settings for the group 
     1214/** 
     1215 * Gets the default subscription settings for the group. 
     1216 * 
     1217 * @param BP_Groups_Group|int $group Group object or group ID. Defaults to the current group. 
     1218 * @return string 
     1219 */ 
    12141220function ass_get_default_subscription( $group = false ) { 
    12151221    global $bp, $groups_template; 
    1216     if ( !$group ) 
     1222    if ( ! $group && isset( $groups_template->group ) ) { 
    12171223        $group =& $groups_template->group; 
    1218  
    1219     if ( isset( $group->id ) ) 
     1224    } 
     1225 
     1226    if ( is_int( $group ) ) { 
     1227        $group_id = $group; 
     1228    } elseif ( isset( $group->id ) ) { 
    12201229        $group_id = $group->id; 
    1221     else if ( isset( $bp->groups->new_group_id ) ) 
    1222         $group_id = $bp->groups->new_group_id; 
    1223  
    1224     $default_subscription =  groups_get_groupmeta( $group_id, 'ass_default_subscription' ); 
     1230    } elseif ( bp_is_group_create() ) { 
     1231        $group_id = bp_get_new_group_id(); 
     1232    } 
     1233 
     1234    $default_subscription = groups_get_groupmeta( $group_id, 'ass_default_subscription' ); 
     1235 
     1236    if ( empty( $default_subscription ) ) { 
     1237        /** 
     1238         * Filters the fallback value for a group's default subscription level. 
     1239         * 
     1240         * @param string $status   'supersub' by default. 
     1241         * @param int    $group_id ID of the group. 
     1242         */ 
     1243        $default_subscription = apply_filters( 'ass_default_subscription_level', 'supersub', $group_id ); 
     1244    } 
     1245 
    12251246    return apply_filters( 'ass_get_default_subscription', $default_subscription ); 
    12261247} 
  • buddypress-group-email-subscription/trunk/bp-activity-subscription.php

    r1624005 r1709769  
    55Description: Allows group members to receive email notifications for group activity and forum posts instantly or as daily digest or weekly summary. 
    66Author: Deryk Wenaus, boonebgorges, r-a-y 
    7 Revision Date: March 28, 2017 
    8 Version: 3.7.1 
     7Revision Date: August 7, 2017 
     8Version: 3.7.2 
    99*/ 
    1010 
     
    1616 * @var string Date string of last revision. 
    1717 */ 
    18 define( 'GES_REVISION_DATE', '2017-03-28 16:00 UTC' ); 
     18define( 'GES_REVISION_DATE', '2017-08-07 18:00 UTC' ); 
    1919 
    2020/** 
  • buddypress-group-email-subscription/trunk/readme.txt

    r1624005 r1709769  
    44Tags: buddypress, bp, activities, activity, groups, group, emails, email, notifications, notification, subscribe, subscription, digest, summary 
    55Requires at least: 3.2 (BP 1.5) 
    6 Tested up to: 4.7 (BP 2.8) 
    7 Stable tag: 3.7.1 
     6Tested up to: 4.8 (BP 2.9) 
     7Stable tag: 3.7.2 
    88 
    99== Description == 
     
    9191== Changelog == 
    9292 
     93= 3.7.2 = 
     94* Fix bug that could cause fatal errors when activating without BuddyPress. 
     95* Improve data passed to filters. 
     96* Fix invalid form markup. 
     97* Introduce new filters for disabling "Email Notice" and "Welcome Email" sections 
     98* Add CSS clases to HTML elements in digests. 
     99* Improve handling of deleted activity items when generating digests. 
     100* Fix some spelling errors. 
     101* Improve handling of default subscription level filters. 
     102 
    93103= 3.7.1 = 
    94104* Fix incorrect activity comment permalinks in digest emails. 
     
    136146= 3.5 = 
    137147* Fixes bug so that user no longer gets an email for their own group activity update 
    138 * Improved email content parsing, so that the URLs contained in links are not completed removed from the email 
     148* Improved email content parsing, so that the URLs contained in links are not completely removed from the email 
    139149* Improved JavaScript and CSS asset loading, for better cache busting 
    140150* Fixed bug that caused email footer to be repeated multiple times in certain cases 
    141 * Better support for plugin whitelabeling/changed directory names 
     151* Better support for plugin white labelling & changed directory names 
    142152* Improved compatibility with the WP Better Emails plugin 
    143153* Update JS not to use deprecated jQuery.live() 
     
    261271* Fixed bug introduced in latest BP version where when an group admin manually removes a group member in Group Admin -> Manage Members -> Remove from group, the user kept getting emails 
    262272* Added translation strings for the javascript mute/follow 
    263 * Minor code cleanup to how digest/sumaries are stored 
     273* Minor code cleanup to how digest/summaries are stored 
    264274* Added Russian translation 
    265275* Added filter to digest subject line 
  • buddypress-group-email-subscription/trunk/screen-admin.php

    r1554847 r1709769  
    105105add_action( 'bp_actions', 'ass_manage_all_members_email_update' ); 
    106106 
    107 // create a form that allows admins to email everyone in the group 
     107/** 
     108 * Options displayed on a group's "Manage > Email Options" page. 
     109 * 
     110 * This page is only visible to group admins and when the "Allow group admins 
     111 * to override subscription settings and send an email to everyone in their 
     112 * group" is enabled in the GES admin settings page. 
     113 * 
     114 * @since 2.1b2 
     115 */ 
    108116function ass_admin_notice_form() { 
    109     global $bp; 
    110  
    111117    if ( groups_is_user_admin( bp_loggedin_user_id() , bp_get_current_group_id() ) || is_super_admin() ) { 
    112         $submit_link = bp_get_groups_action_link( 'notifications' ); 
    113         ?> 
    114         <form action="<?php echo $submit_link ?>" method="post"> 
     118        /** 
     119         * Filter to display the email notice form on the "Manage > Email Options page". 
     120         * 
     121         * @since 3.7.2 
     122         * 
     123         * @param  bool $retval Defaults to true. 
     124         * @return bool 
     125         */ 
     126        $enable_email_notice = apply_filters( 'bp_group_email_subscription_enable_email_notice', true ); 
     127        if ( true === $enable_email_notice ) { 
     128    ?> 
     129 
    115130            <?php wp_nonce_field( 'ass_email_options' ); ?> 
    116131 
     
    132147                <input type="submit" name="ass_admin_notice_send" value="<?php _e('Email this notice to everyone in the group', 'bp-ass') ?>" /> 
    133148            </p> 
     149 
     150    <?php 
     151        } 
     152 
     153        /** 
     154         * Filter to display the welcome email form on the "Manage > Email Options page". 
     155         * 
     156         * @since 3.7.2 
     157         * 
     158         * @param  bool $retval Defaults to true. 
     159         * @return bool 
     160         */ 
     161        $enable_welcome = apply_filters( 'bp_group_email_subscription_enable_welcome_email', true ); 
     162        if ( true === $enable_welcome ) { 
     163    ?> 
    134164 
    135165            <br /> 
     
    161191                <input type="submit" name="ass_welcome_email_submit" value="<?php _e( 'Save', 'bp-ass' ); ?>" /> 
    162192            </p> 
    163         </form> 
     193 
    164194        <?php 
     195        } 
     196 
     197        /** 
     198         * If plugins are adding custom content to this page and we have hidden both 
     199         * the Email Notice and Welcome Email options, make sure BP's Group Extension 
     200         * API doesn't inject another submit button. 
     201         * 
     202         * To fool BP, we add a hidden submit button. 
     203         * 
     204         * @see BP_Group_Extension::maybe_add_submit_button() 
     205         */ 
     206        if ( ! $enable_email_notice && ! $enable_welcome ) { 
     207            echo '<input type="submit" style="display:none" />'; 
     208        } 
    165209    } 
    166210} 
Note: See TracChangeset for help on using the changeset viewer.