Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/18/2010 08:00:33 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Remove all references to Wire component (addresses #1618). This code has been moved to backpat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-notifications.php

    r2120 r2343  
    11<?php
    2 
    3 function groups_notification_new_wire_post( $group_id, $wire_post_id ) {
    4     global $bp;
    5 
    6     if ( !isset( $_POST['wire-post-email-notify'] ) )
    7         return false;
    8 
    9     $wire_post = new BP_Wire_Post( $bp->groups->table_name_wire, $wire_post_id );
    10     $group = new BP_Groups_Group( $group_id, false, true );
    11 
    12     $poster_name = bp_core_get_user_displayname( $wire_post->user_id );
    13     $poster_profile_link = bp_core_get_user_domain( $wire_post->user_id );
    14 
    15     $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ) );
    16 
    17     foreach ( $group->user_dataset as $user ) {
    18         if ( 'no' == get_usermeta( $user->user_id, 'notification_groups_wire_post' ) ) continue;
    19 
    20         $ud = get_userdata( $user->user_id );
    21 
    22         // Set up and send the message
    23         $to = $ud->user_email;
    24 
    25         $wire_link = site_url( $bp->groups->slug . '/' . $group->slug . '/wire/' );
    26         $group_link = site_url( $bp->groups->slug . '/' . $group->slug . '/' );
    27         $settings_link = bp_core_get_user_domain( $user->user_id ) . 'settings/notifications/';
    28 
    29         $message = sprintf( __(
    30 '%s posted on the wire of the group "%s":
    31 
    32 "%s"
    33 
    34 To view the group wire: %s
    35 
    36 To view the group home: %s
    37 
    38 To view %s\'s profile page: %s
    39 
    40 ---------------------
    41 ', 'buddypress' ), $poster_name, stripslashes( attribute_escape( $group->name ) ), stripslashes($wire_post->content), $wire_link, $group_link, $poster_name, $poster_profile_link );
    42 
    43         $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
    44 
    45         // Send it
    46         wp_mail( $to, $subject, $message );
    47 
    48         unset( $message, $to );
    49     }
    50 }
    512
    523function groups_notification_group_updated( $group_id ) {
Note: See TracChangeset for help on using the changeset viewer.