WordPress.org

Plugin Directory

Changeset 416973


Ignore:
Timestamp:
07/29/11 17:11:17 (3 years ago)
Author:
dimadin
Message:

Update notices for upgrade.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gravatar-signup-encouragement/trunk/gravatar-signup-encouragment.php

    r416887 r416973  
    196196 
    197197    /* Add version number */ 
    198     $gse_options['version'] = '2.0'; 
     198    $gse_options['version'] = '3.0'; 
    199199 
    200200    /* Load plugin textdomain since maybe it's not loaded already */ 
     
    238238    if ( ! $gse_options ) { 
    239239        gravatar_signup_encouragement_add_default_options(); 
    240     /* Else update to version 2.0 */ 
     240    /* Else update to version 3.0 */ 
    241241    } else { 
     242        /* Update from 1.0 */ 
    242243        if ( ! $gse_options['version'] ) { 
    243244            /* Make array with names of options */ 
     
    261262 
    262263            /* Add new version and notice about upgrade */ 
    263             $gse_options['version'] = '2.0'; 
    264             $gse_options['notice_upgrade_1_to_2'] = true; 
     264            $gse_options['version'] = '3.0'; 
     265            $gse_options['notice_upgrade_1_to_3'] = true; 
     266            update_option( 'gravatar_signup_encouragement_settings', $gse_options ); 
     267        /* Update from 2.0+ */ 
     268        } elseif ( version_compare( $gse_options['version'], '3.0', '<' ) ) { 
     269            /* Add new version and notice about upgrade */ 
     270            $gse_options['version'] = '3.0'; 
     271            $gse_options['notice_upgrade_2_to_3'] = true; 
     272            unset( $gse_options['notice_upgrade_1_to_2'] ); 
    265273            update_option( 'gravatar_signup_encouragement_settings', $gse_options ); 
    266274        } 
     
    617625    <br /><br /> 
    618626    <?php 
    619     /* Show notice about upgrade to 2.0 */ 
     627    /* Show notice about upgrade from <2.0 */ 
    620628    if ( $gse_options['notice_upgrade_1_to_2'] ) { 
    621629        ?> 
     
    623631        <?php _e( "There are new options for Gravatar Signup Encouragement.", "gse_textdomain" ); ?><br /> 
    624632        <ol> 
    625             <li><?php _e( "Now you can show message in dialog after comment is posted, as an administration notice, and on a signup page for multisite installation.", "gse_textdomain" ); ?></li> 
     633            <li><?php _e( "Now you can show message in dialog after comment is posted, as an administration notice, in admin bar, on a signup page for multisite installation and in a bbPress reply form if bbPress plugin is installed.", "gse_textdomain" ); ?></li> 
    626634            <li><?php _e( "Now you can add message after any element on a page more easily then before.", "gse_textdomain" ); ?></li> 
    627635            <li><?php _e( "There are new predefined elements for profile page.", "gse_textdomain" ); ?></li> 
     
    630638        <?php _e( "New default message:", "gse_textdomain" ); ?><br /> 
    631639        <textarea  readonly="true" rows="5" cols="50" class="large-text code"><?php echo gravatar_signup_encouragement_default_message(); ?></textarea><br /> 
     640        <?php printf( '<a href="%s" id="gse-notice-1-to-2-no">' . __( 'Do not show this notice again', 'gse_textdomain' ) . '</a>', '?gse_notice_1_to_2=0' ); ?> 
     641        </div><br /> 
     642        <?php 
     643    /* Show notice about upgrade from 2.0+ */ 
     644    } elseif ( $gse_options['notice_upgrade_2_to_3'] ) { 
     645        ?> 
     646        <div class="dashboard-widget-notice"> 
     647        <?php _e( "There are new options for Gravatar Signup Encouragement.", "gse_textdomain" ); ?><br /> 
     648        <ol> 
     649            <li><?php _e( "Now you can show message in admin bar, and in a bbPress reply form if bbPress plugin is installed.", "gse_textdomain" ); ?></li> 
     650        </ol> 
    632651        <?php printf( '<a href="%s" id="gse-notice-1-to-2-no">' . __( 'Do not show this notice again', 'gse_textdomain' ) . '</a>', '?gse_notice_1_to_2=0' ); ?> 
    633652        </div><br /> 
     
    13891408    if ( isset( $_GET['gse_notice_1_to_2'] ) && '0' == $_GET['gse_notice_1_to_2'] ) { 
    13901409        unset( $gse_options['notice_upgrade_1_to_2'] ); 
     1410        unset( $gse_options['notice_upgrade_2_to_3'] ); 
    13911411        update_option( 'gravatar_signup_encouragement_settings', $gse_options ); 
    13921412    } 
Note: See TracChangeset for help on using the changeset viewer.