WordPress.org

Plugin Directory

Changeset 440474


Ignore:
Timestamp:
09/19/11 22:10:33 (3 years ago)
Author:
mpvanwinkle77
Message:

Test up to WP 3.2, fixed bug in tinymce button,added premium version nag

Location:
simplr-registration-form/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • simplr-registration-form/trunk/readme.txt

    r422234 r440474  
    44Tags: registration, signup, wordpress 3.0, cms, users, user management 
    55Requires at least: 2.8 
    6 Tested up to: 3.0 
    7 Stable tag: 1.8.1 
     6Tested up to: 3.2 
     7Stable tag: 1.8.2 
    88 
    99This plugin allows users to easily add a custom user registration form anywhere on their site using simple shortcode. 
     
    5353=1.8.1= 
    5454Added message filter 
     55 
     56=1.8.2= 
     57Updated for WordPress 3.2 
     58Bugfix: Tinymce button loading triggers errors 
  • simplr-registration-form/trunk/simplr_reg.js

    r344925 r440474  
    22(function(){ 
    33    // creates the plugin 
    4     root = simplr.plugin_dir; 
     4    root = userSettings.simplr_plugin_dir; 
    55     
    66    tinymce.create('tinymce.plugins.simplr_reg', { 
     
    3636        jQuery('#footer').append(function() { 
    3737                jQuery(this).after('<div id="hook"></div>'); 
    38                 jQuery('#hook').load(simplr.plugin_dir + 'simplr_reg_options.php'); 
     38                jQuery('#hook').load(root + 'simplr_reg_options.php'); 
    3939            }); 
    4040     
  • simplr-registration-form/trunk/simplr_reg_page.php

    r422234 r440474  
    22/* 
    33Plugin Name: Simplr User Registration Form 
    4 Version: 0.1.8.1 
     4Version: 0.1.8.2 
    55Description: This a simple plugin for adding a custom user registration form to any post or page using shortcode. 
    66Author: Mike Van Winkle 
     
    99License: GPL 
    1010*/ 
    11 ?> 
    12 <?php 
     11 
    1312define('WP_DEBUG',true); 
     13 
     14//constants 
     15define("SIMPLR_URL", plugins_url('',__FILE__) ); 
     16define("SIMPLR_DIR", rtrim(dirname(__FILE__), '/')); 
    1417 
    1518//validate 
     
    1821if(version_compare($wp_version, "2.8", "<")) { exit($exit_msg); } 
    1922 
    20 //constants 
    21 define("SIMPLR_DIR", WP_PLUGIN_URL . '/simplr-registration-form/' ); 
    22  
    2323//API 
    2424add_action('wp_print_styles','simplr_reg_styles'); 
     
    2929add_shortcode('Register', 'sreg_figure'); 
    3030add_action('admin_init','simplr_action_admin_init'); 
    31 add_action('admin_init','simplr_reg_scripts'); 
     31add_action('admin_head','simplr_reg_scripts',100); 
    3232 
    3333//functions 
     
    124124    $style = get_option('sreg_style'); 
    125125    if(!$style) { 
    126         $src = SIMPLR_DIR .'simplr_reg.css'; 
     126        $src = SIMPLR_URL .'/simplr_reg.css'; 
    127127        wp_register_style('simplr-forms-style',$src); 
    128128        wp_enqueue_style('simplr-forms-style'); 
     
    136136 
    137137function simplr_admin_style() { 
    138     $src = SIMPLR_DIR . 'simplr_admin.css'; 
     138    $src = SIMPLR_URL . '/simplr_admin.css'; 
    139139    wp_register_style('simplr-admin-style',$src);  
    140140    wp_enqueue_style('simplr-admin-style'); 
     
    463463function simplr_filter_mce_plugin( $plugins ) { 
    464464    // this plugin file will work the magic of our button 
    465     $plugins['simplr_reg'] = SIMPLR_DIR . 'simplr_reg.js'; 
     465    $plugins['simplr_reg'] = SIMPLR_URL . '/simplr_reg.js'; 
    466466    return $plugins; 
    467467} 
    468468 
    469469function simplr_reg_scripts() { 
    470     wp_enqueue_script('simplr_reg_options', SIMPLR_DIR . 'simplr_reg_options.js', array('jquery')); 
    471     wp_localize_script( 'simplr_reg_options', 'simplr', array( 'plugin_dir' => SIMPLR_DIR ) ); 
    472 }?> 
     470    ?> 
     471    <script type="text/javascript"> 
     472    //<![CDATA[ 
     473        userSettings.simplr_plugin_dir = '<?php echo SIMPLR_URL; ?>/'; 
     474    //]]> 
     475</script>  
     476    <?php 
     477} 
     478 
     479function simplr_premium_nag() { 
     480    ?> 
     481    <div id="message" class="updated simplr-message"> 
     482        <p><strong><a href="http://www.mikevanwinkle.com/simplr-registration-form-plus/" title="Find out more about Simplr Registration Form Plus">Simplr Registration Form Plus is now available!</a></strong> Plus includes a user interface for adding fields, Facebook Connect API Integration, Recaptcha Integration and more. <a href="http://www.mikevanwinkle.com/simplr-registration-form-plus/" title="Find out more about Simplr Registration Form Plus">Find out more</a>. 
     483        <a href="#" id="simplr-remove-this"  style="font-size:10px;font-style:italic;">Remove this message.</a> 
     484        <div style="clear:both;"></div> 
     485        </p> 
     486    </div> 
     487    <?php 
     488} 
     489 
     490$options = get_option('simplr_reg_options'); 
     491if($options->premium_nag != '1') { 
     492    add_action('admin_notices','simplr_premium_nag');  
     493    add_action('admin_head','simplr_premium_nag_script'); 
     494    add_action('wp_ajax_simplr-remove-nag','simplr_ajax_remove_nag'); 
     495} 
     496 
     497function simplr_premium_nag_script() { 
     498    ?> 
     499    <script> 
     500        jQuery.noConflict(); 
     501        jQuery(document).ready(function() { 
     502            jQuery('a#simplr-remove-this').live('click',function(event) { 
     503                event.preventDefault();  
     504                jQuery.post(ajaxurl,{action:'simplr-remove-nag'},function(data) {}); 
     505                jQuery(this).parent().parent().fadeOut(); 
     506            }); 
     507        }); 
     508    </script> 
     509    <?php 
     510} 
     511 
     512function simplr_ajax_remove_nag() { 
     513    $options = get_option('simplr_reg_options'); 
     514    $options->premium_nag = 1; 
     515    update_option('simplr_reg_options',$options); 
     516} 
     517?> 
Note: See TracChangeset for help on using the changeset viewer.