Plugin Directory

Changeset 807453


Ignore:
Timestamp:
11/20/2013 12:39:26 PM (12 years ago)
Author:
kilozwo
Message:

publisched version 1.0.2:

1.0.2

  • Threw out German language in the Mail-subject. Thanks to Colin.
Location:
new-post-notification
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • new-post-notification/tags/1.0.1/npn_plugin.php

    r796568 r807453  
    4444        if ($key == 'administrator') $access = true;
    4545      }
    46       if ($access==true AND get_the_author_meta( 'npn_mailnotify', $user->ID )=='1' AND get_post_meta( $post_ID, 'npn_notified', true) != '1') wp_mail( $user->data->user_email, '[kilozwo] Neuer Beitrag: '.$postobject->post_title, npn_generate_mail_content($postobject,$postcontent,$postthumb,$user->ID));
     46      if ($access==true AND get_the_author_meta( 'npn_mailnotify', $user->ID )=='1' AND get_post_meta( $post_ID, 'npn_notified', true) != '1') wp_mail( $user->data->user_email, '['.get_option('blogname').'] '.__('New Post','npn_plugin').': '.$postobject->post_title, npn_generate_mail_content($postobject,$postcontent,$postthumb,$user->ID));
    4747     }
    4848    update_post_meta($post_ID, 'npn_notified', '1', true);
  • new-post-notification/trunk/languages/npn_plugin-de_DE.po

    r796497 r807453  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: New Post Notification v1.0\n"
     3"Project-Id-Version: New Post Notification v1.0.2\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: \n"
    6 "PO-Revision-Date: 2013-10-28 03:59:09-0500\n"
     6"PO-Revision-Date: 2013-11-20 06:33:04-0600\n"
    77"Last-Translator: jan <jan-eichhorn@gmx.de>\n"
    88"Language-Team: \n"
     
    2121"X-Textdomain-Support: yes"
    2222
    23 #: npn_plugin.php:71
     23#: npn_plugin.php:76
    2424#@ npn_plugin
    2525msgid "Hello"
    2626msgstr "Hallo"
    2727
    28 #: npn_plugin.php:72
     28#: npn_plugin.php:77
    2929#@ npn_plugin
    3030msgid "at"
    3131msgstr "auf"
    3232
    33 #: npn_plugin.php:74
     33#: npn_plugin.php:79
    3434#@ npn_plugin
    3535msgid "You can always deactivate the subscription in your"
    3636msgstr "Du kannst dieses Benachrichtigung jederzeit deaktivieren: "
    3737
    38 #: npn_plugin.php:74
     38#: npn_plugin.php:79
    3939#@ npn_plugin
    4040msgid "Profile"
    4141msgstr "Mein Profil"
    4242
    43 #: npn_plugin.php:84
     43#: npn_plugin.php:89
    4444#@ npn_plugin
    4545msgid "Notificationservice"
    4646msgstr "Benachrichtigungsdienst"
    4747
    48 #: npn_plugin.php:89
     48#: npn_plugin.php:94
    4949#@ npn_plugin
    5050msgid "Email Subscription"
    5151msgstr "Email-Abonement"
    5252
    53 #: npn_plugin.php:93
     53#: npn_plugin.php:98
    5454#@ npn_plugin
    5555msgid "Notify me via email if a new post is published."
    5656msgstr "Benachrichtige mich über neue Beiträge per Email."
    5757
    58 #: npn_plugin.php:106
     58#: npn_plugin.php:111
    5959#@ npn_plugin
    6060msgid "activated subscription to posts."
    6161msgstr "hat das Email-Abo aktiviert."
    6262
    63 #: npn_plugin.php:107
     63#: npn_plugin.php:112
    6464#@ npn_plugin
    6565msgid "deactivated subscription to posts."
    6666msgstr "hat das Email-Abo deaktiviert."
    6767
    68 #: npn_plugin.php:127
     68#: npn_plugin.php:132
    6969#@ npn_plugin
    7070msgid "Mail subscription"
    7171msgstr "Email-Abo"
    7272
    73 #: npn_plugin.php:136
    74 #@ npn_plugin
    75 msgid "activ"
    76 msgstr "aktiv"
    77 
    78 #: npn_plugin.php:136
     73#: npn_plugin.php:141
    7974#@ npn_plugin
    8075msgid "not active"
    8176msgstr "nicht aktiv"
    8277
    83 #: npn_plugin.php:72
     78#: npn_plugin.php:77
    8479#@ npn_plugin
    8580msgid "published a new post"
    8681msgstr "veröffentlichte einen neuen Beitrag"
    8782
     83#: npn_plugin.php:51
     84#@ npn_plugin
     85msgid "New Post"
     86msgstr "Neuer Beitrag"
     87
     88#: npn_plugin.php:141
     89#@ npn_plugin
     90msgid "active"
     91msgstr "aktiv"
     92
  • new-post-notification/trunk/npn_plugin.php

    r796563 r807453  
    33 * Plugin Name: New Post Notification
    44 * Plugin URI:  http://kilozwo.de/wordpress-new-post-notification-plugin
    5  * Description: Simply notifies users if a new post has been published. When using User-Access-Manager, users will only be notified if they have access.
     5 * Description: Simply notifies users if a new post has been published. This is an addon for User-Access-Manager. Users will only be notified if they have access.
    66 * Version:     1.0.2
    77 * Author:      Jan Eichhorn
     
    3434
    3535    // get allowed groups to access post //
    36 
    3736    $allowed_groups = npn_get_allowed_groups($post_ID);
    3837
     38    // define MailHeaders
     39    //$headers  = 'MIME-Version: 1.0' . "\r\n";
     40    //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
     41
    3942    // Go through the users and check the access //
    40     foreach ($users as $user){                       //users
    41      $access = false;
    42       foreach ($user->caps as $key => $value){       //assigned capabilities to certain user
    43         if (in_array($key,$allowed_groups) AND $value == 1) $access = true;
    44         if ($key == 'administrator') $access = true;
     43    foreach ($users as $user){
     44      $access = false;
     45      if (empty($allowed_groups)) $access = true;                               // always notify every user on public posts
     46      foreach ($user->caps as $key => $value){                                  // assigned capabilities to certain user
     47        if (in_array($key,$allowed_groups) AND $value == 1) $access = true;     // check if user is in the right user-group
     48        if ($key == 'administrator') $access = true;                            // Admins always get a mail.
    4549      }
    46       if ($access==true AND get_the_author_meta( 'npn_mailnotify', $user->ID )=='1' AND get_post_meta( $post_ID, 'npn_notified', true) != '1') wp_mail( $user->data->user_email, '[kilozwo] Neuer Beitrag: '.$postobject->post_title, npn_generate_mail_content($postobject,$postcontent,$postthumb,$user->ID));
     50      // send Mail if User activated Notification and there was no notification before.
     51      if ($access==true AND get_the_author_meta( 'npn_mailnotify', $user->ID )=='1' AND get_post_meta( $post_ID, 'npn_notified', true) != '1') wp_mail( $user->data->user_email, '['.get_option('blogname').'] '.__('New Post','npn_plugin').': '.$postobject->post_title, npn_generate_mail_content($postobject,$postcontent,$postthumb,$user->ID));
    4752     }
    4853    update_post_meta($post_ID, 'npn_notified', '1', true);
     
    7782}
    7883
    79 // Einstellung im Profil //
     84// Settings in Profile //
    8085
    8186function npn_add_custom_user_profile_fields( $user ) {
     
    134139    if ( 'npn_mailnotify' == $column_name ){
    135140        $mailstatus = get_user_meta($user_id, 'npn_mailnotify');
    136         if ($mailstatus[0]=='1') {return __('activ','npn_plugin');} else {return __('not active','npn_plugin');}
     141        if ($mailstatus[0]=='1') {return __('active','npn_plugin');} else {return __('not active','npn_plugin');}
    137142    }
    138143    return $value;
    139144}
    140145
     146/* Not yet active.
     147// activate subscription to all users when first activating the plugin
     148register_activation_hook(__FILE__,'npn_activate_subscription');
     149
     150function npn_activate_subscription(){
     151    $users = get_users( );
     152
     153    foreach ($users as $user){
     154        $subscription_status = get_user_meta($user->ID,'npn_mailnotify');
     155        if ($subscription_status[0] != "0") add_user_meta($user->ID,'npn_mailnotify',"1");
     156    }
     157
     158}
     159
     160*/
     161
    141162
    142163?>
  • new-post-notification/trunk/readme.txt

    r796563 r807453  
    55Requires at least: 3.0.1
    66Tested up to: 3.7.1
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Simply notifies users if a new post has been published. When using User-Access-Manager, users will only be notified if they have access.
     11Simply notifies users if a new post has been published. This is an addon for User-Access-Manager. Users will only be notified if they have access.
    1212
    1313== Description ==
     
    2626== Screenshots ==
    2727
    28 1. The notification can be activated in the users profile. (Screenshot in German)
     281. The notification can be activated in the users profile.
    2929
    3030
    3131== Changelog ==
     32
     33= 1.0.2 =
     34* Threw out German language in the Mail-subject. Thanks to Colin.
    3235
    3336= 1.0.1 =
Note: See TracChangeset for help on using the changeset viewer.