Changeset 815913
- Timestamp:
- 12/06/2013 12:27:22 PM (12 years ago)
- Location:
- mailman-registration
- Files:
-
- 2 edited
- 4 copied
-
tags/0.2 (copied) (copied from mailman-registration/trunk)
-
tags/0.2/index.php (copied) (copied from mailman-registration/trunk/index.php) (6 diffs)
-
tags/0.2/languages (copied) (copied from mailman-registration/trunk/languages)
-
tags/0.2/readme.txt (copied) (copied from mailman-registration/trunk/readme.txt) (2 diffs)
-
trunk/index.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mailman-registration/tags/0.2/index.php
r810465 r815913 4 4 Plugin URI: http://www.heikoch.de 5 5 Description: Mailman Registration 6 Version: 0.0. 16 Version: 0.0.2 7 7 Author: heikoch 8 8 URI: http://www.heikoch.de … … 13 13 This plugin allows prospective customers to log on to a Mailman list. 14 14 Operation: 15 The plugin creates a txt file where the E-mail addresses are stored in the associated widget form in the upload folder of WordPress.15 The plugin creates a txt file where the E-mail addresses are stored in the associated widget or shortcode form in the upload folder of WordPress. 16 16 This txt file can then be used to write to the interested parties through a cron job on the mailing list. 17 17 Comment: … … 21 21 Dieses Plugin ermöglicht Interessenten sich an einer Mailman Liste anzumelden. 22 22 Arbeitsweise: 23 Das Plugin erzeugt im upload Ordner von Wordpress eine TXT-Datei wo dann die E-Mail Adressen aus dem zugehörigem Widget Formular gespeichert werden.23 Das Plugin erzeugt im upload Ordner von Wordpress eine TXT-Datei wo dann die E-Mail Adressen aus dem zugehörigem Widget oder Shortcode Formular oder gespeichert werden. 24 24 Diese TXT-Datei kann dann dazu genutzt werden um die Interessenten über einen Cron-Job in die Mailingliste einzutragen. 25 25 26 Bemerkung: 26 27 Dieses Plugin ist ist nur für User die auch Zugriff auf die Mailman und Cron-Job Administration des Hosting-Systems haben. Ohne Zugriff darauf funktioniert es nicht. … … 97 98 </form> 98 99 <?php } ?> 100 <h3>Shortcode</h3> 101 <p>With this Sample-Shortcode can you place a MM-Pigistration Form in your posts or pages.<br /> 102 <code>[mm_registration msg_thank_you="your_msg_thank_you" msg_error="your_msg_error" msg_email_not_valid="your_msg_email_not_valid"]</code> 103 </p> 99 104 </div> 100 105 <?php } … … 135 140 } 136 141 } 137 add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' );138 add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' );139 142 140 143 class mm_registration_widget extends WP_Widget { … … 222 225 } 223 226 add_action( 'widgets_init', 'mm_registration_register_widgets' ); 227 228 function mm_registration_shortcode_func($atts) { 229 extract( shortcode_atts( array( 230 'msg_thank_you' => '', 231 'msg_error' => '', 232 'msg_email_not_valid' => '' 233 ), $atts ) ); 234 $out ="<form id=\"mmnewsletter_shortcode\" name=\"mmnewsletter_shortcode\">\n"; 235 $out.="<input type=\"text\" name=\"email\" id=\"email\" />\n"; 236 $out.="<input id=\"mmnewsletter_shortcode_submit\" type=\"button\" class=\"button\" value=\"".__('Registration', 'mm-registration')."\" />\n"; 237 $out.="<input name=\"action\" type=\"hidden\" value=\"addmmnewsletter\" />\n"; 238 $out.="</form>\n"; 239 $out.="<div id=\"mm_registration_shortcode_out\"> </div>\n"; 240 $out.="<script type=\"text/javascript\"> 241 jQuery(document).ready(function(){ 242 jQuery('#mmnewsletter_shortcode_submit').click(function(){ 243 var email = jQuery.trim(jQuery('#email').val()); 244 var regex = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 245 if(!regex.test(email)) { 246 jQuery('#mm_registration_shortcode_out').html('<span class=\"error\">".$msg_email_not_valid."</span>'); 247 return false; 248 } else { 249 doAjaxRequest(); 250 } 251 }); 252 }); 253 function doAjaxRequest(){ 254 // here is where the request will happen 255 var request = jQuery.ajax({ 256 url: '/wp-admin/admin-ajax.php', 257 type: 'POST', 258 data:{ 259 'email': jQuery.trim(jQuery('#email').val()), 260 'action':'mm_registration_ajax' 261 }, 262 dataType: 'html' 263 }); 264 request.done(function(msg) { 265 jQuery('#mm_registration_shortcode_out').html('<span class=\"msg\">".$msg_thank_you."</span>'); 266 }); 267 request.fail(function( jqXHR, textStatus ) { 268 jQuery('#mm_registration_shortcode_out').html('<span class=\"error\">".$msg_error."</span>'); 269 }); 270 } 271 </script>\n"; 272 return $out; 273 } 274 add_shortcode( 'mm_registration', 'mm_registration_shortcode_func' ); 275 276 add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' ); 277 add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' ); 224 278 ?> -
mailman-registration/tags/0.2/readme.txt
r810465 r815913 27 27 /usr/sbin/add_members -r /pathtoyourwordpress/wp-content/uploads/yourfilename.txt nameofthemailinglist && echo "">/pathtoyourwordpress/wp-content/uploads/yourfilename.txt 28 28 The exact path you see in the admin area -> Settings -> MM-Registration. 29 = What is teh Shortcode? = 30 [mm_registration msg_thank_you="your_msg_thank_you" msg_error="your_msg_error" msg_email_not_valid="your_msg_email_not_valid"] 29 31 30 32 == Screenshots == … … 33 35 = 0.1 = 34 36 * Initial Release 37 = 0.2 = 38 * Add Shortcode functionality 35 39 36 40 == Upgrade Notice == -
mailman-registration/trunk/index.php
r810465 r815913 4 4 Plugin URI: http://www.heikoch.de 5 5 Description: Mailman Registration 6 Version: 0.0. 16 Version: 0.0.2 7 7 Author: heikoch 8 8 URI: http://www.heikoch.de … … 13 13 This plugin allows prospective customers to log on to a Mailman list. 14 14 Operation: 15 The plugin creates a txt file where the E-mail addresses are stored in the associated widget form in the upload folder of WordPress.15 The plugin creates a txt file where the E-mail addresses are stored in the associated widget or shortcode form in the upload folder of WordPress. 16 16 This txt file can then be used to write to the interested parties through a cron job on the mailing list. 17 17 Comment: … … 21 21 Dieses Plugin ermöglicht Interessenten sich an einer Mailman Liste anzumelden. 22 22 Arbeitsweise: 23 Das Plugin erzeugt im upload Ordner von Wordpress eine TXT-Datei wo dann die E-Mail Adressen aus dem zugehörigem Widget Formular gespeichert werden.23 Das Plugin erzeugt im upload Ordner von Wordpress eine TXT-Datei wo dann die E-Mail Adressen aus dem zugehörigem Widget oder Shortcode Formular oder gespeichert werden. 24 24 Diese TXT-Datei kann dann dazu genutzt werden um die Interessenten über einen Cron-Job in die Mailingliste einzutragen. 25 25 26 Bemerkung: 26 27 Dieses Plugin ist ist nur für User die auch Zugriff auf die Mailman und Cron-Job Administration des Hosting-Systems haben. Ohne Zugriff darauf funktioniert es nicht. … … 97 98 </form> 98 99 <?php } ?> 100 <h3>Shortcode</h3> 101 <p>With this Sample-Shortcode can you place a MM-Pigistration Form in your posts or pages.<br /> 102 <code>[mm_registration msg_thank_you="your_msg_thank_you" msg_error="your_msg_error" msg_email_not_valid="your_msg_email_not_valid"]</code> 103 </p> 99 104 </div> 100 105 <?php } … … 135 140 } 136 141 } 137 add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' );138 add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' );139 142 140 143 class mm_registration_widget extends WP_Widget { … … 222 225 } 223 226 add_action( 'widgets_init', 'mm_registration_register_widgets' ); 227 228 function mm_registration_shortcode_func($atts) { 229 extract( shortcode_atts( array( 230 'msg_thank_you' => '', 231 'msg_error' => '', 232 'msg_email_not_valid' => '' 233 ), $atts ) ); 234 $out ="<form id=\"mmnewsletter_shortcode\" name=\"mmnewsletter_shortcode\">\n"; 235 $out.="<input type=\"text\" name=\"email\" id=\"email\" />\n"; 236 $out.="<input id=\"mmnewsletter_shortcode_submit\" type=\"button\" class=\"button\" value=\"".__('Registration', 'mm-registration')."\" />\n"; 237 $out.="<input name=\"action\" type=\"hidden\" value=\"addmmnewsletter\" />\n"; 238 $out.="</form>\n"; 239 $out.="<div id=\"mm_registration_shortcode_out\"> </div>\n"; 240 $out.="<script type=\"text/javascript\"> 241 jQuery(document).ready(function(){ 242 jQuery('#mmnewsletter_shortcode_submit').click(function(){ 243 var email = jQuery.trim(jQuery('#email').val()); 244 var regex = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 245 if(!regex.test(email)) { 246 jQuery('#mm_registration_shortcode_out').html('<span class=\"error\">".$msg_email_not_valid."</span>'); 247 return false; 248 } else { 249 doAjaxRequest(); 250 } 251 }); 252 }); 253 function doAjaxRequest(){ 254 // here is where the request will happen 255 var request = jQuery.ajax({ 256 url: '/wp-admin/admin-ajax.php', 257 type: 'POST', 258 data:{ 259 'email': jQuery.trim(jQuery('#email').val()), 260 'action':'mm_registration_ajax' 261 }, 262 dataType: 'html' 263 }); 264 request.done(function(msg) { 265 jQuery('#mm_registration_shortcode_out').html('<span class=\"msg\">".$msg_thank_you."</span>'); 266 }); 267 request.fail(function( jqXHR, textStatus ) { 268 jQuery('#mm_registration_shortcode_out').html('<span class=\"error\">".$msg_error."</span>'); 269 }); 270 } 271 </script>\n"; 272 return $out; 273 } 274 add_shortcode( 'mm_registration', 'mm_registration_shortcode_func' ); 275 276 add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' ); 277 add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' ); 224 278 ?> -
mailman-registration/trunk/readme.txt
r810465 r815913 27 27 /usr/sbin/add_members -r /pathtoyourwordpress/wp-content/uploads/yourfilename.txt nameofthemailinglist && echo "">/pathtoyourwordpress/wp-content/uploads/yourfilename.txt 28 28 The exact path you see in the admin area -> Settings -> MM-Registration. 29 = What is teh Shortcode? = 30 [mm_registration msg_thank_you="your_msg_thank_you" msg_error="your_msg_error" msg_email_not_valid="your_msg_email_not_valid"] 29 31 30 32 == Screenshots == … … 33 35 = 0.1 = 34 36 * Initial Release 37 = 0.2 = 38 * Add Shortcode functionality 35 39 36 40 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.