WordPress.org

Plugin Directory

Changeset 488255


Ignore:
Timestamp:
01/11/12 16:25:08 (2 years ago)
Author:
goldenapples
Message:

Version 0.3.2, fixes a number of missing or empty index messages in admin section on first activation

Location:
recommended-links
Files:
6 edited
4 copied

Legend:

Unmodified
Added
Removed
  • recommended-links/tags/0.3.2/admin-functions.php

    r486518 r488255  
    5858                    foreach ($taxes as $name => $tax)  
    5959                        if (!in_array( $name, array( 'nav_menu', 'link_category', 'post_format' ) ) ) 
    60                             echo '<p><input type="checkbox" name="tax['.$name.']" '.checked( $current_settings['tax'][$name], 'on', false ).'> '.$tax->labels->name .'</p>'; 
     60                            echo '<p><input type="checkbox" name="tax['.$name.']" '.checked( ( isset( $current_settings['tax'][$name] ) && $current_settings['tax'][$name] ), true, false ).'> '.$tax->labels->name .'</p>'; 
    6161            ?> 
    6262            </td> 
     
    104104            'page_for_reclinks' => intval( $_POST['page_id'] ), 
    105105            'sort_order' => $_POST['sort_order'], 
    106             'tax' => $_POST['tax'], 
    107             'allow-unregistered-vote' => (true == $_POST['allow-unregistered-vote']), 
    108             'allow-unregistered-post' => (true == $_POST['allow-unregistered-post']), 
     106            'tax' => ( isset( $_POST['tax'] ) ) ? $_POST['tax'] : array(), 
     107            'allow-unregistered-vote' => (isset($_POST['allow-unregistered-vote']) && true == $_POST['allow-unregistered-vote']), 
     108            'allow-unregistered-post' => (isset($_POST['allow-unregistered-post']) &&true == $_POST['allow-unregistered-post']), 
    109109 
    110110            // no UI for this yet, but its gotta be in there 
  • recommended-links/tags/0.3.2/plugin-activation.php

    r486514 r488255  
    5858function reclinks_db_option_upgrade( $from ) { 
    5959 
    60     /* DB version 2, reflects plugin version 0.4. First user-editable settings. */ 
    61     if ( !$from || $from < 2 ) { 
    62         $reclinks_plugin_defaults = array( 
    63             'vote-values' => array( 
    64                 'minus' => array( 'value' => -1, 'text' => '-' ), 
    65                 'plus' => array( 'value' => 1, 'text' => '+' ) 
    66             ), 
    67             'page-for-reclinks' => false, 
    68             'sort-order' => 'current', 
    69             'allow-unregistered-vote' => false, 
    70             'allow-unregistered-post' => false 
    71         ); 
    72     } 
     60    $old_settings = ( $from ) ? get_option( 'reclinks_plugin_options' ) : array(); 
    7361 
    74     update_option( 'reclinks_plugin_options', $reclinks_plugin_defaults ); 
    75     update_option( 'reclinks_db_version', 2 ); 
     62    /* DB version 3, reflects plugin version 0.3. Includes 'tax' string. */ 
     63    $reclinks_plugin_defaults = array( 
     64        'vote-values' => array( 
     65            'minus' => array( 'value' => -1, 'text' => '-' ), 
     66            'plus' => array( 'value' => 1, 'text' => '+' ) 
     67        ), 
     68        'page_for_reclinks' => false, 
     69        'sort_order' => 'current', 
     70        'allow-unregistered-vote' => false, 
     71        'allow-unregistered-post' => false, 
     72        'tax' => array() 
     73    ); 
     74 
     75    $options_to_set = wp_parse_args( $old_settings, $reclinks_plugin_defaults ); 
     76 
     77    update_option( 'reclinks_plugin_options', $options_to_set ); 
     78    update_option( 'reclinks_db_version', 3 ); 
    7679 
    7780} 
  • recommended-links/tags/0.3.2/readme.txt

    r487710 r488255  
    55Requires at least: 3.2.1 
    66Tested up to: 3.3.1 
    7 Stable tag: 0.3.1 
     7Stable tag: 0.3.2 
    88 
    99A sort of "Reddit clone" that allows users to post links, up- or down-vote them, and comment on them. 
     
    6969== Changelog == 
    7070 
     71= 0.3.2 = 
     72 
     73Fixed a number of "missing index" bugs that caused error messages on first activation of the plugin. 
     74 
    7175= 0.3.1 = 
    7276 
  • recommended-links/tags/0.3.2/recommended-links.php

    r487720 r488255  
    55Description: A "reddit clone" that runs in Wordpress. 
    66Author: Nathaniel Taintor 
    7 Version: 0.3.1 
     7Version: 0.3.2 
    88Author URI: http://goldenapplesdesign.com 
    99*/ 
     
    5454    ); 
    5555 
    56     $taxonomies = is_array( $plugin_settings['tax'] ) ? array_keys( $plugin_settings['tax'] ) : array( null ); 
     56    $taxonomies = is_array( $plugin_settings['tax'] ) ? array_keys( $plugin_settings['tax'] ) : array(); 
    5757 
    5858    $args = array(  
     
    9191function gad_check_db_tables() { 
    9292    $v = get_option( 'reclinks_db_version' ); 
    93     if ( !$v || $v < 2 ) 
     93    if ( !$v || $v < 3 ) 
    9494        reclinks_db_option_upgrade( $v ); 
    9595} 
  • recommended-links/trunk/admin-functions.php

    r486518 r488255  
    5858                    foreach ($taxes as $name => $tax)  
    5959                        if (!in_array( $name, array( 'nav_menu', 'link_category', 'post_format' ) ) ) 
    60                             echo '<p><input type="checkbox" name="tax['.$name.']" '.checked( $current_settings['tax'][$name], 'on', false ).'> '.$tax->labels->name .'</p>'; 
     60                            echo '<p><input type="checkbox" name="tax['.$name.']" '.checked( ( isset( $current_settings['tax'][$name] ) && $current_settings['tax'][$name] ), true, false ).'> '.$tax->labels->name .'</p>'; 
    6161            ?> 
    6262            </td> 
     
    104104            'page_for_reclinks' => intval( $_POST['page_id'] ), 
    105105            'sort_order' => $_POST['sort_order'], 
    106             'tax' => $_POST['tax'], 
    107             'allow-unregistered-vote' => (true == $_POST['allow-unregistered-vote']), 
    108             'allow-unregistered-post' => (true == $_POST['allow-unregistered-post']), 
     106            'tax' => ( isset( $_POST['tax'] ) ) ? $_POST['tax'] : array(), 
     107            'allow-unregistered-vote' => (isset($_POST['allow-unregistered-vote']) && true == $_POST['allow-unregistered-vote']), 
     108            'allow-unregistered-post' => (isset($_POST['allow-unregistered-post']) &&true == $_POST['allow-unregistered-post']), 
    109109 
    110110            // no UI for this yet, but its gotta be in there 
  • recommended-links/trunk/plugin-activation.php

    r486514 r488255  
    5858function reclinks_db_option_upgrade( $from ) { 
    5959 
    60     /* DB version 2, reflects plugin version 0.4. First user-editable settings. */ 
    61     if ( !$from || $from < 2 ) { 
    62         $reclinks_plugin_defaults = array( 
    63             'vote-values' => array( 
    64                 'minus' => array( 'value' => -1, 'text' => '-' ), 
    65                 'plus' => array( 'value' => 1, 'text' => '+' ) 
    66             ), 
    67             'page-for-reclinks' => false, 
    68             'sort-order' => 'current', 
    69             'allow-unregistered-vote' => false, 
    70             'allow-unregistered-post' => false 
    71         ); 
    72     } 
     60    $old_settings = ( $from ) ? get_option( 'reclinks_plugin_options' ) : array(); 
    7361 
    74     update_option( 'reclinks_plugin_options', $reclinks_plugin_defaults ); 
    75     update_option( 'reclinks_db_version', 2 ); 
     62    /* DB version 3, reflects plugin version 0.3. Includes 'tax' string. */ 
     63    $reclinks_plugin_defaults = array( 
     64        'vote-values' => array( 
     65            'minus' => array( 'value' => -1, 'text' => '-' ), 
     66            'plus' => array( 'value' => 1, 'text' => '+' ) 
     67        ), 
     68        'page_for_reclinks' => false, 
     69        'sort_order' => 'current', 
     70        'allow-unregistered-vote' => false, 
     71        'allow-unregistered-post' => false, 
     72        'tax' => array() 
     73    ); 
     74 
     75    $options_to_set = wp_parse_args( $old_settings, $reclinks_plugin_defaults ); 
     76 
     77    update_option( 'reclinks_plugin_options', $options_to_set ); 
     78    update_option( 'reclinks_db_version', 3 ); 
    7679 
    7780} 
  • recommended-links/trunk/readme.txt

    r487710 r488255  
    55Requires at least: 3.2.1 
    66Tested up to: 3.3.1 
    7 Stable tag: 0.3.1 
     7Stable tag: 0.3.2 
    88 
    99A sort of "Reddit clone" that allows users to post links, up- or down-vote them, and comment on them. 
     
    6969== Changelog == 
    7070 
     71= 0.3.2 = 
     72 
     73Fixed a number of "missing index" bugs that caused error messages on first activation of the plugin. 
     74 
    7175= 0.3.1 = 
    7276 
  • recommended-links/trunk/recommended-links.php

    r487720 r488255  
    55Description: A "reddit clone" that runs in Wordpress. 
    66Author: Nathaniel Taintor 
    7 Version: 0.3.1 
     7Version: 0.3.2 
    88Author URI: http://goldenapplesdesign.com 
    99*/ 
     
    5454    ); 
    5555 
    56     $taxonomies = is_array( $plugin_settings['tax'] ) ? array_keys( $plugin_settings['tax'] ) : array( null ); 
     56    $taxonomies = is_array( $plugin_settings['tax'] ) ? array_keys( $plugin_settings['tax'] ) : array(); 
    5757 
    5858    $args = array(  
     
    9191function gad_check_db_tables() { 
    9292    $v = get_option( 'reclinks_db_version' ); 
    93     if ( !$v || $v < 2 ) 
     93    if ( !$v || $v < 3 ) 
    9494        reclinks_db_option_upgrade( $v ); 
    9595} 
Note: See TracChangeset for help on using the changeset viewer.