Plugin Directory

Changeset 193166


Ignore:
Timestamp:
01/12/2010 01:58:28 PM (16 years ago)
Author:
mmilan81
Message:

Ver 0.2.1 Bugfix: Cyrillic letters

Location:
mm-did-you-know/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mm-did-you-know/trunk/changelog.txt

    r192047 r193166  
     12010-01-11 ver 0.2.1, Milan Milosevic
     2    Bugfix: Problem with Cyrillic letters solved
     3
    142010-01-08 ver 0.2, Milan Milosevic
    25    Options page added.
  • mm-did-you-know/trunk/mm-did-you-know.php

    r192047 r193166  
    66 *  Plugin URI: http://www.mmilan.com/did-you-know/
    77 *  Description: Adds a sidebar widget that display interesting quotes from posts with link to the post.
    8  *  Version: 0.2
     8 *  Version: 0.2.1
    99 *  Author: Milan Milosevic
    1010 *  Author URI: http://www.mmilan.com/
     
    303303    // Create the table if it doesn't already exist
    304304    if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
    305         $results = $wpdb->query("CREATE TABLE IF NOT EXISTS $table_name(id INT(11) NOT NULL AUTO_INCREMENT, quotes VARCHAR(2048) DEFAULT NULL, post_id INT(11) NOT NULL, link VARCHAR(255) DEFAULT NULL, PRIMARY KEY (id));");
     305        $results = $wpdb->query("CREATE TABLE IF NOT EXISTS $table_name(id INT(11) NOT NULL AUTO_INCREMENT, quotes VARCHAR(2048) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, post_id INT(11) NOT NULL, link VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (id)) DEFAULT CHARSET=utf8;");
    306306        $wpdb->insert( $table_name, array( 'quotes' => 'MM Did You Know? Wordpress plugin by Milan Milosevic.', 'post_id' => 0, 'link' => 'http://www.mmilan.com/'));
    307307        $wpdb->insert( $table_name, array( 'quotes' => 'A rat can last longer without water than a camel.', 'post_id' => 0, 'link' => ''));
     
    315315        $wpdb->insert( $table_name, array( 'quotes' => 'Charlie Chaplin once won third prize in a Charlie Chaplin look-alike contest.', 'post_id' => 0, 'link' => ''));
    316316        $wpdb->insert( $table_name, array( 'quotes' => 'The Guinness Book of Records holds the record for being the book most often stolen from public libraries.', 'post_id' => 0, 'link' => ''));
    317     }   
     317    } else {
     318        $results = $wpdb->query("alter table $table_name' default collate utf8_unicode_ci;");
     319        $results = $wpdb->query("ALTER TABLE $table_name CHANGE quotes quotes VARCHAR(2048) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;");
     320        $results = $wpdb->query("ALTER TABLE $table_name CHANGE link link VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;");
     321    }
     322   
    318323}
    319324
  • mm-did-you-know/trunk/readme.txt

    r192047 r193166  
    1515Changelog:
    1616
     17    2010-01-11, version 0.2.1
     18        Bugfix: Problem with Cyrillic letters solved
     19   
    1720    2010-01-08, version 0.2
    1821        Options page added.
Note: See TracChangeset for help on using the changeset viewer.