Changeset 132

Show
Ignore:
Timestamp:
04/21/08 10:29:34 (3 months ago)
Author:
root
Message:

testing charset DB

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/settings.php

    r131 r132  
    104104                //TODO: Make Top 10 Customizable with up to 10 choices 
    105105                $top_ten = unserialize($wassup_options->wassup_top10); 
     106                print_r($top_ten); 
    106107                ?> 
    107108                <br /><h3><?php _e('Customize Top Ten List','wassup'); ?></h3> 
     
    116117                <input type="checkbox" name="topbrowser" value="1" <?php if($top_ten['topbrowser'] == 1) print "CHECKED"; ?> /><?php _e("Top Browsers", "wassup"); ?> <br /> 
    117118                <input type="checkbox" name="topos" value="1" <?php if($top_ten['topos'] == 1) print "CHECKED"; ?> /><?php _e("Top OS", "wassup"); ?> <br /> 
    118                 <input type="checkbox" name="toplocale" value="1" <?php if($top_ten['topos'] == 1) print "CHECKED"; ?> /><?php _e("Top Locales", "wassup"); ?></span><br /> 
     119                <input type="checkbox" name="toplocale" value="1" <?php if($top_ten['toplocale'] == 1) print "CHECKED"; ?> /><?php _e("Top Locales", "wassup"); ?></span><br /> 
    119120                </div> 
    120121                <div style="display:block; vertical-align:top; float:left; width:225px; color:#555;"> 
  • trunk/wassup.php

    r131 r132  
    11161116 
    11171117function CreateTable($tablename="wassup") { 
    1118         global $wpdb; 
    1119         $table_name = $wpdb->prefix . $tablename; 
    1120         $sql_createtable = "CREATE TABLE " . $table_name . " ( 
     1118        global $wpdb; 
     1119        $charset_collate = ''; 
     1120        if ( $wpdb->supports_collation() ) { 
     1121                if ( ! empty($wpdb->charset) ) 
     1122                        $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; 
     1123                if ( ! empty($wpdb->collate) ) 
     1124                        $charset_collate .= " COLLATE $wpdb->collate"; 
     1125        } 
     1126        $table_name = $wpdb->prefix . $tablename; 
     1127        $sql_createtable = "CREATE TABLE " . $table_name . " ( 
    11211128  id mediumint(9) NOT NULL auto_increment, 
    11221129  wassup_id varchar(50) NOT NULL, 
     
    11421149  KEY wassup_id (wassup_id), 
    11431150  INDEX (timestamp) 
    1144 );"; 
    1145         require_once( ABSPATH.'wp-admin/upgrade-functions.php'); 
    1146         dbDelta($sql_createtable);       
     1151) $charset_collate;"; 
     1152        require_once( ABSPATH.'wp-admin/upgrade-functions.php'); 
     1153        dbDelta($sql_createtable); 
    11471154} //end function createTable 
    11481155