Changeset 807453
- Timestamp:
- 11/20/2013 12:39:26 PM (12 years ago)
- Location:
- new-post-notification
- Files:
-
- 6 added
- 5 edited
-
tags/1.0.1/npn_plugin.php (modified) (1 diff)
-
tags/1.0.2 (added)
-
tags/1.0.2/languages (added)
-
tags/1.0.2/languages/npn_plugin-de_DE.mo (added)
-
tags/1.0.2/languages/npn_plugin-de_DE.po (added)
-
tags/1.0.2/npn_plugin.php (added)
-
tags/1.0.2/readme.txt (added)
-
trunk/languages/npn_plugin-de_DE.mo (modified) (previous)
-
trunk/languages/npn_plugin-de_DE.po (modified) (2 diffs)
-
trunk/npn_plugin.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
new-post-notification/tags/1.0.1/npn_plugin.php
r796568 r807453 44 44 if ($key == 'administrator') $access = true; 45 45 } 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)); 47 47 } 48 48 update_post_meta($post_ID, 'npn_notified', '1', true); -
new-post-notification/trunk/languages/npn_plugin-de_DE.po
r796497 r807453 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: New Post Notification v1.0 \n"3 "Project-Id-Version: New Post Notification v1.0.2\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: \n" 6 "PO-Revision-Date: 2013-1 0-28 03:59:09-0500\n"6 "PO-Revision-Date: 2013-11-20 06:33:04-0600\n" 7 7 "Last-Translator: jan <jan-eichhorn@gmx.de>\n" 8 8 "Language-Team: \n" … … 21 21 "X-Textdomain-Support: yes" 22 22 23 #: npn_plugin.php:7 123 #: npn_plugin.php:76 24 24 #@ npn_plugin 25 25 msgid "Hello" 26 26 msgstr "Hallo" 27 27 28 #: npn_plugin.php:7 228 #: npn_plugin.php:77 29 29 #@ npn_plugin 30 30 msgid "at" 31 31 msgstr "auf" 32 32 33 #: npn_plugin.php:7 433 #: npn_plugin.php:79 34 34 #@ npn_plugin 35 35 msgid "You can always deactivate the subscription in your" 36 36 msgstr "Du kannst dieses Benachrichtigung jederzeit deaktivieren: " 37 37 38 #: npn_plugin.php:7 438 #: npn_plugin.php:79 39 39 #@ npn_plugin 40 40 msgid "Profile" 41 41 msgstr "Mein Profil" 42 42 43 #: npn_plugin.php:8 443 #: npn_plugin.php:89 44 44 #@ npn_plugin 45 45 msgid "Notificationservice" 46 46 msgstr "Benachrichtigungsdienst" 47 47 48 #: npn_plugin.php: 8948 #: npn_plugin.php:94 49 49 #@ npn_plugin 50 50 msgid "Email Subscription" 51 51 msgstr "Email-Abonement" 52 52 53 #: npn_plugin.php:9 353 #: npn_plugin.php:98 54 54 #@ npn_plugin 55 55 msgid "Notify me via email if a new post is published." 56 56 msgstr "Benachrichtige mich über neue Beiträge per Email." 57 57 58 #: npn_plugin.php:1 0658 #: npn_plugin.php:111 59 59 #@ npn_plugin 60 60 msgid "activated subscription to posts." 61 61 msgstr "hat das Email-Abo aktiviert." 62 62 63 #: npn_plugin.php:1 0763 #: npn_plugin.php:112 64 64 #@ npn_plugin 65 65 msgid "deactivated subscription to posts." 66 66 msgstr "hat das Email-Abo deaktiviert." 67 67 68 #: npn_plugin.php:1 2768 #: npn_plugin.php:132 69 69 #@ npn_plugin 70 70 msgid "Mail subscription" 71 71 msgstr "Email-Abo" 72 72 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 79 74 #@ npn_plugin 80 75 msgid "not active" 81 76 msgstr "nicht aktiv" 82 77 83 #: npn_plugin.php:7 278 #: npn_plugin.php:77 84 79 #@ npn_plugin 85 80 msgid "published a new post" 86 81 msgstr "veröffentlichte einen neuen Beitrag" 87 82 83 #: npn_plugin.php:51 84 #@ npn_plugin 85 msgid "New Post" 86 msgstr "Neuer Beitrag" 87 88 #: npn_plugin.php:141 89 #@ npn_plugin 90 msgid "active" 91 msgstr "aktiv" 92 -
new-post-notification/trunk/npn_plugin.php
r796563 r807453 3 3 * Plugin Name: New Post Notification 4 4 * 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. 6 6 * Version: 1.0.2 7 7 * Author: Jan Eichhorn … … 34 34 35 35 // get allowed groups to access post // 36 37 36 $allowed_groups = npn_get_allowed_groups($post_ID); 38 37 38 // define MailHeaders 39 //$headers = 'MIME-Version: 1.0' . "\r\n"; 40 //$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 41 39 42 // 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. 45 49 } 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)); 47 52 } 48 53 update_post_meta($post_ID, 'npn_notified', '1', true); … … 77 82 } 78 83 79 // Einstellung im Profil//84 // Settings in Profile // 80 85 81 86 function npn_add_custom_user_profile_fields( $user ) { … … 134 139 if ( 'npn_mailnotify' == $column_name ){ 135 140 $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');} 137 142 } 138 143 return $value; 139 144 } 140 145 146 /* Not yet active. 147 // activate subscription to all users when first activating the plugin 148 register_activation_hook(__FILE__,'npn_activate_subscription'); 149 150 function 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 141 162 142 163 ?> -
new-post-notification/trunk/readme.txt
r796563 r807453 5 5 Requires at least: 3.0.1 6 6 Tested up to: 3.7.1 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 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.11 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. 12 12 13 13 == Description == … … 26 26 == Screenshots == 27 27 28 1. The notification can be activated in the users profile. (Screenshot in German)28 1. The notification can be activated in the users profile. 29 29 30 30 31 31 == Changelog == 32 33 = 1.0.2 = 34 * Threw out German language in the Mail-subject. Thanks to Colin. 32 35 33 36 = 1.0.1 =
Note: See TracChangeset
for help on using the changeset viewer.