Changeset 55

Show
Ignore:
Timestamp:
02/08/08 15:27:54 (10 months ago)
Author:
root
Message:
 
Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/badhosts.txt

    r34 r55  
    67496749zwallet.com 
    67506750zxcvbdf.com 
    6751 irclogs.net 
  • trunk/lib/settings.php

    r54 r55  
    169169        </select></p> 
    170170        <br /><hr /> 
    171         <p style="padding-left:0;padding-top:15px;"><input type="submit" name="submit" value="<?php _e('Save Settings','wassup'); ?>" /> &nbsp; &nbsp; <input type="reset" name="reset" value="<?php _e('Reset','wassup'); ?>" /></p> 
     171        <p style="padding-left:0;padding-top:15px;"><input type="submit" name="submit" value="<?php _e('Save Settings','wassup'); ?>" /> &nbsp; &nbsp; <input type="reset" name="reset" value="<?php _e('Reset','wassup'); ?>" /> <input type="submit" name="reset-to-default" value="Reset to Default Settings" /></p> 
    172172        </form> 
    173173        <br /> 
  • trunk/wassup.php

    r54 r55  
    3131add_action('wp_head', 'add_wassup_meta_info'); 
    3232 
    33 //#add initial options and create table when Wassup activated 
    34 function wassup_install() { 
    35   global $wpdb; 
    36   //#initial wassup settings for options 
    37   $defaultdata = array( 
     33//#initial wassup settings for options this is here because 
     34//I need it in more then one function (using global) 
     35$defaultWdata = array( 
    3836        'wassup_active' => "1", 
    3937        'wassup_loggedin' => "1", 
     
    6967        ); 
    7068 
     69//#add initial options and create table when Wassup activated 
     70function wassup_install() { 
     71  global $wpdb, $defaultWdata; 
    7172  //### add/update wassup settings to Wordpress options table 
    7273  $wassup_settings = get_option('wassup_settings'); 
    7374  if (empty($wassup_settings)) { 
    7475        //# initialize wassup settings to default values 
    75         add_option('wassup_settings', $defaultdata, 'Options for WassUp'); 
     76        add_option('wassup_settings', $defaultWdata, 'Options for WassUp'); 
    7677  } else { 
    7778        //# update wassup settings for 'spamcheck', 'refspam', and 'spam' 
     
    320321 
    321322function WassUp() { 
    322         global $wpdb, $version, $wpurl; 
     323        global $wpdb, $version, $wpurl, $defaultWdata; 
    323324        $hash = wp_hash('wassup'); 
    324325        $table_name = $wpdb->prefix . "wassup"; 
     
    361362                $wassup_settings['wassup_refspam'] = $_POST['wassup_refspam']; 
    362363                update_option('wassup_settings', $wassup_settings); 
    363         } 
     364        } elseif (isset($_POST['reset-to-default'])) { 
     365        print_r($defaultWdata); 
     366                delete_option('wassup_settings'); 
     367                update_option('wassup_settings', $defaultWdata); 
     368                $wassup_settings = get_option('wassup_settings'); 
     369        } 
     370 
     371 
    364372        if ($_GET['page'] == "wassup-spy") { 
    365373                $class_spy="class='current'";