Changeset 570144
- Timestamp:
- 07/10/2012 03:55:24 PM (14 years ago)
- Location:
- navayan-subscribe/trunk
- Files:
-
- 3 edited
-
ny-subscribe-define.php (modified) (1 diff)
-
ny-subscribe.php (modified) (2 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
navayan-subscribe/trunk/ny-subscribe-define.php
r569147 r570144 4 4 define('NY_PLUGIN_SUBSCRIBE_NAME', __('Navayan Subscribe') ); 5 5 define('NY_PLUGIN_SUBSCRIBE_SLUG', 'navayan-subscribe'); 6 define('NY_PLUGIN_SUBSCRIBE_VERSION', '1.1.7. 2');6 define('NY_PLUGIN_SUBSCRIBE_VERSION', '1.1.7.3'); 7 7 define('NY_PLUGIN_SUBSCRIBE_DIR', WP_PLUGIN_URL.'/'.NY_PLUGIN_SUBSCRIBE_SLUG.'/'); 8 8 define('NY_PLUGIN_SUBSCRIBE_INFO', __('Allows your website/blog visitor to easily and quickly register to your website/blog using email, name and additional field. Send subscribe notification to admin.') ); -
navayan-subscribe/trunk/ny-subscribe.php
r569147 r570144 3 3 Plugin Name: Navayan Subscribe 4 4 Description: <strong>Navayan Subscribe</strong> allows your website/blog visitor to easily and quickly register to your website/blog using email, name and additional field. Send subscribe notification to admin and new post notification to subscribers. 5 Version: 1.1.7. 25 Version: 1.1.7.3 6 6 Usage: Paste this single line code within PHP tag in your template: if ( function_exists('navayan_subscribe') ){ echo navayan_subscribe(); } or put shortcode [navayan_subscribe] in post/page 7 7 Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=amolnw2778@gmail.com&item_name=NavayanSubscribe … … 299 299 global $wpdb, $unsubscribe_page_id; 300 300 $new_post = get_post( $post_id ); 301 if ( $new_post->post_status != 'publish'){ // TO DO - is this causing an issue? 302 $send_post_content = get_option('ny_subscribe_field_new_post_content') == 1 ? $new_post->post_content : ''; 303 $blogname = get_option('blogname'); 304 $from = get_option('admin_email'); # check for current user 305 ini_set("sendmail_from","<$from>"); 306 $subject = __("New post at ". $blogname); 307 $headers = "MIME-Version: 1.0 \r\n"; 308 $headers .= "Content-type: text/html; charset=utf-8 \r\n"; 309 $headers .= "From: $blogname <$from>\r\n"; 310 311 $subscriber_query = mysql_query("SELECT ID, user_login, user_email 312 FROM ".$wpdb->prefix."users u, ".$wpdb->prefix."usermeta um 313 WHERE um.meta_key='".$wpdb->prefix."capabilities' 314 AND um.meta_value LIKE '%subscriber%' 315 AND um.user_id = u.ID ") or die(mysql_error()); 301 302 $postNewOrUpdated = $new_post->post_date == $new_post->post_modified ? 'New' : 'Updated'; 303 304 $send_post_content = get_option('ny_subscribe_field_new_post_content') == 1 ? $new_post->post_content : ''; 305 $blogname = get_option('blogname'); 306 $from = get_option('admin_email'); # check for current user 307 ini_set("sendmail_from","<$from>"); 308 $subject = __( $blogname . ': ' . $postNewOrUpdated . ' post: ' . $new_post->post_title ); 309 $headers = "MIME-Version: 1.0 \r\n"; 310 $headers .= "Content-type: text/html; charset=utf-8 \r\n"; 311 $headers .= "From: $blogname <$from>\r\n"; 312 313 $subscriber_query = mysql_query("SELECT ID, user_login, user_email 314 FROM ".$wpdb->prefix."users u, ".$wpdb->prefix."usermeta um 315 WHERE um.meta_key='".$wpdb->prefix."capabilities' 316 AND um.meta_value LIKE '%subscriber%' 317 AND um.user_id = u.ID ") or die(mysql_error()); 318 319 while ($ny_subscribers = mysql_fetch_array($subscriber_query)){ 320 $uname = get_user_meta ($sub_list['ID'], 'first_name'); 321 $uname = $uname != '' ? $uname : $ny_subscribers['user_login']; 322 $message = "<html> 323 <head></head> 324 <body> 325 <table cellpadding='0' cellspacing='0' border='0'> 326 <tr> 327 <td>".__('Hi ') . $uname ."!</td> 328 </tr> 329 <tr> 330 <td> 331 <p>".__('A new post has been published at ') . $blogname." 332 <p>".__('Please check'). " <a href='". get_post_permalink( $new_post->ID ) ."' target='_blank'>". __($new_post->post_title) ."</a></p> 333 ". __($send_post_content) ." 334 </td> 335 </tr>"; 316 336 317 while ($ny_subscribers = mysql_fetch_array($subscriber_query)){ 318 $uname = get_user_meta ($sub_list['ID'], 'first_name'); 319 $uname = $uname != '' ? $uname : $ny_subscribers['user_login']; 320 $message = "<html> 321 <head></head> 322 <body> 323 <table cellpadding='0' cellspacing='0' border='0'> 324 <tr> 325 <td>".__('Hi ') . stripslashes( $uname ) ."!</td> 326 </tr> 327 <tr> 328 <td> 329 <p>".__('A new post has been published at ') . $blogname." 330 <p>".__('Please check'). " <a href='". get_post_permalink( $new_post->ID ) ."' target='_blank'>". __($new_post->post_title) ."</a></p> 331 ". __($send_post_content) ." 332 </td> 333 </tr>"; 334 335 # APPEND UN-SUBSCRIBE LINK 336 if ( $unsubscribe_page_id ){ 337 if ( function_exists( 'fn_unsubscribe' ) ){ 338 $message .= fn_unsubscribe( $ny_subscribers['user_email'] ); 339 } 337 # APPEND UN-SUBSCRIBE LINK 338 if ( $unsubscribe_page_id ){ 339 if ( function_exists( 'fn_unsubscribe' ) ){ 340 $message .= fn_unsubscribe( $ny_subscribers['user_email'] ); 340 341 } 341 342 $message .= " </table>343 </body>344 </html>";345 346 @wp_mail( $ny_subscribers['user_email'], $subject, $message, $headers );347 342 } 343 344 $message .= " </table> 345 </body> 346 </html>"; 347 348 @wp_mail( $ny_subscribers['user_email'], stripslashes( $subject ), stripslashes( $message ), $headers ); 348 349 } 349 350 } -
navayan-subscribe/trunk/readme.txt
r569147 r570144 4 4 Requires at least: 3+ 5 5 Tested up to: 3.4.1 6 Stable tag: 1.1.7. 26 Stable tag: 1.1.7.3 7 7 Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=amolnw2778@gmail.com&item_name=NavayanSubscribe 8 8 … … 38 38 * Custom message if user is logged in 39 39 * Custom Un-Subscribe Message 40 * Checks if post is not already published40 * Checks email subject - New or Updated post 41 41 42 42 **Links:** … … 81 81 If you want to display Navayan Subscribe form in sidebar then go to 'Appearance -> Widgets', drag and drop 'Navayan Subscribe' widget in your sidebar. 82 82 83 If you feel this plugin saved your efforts, I would appreciate if you Rate it! 84 83 85 **Links:** 84 86 * [Plugin's Homepage](http://blog.navayan.com/navayan-subscribe-easy-way-to-subscribe-wordpress-website-or-blog/) … … 97 99 98 100 == Changelog == 101 102 = 1.1.7.3 (20120710) = 103 * NEW: Checks subscribe email send subject - New or Updated post 104 * FIX: Condition which was preventing email to deliver in some cases 99 105 100 106 = 1.1.7.2 (20120709) =
Note: See TracChangeset
for help on using the changeset viewer.