Plugin Directory

Changeset 815913


Ignore:
Timestamp:
12/06/2013 12:27:22 PM (12 years ago)
Author:
heikoch
Message:

tagging version 0.2

Location:
mailman-registration
Files:
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • mailman-registration/tags/0.2/index.php

    r810465 r815913  
    44Plugin URI: http://www.heikoch.de
    55Description: Mailman Registration
    6 Version: 0.0.1
     6Version: 0.0.2
    77Author: heikoch
    88URI: http://www.heikoch.de
     
    1313This plugin allows prospective customers to log on to a Mailman list.
    1414Operation:
    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.
     15The 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.
    1616This txt file can then be used to write to the interested parties through a cron job on the mailing list.
    1717Comment:
     
    2121Dieses Plugin ermöglicht Interessenten sich an einer Mailman Liste anzumelden.
    2222Arbeitsweise:
    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.
     23Das 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.
    2424Diese TXT-Datei kann dann dazu genutzt werden um die Interessenten über einen Cron-Job in die Mailingliste einzutragen.
     25
    2526Bemerkung:
    2627Dieses 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.
     
    9798    </form>
    9899    <?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>
    99104</div>
    100105<?php }
     
    135140    }
    136141}
    137 add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' ); 
    138 add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' );
    139142
    140143class mm_registration_widget extends WP_Widget { 
     
    222225}
    223226add_action( 'widgets_init', 'mm_registration_register_widgets' );
     227
     228function mm_registration_shortcode_func($atts) {
     229extract( 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\">&nbsp;</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});
     253function 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";
     272return $out;
     273}
     274add_shortcode( 'mm_registration', 'mm_registration_shortcode_func' );
     275
     276add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' ); 
     277add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' );
    224278?>
  • mailman-registration/tags/0.2/readme.txt

    r810465 r815913  
    2727/usr/sbin/add_members -r /pathtoyourwordpress/wp-content/uploads/yourfilename.txt nameofthemailinglist && echo "">/pathtoyourwordpress/wp-content/uploads/yourfilename.txt
    2828The 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"]
    2931
    3032== Screenshots ==
     
    3335= 0.1 =
    3436    * Initial Release
     37= 0.2 =
     38    * Add Shortcode functionality
    3539
    3640== Upgrade Notice ==
  • mailman-registration/trunk/index.php

    r810465 r815913  
    44Plugin URI: http://www.heikoch.de
    55Description: Mailman Registration
    6 Version: 0.0.1
     6Version: 0.0.2
    77Author: heikoch
    88URI: http://www.heikoch.de
     
    1313This plugin allows prospective customers to log on to a Mailman list.
    1414Operation:
    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.
     15The 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.
    1616This txt file can then be used to write to the interested parties through a cron job on the mailing list.
    1717Comment:
     
    2121Dieses Plugin ermöglicht Interessenten sich an einer Mailman Liste anzumelden.
    2222Arbeitsweise:
    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.
     23Das 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.
    2424Diese TXT-Datei kann dann dazu genutzt werden um die Interessenten über einen Cron-Job in die Mailingliste einzutragen.
     25
    2526Bemerkung:
    2627Dieses 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.
     
    9798    </form>
    9899    <?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>
    99104</div>
    100105<?php }
     
    135140    }
    136141}
    137 add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' ); 
    138 add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' );
    139142
    140143class mm_registration_widget extends WP_Widget { 
     
    222225}
    223226add_action( 'widgets_init', 'mm_registration_register_widgets' );
     227
     228function mm_registration_shortcode_func($atts) {
     229extract( 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\">&nbsp;</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});
     253function 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";
     272return $out;
     273}
     274add_shortcode( 'mm_registration', 'mm_registration_shortcode_func' );
     275
     276add_action( 'wp_ajax_nopriv_mm_registration_ajax', 'mm_registration_ajax' ); 
     277add_action( 'wp_ajax_mm_registration_ajax', 'mm_registration_ajax' );
    224278?>
  • mailman-registration/trunk/readme.txt

    r810465 r815913  
    2727/usr/sbin/add_members -r /pathtoyourwordpress/wp-content/uploads/yourfilename.txt nameofthemailinglist && echo "">/pathtoyourwordpress/wp-content/uploads/yourfilename.txt
    2828The 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"]
    2931
    3032== Screenshots ==
     
    3335= 0.1 =
    3436    * Initial Release
     37= 0.2 =
     38    * Add Shortcode functionality
    3539
    3640== Upgrade Notice ==
Note: See TracChangeset for help on using the changeset viewer.