Plugin Directory

Changeset 222642


Ignore:
Timestamp:
03/28/2010 07:01:17 PM (16 years ago)
Author:
anraiki
Message:
  • More bug fixes.
  • Database "not created" detection installed.
  • Added two awesome features to the Chapter Database: publishing date and slugs!
Location:
kommiku/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kommiku/trunk/admin/database.php

    r207511 r222642  
    127127    }
    128128   
    129     function chapter_create($title = '', $number, $summary = '', $series_id, $returner = false) {
     129    function chapter_create($title = '', $number, $summary = '', $series_id, $date, $slug,$returner = false) {
    130130        global $wpdb;
    131131       
     
    136136               'number' => $number,
    137137               'summary' => $summary,
    138                'series_id' => $series_id
     138               'series_id' => $series_id,
     139               'pubdate' => $date,
     140               'slug' = $slug
    139141             ),
    140142       
    141         array( '%s', '%s', '%s', '%d'
     143        array( '%s', '%s', '%s', '%d', '%s', '%s'
    142144               
    143145            );
     
    488490    }
    489491   
    490     function chapter_update($id = NULL,$title = '',$number,$summary,$series_id) {
     492    function chapter_update($id = NULL,$title = '',$number,$summary,$series_id,$date,$slug) {
    491493        global $wpdb;
    492494       
     
    501503                       'number' => $number,
    502504                       'summary' => $summary,
    503                        'series_id' => $series_id
     505                       'series_id' => $series_id,
     506                       'pubdate' => $date,
     507                       '$slug' => $slug
    504508                     ),
    505509                array( 'id' => $id ),
    506                 array( '%s', '%s', '%s', '%d' ), 
     510                array( '%s', '%s', '%s', '%d', '%s', '%s' ), 
    507511                array( '%d' ) );
    508512        }
  • kommiku/trunk/kommiku.php

    r220378 r222642  
    22/*
    33Plugin Name: Kommiku Viewer
    4 Version: 2.0.3.1
     4Version: 2.0.4
    55Plugin URI: http://dotspiral.com/kommiku/
    66Description: Kommiku is a Online Manga Viewer.
     
    225225        $db = new kommiku_database();
    226226        $wpdb->show_errors();
    227         $phpdate = date( 'Y-m-d H:i:s' );
     227        $phpdate = date("Y-m-d H:i:s O");
    228228       
    229229        if($_POST['delete'] == "Delete It!") {
     
    406406                if(!$chapter['fail']) {
    407407                    if($_POST['action'] == "create") {
    408                         $db->chapter_create($_CLEAN['title'],$_POST['number'],$_CLEAN['summary'],$_POST['series_id']);
     408                        $db->chapter_create($_CLEAN['title'],$_POST['number'],$_CLEAN['summary'],$_POST['series_id'],$phpdate,$_POST['number']);
    409409                        $chapterID = $wpdb->get_var("SELECT id FROM `".$table."` WHERE number = '".$_POST['number']."'");
    410410                        $db->historyu('chapter','create',$phpdate,$series['title'],$series['slug'],$_CLEAN['title'],$_POST['number'],'0','0');
     
    413413                        kommiku_model_chapter();
    414414                    } else if($_POST['action'] == "update" && is_numeric($_POST['chapter_id'])) {                       
    415                         $db->chapter_update($_POST['chapter_id'],$_CLEAN['title'],$_POST['number'],$_CLEAN['summary'],$_POST['series_id']);
     415                        $db->chapter_update($_POST['chapter_id'],$_CLEAN['title'],$_POST['number'],$_CLEAN['summary'],$_POST['series_id'],$phpdate,$_POST['number']);
    416416                        $status['pass'] = 'The Chapter has been successfully updated';
    417417                        $OldChapterFolder = str_replace('.0','',$_OLD['number']).'/';
     
    753753    {
    754754        global $wpdb, $kommiku_version;
     755       
    755756        $version = get_option( 'kommiku_version' );
    756757       
    757         /*if ($version = '2.0') {
    758            
    759             $updateTable = 'ALTER TABLE `'.$wpdb->prefix.'_comic_chapter`
    760                             ADD `pub_date` VARCHAR(30) NOT NULL ,
    761                             ADD `slug` VARCHAR(100)
    762                             NOT NULL';
    763             $wpdb->query($updateTable);
    764                
    765             update_option('kommiku_version', '2.1');   
    766         }*/
    767        
    768         //Added Widget, No Table Optimization
    769         if ($version = '2.0.3') {
    770             update_option('kommiku_version', '2.0.3.1');
    771         }       
    772        
    773         if ($version = '2.0') {
    774             update_option('kommiku_version', '2.0.3');
    775         }       
    776        
    777                 if (!$version) { //Install the Table Only if the Version Option didn't exist.
     758                if (!$wpdb->get_var("SELECT * FROM `".$wpdb->prefix."comic_series`")) { /
    778759                    $table = $wpdb->prefix."comic_page";
    779760                            $structure = "CREATE TABLE $table (
     
    843824                            $wpdb->query($structure);
    844825                           
    845                         add_option("kommiku_version", "2.0.3");
    846                         add_option("kommiku_url_format", 'manga');
    847                         add_option("kommiku_comic_upload", 'comics');
    848                         add_option("kommiku_skin_directory", 'default');
    849                         add_option("kommiku_one_comic", 'false');
    850                         add_option("kommiku_no_slug", 'false');
    851                         mkdir(WP_LOAD_PATH."/comics", 0755);
    852826            }
    853827       
     828        if(!get_option( 'kommiku_comic_upload' ))
     829            add_option("kommiku_comic_upload", 'comics');
     830           
     831        if(!get_option( 'kommiku_version' ))
     832            add_option("kommiku_version", "2.0.3");
     833           
     834        if(!get_option( 'kommiku_url_format' ))
     835            add_option("kommiku_url_format", 'manga');
     836           
     837        if(!get_option( 'kommiku_skin_directory' ))
     838            add_option("kommiku_skin_directory", 'default');
     839           
     840        if(!get_option( 'kommiku_one_comic' ))
     841            add_option("kommiku_one_comic", 'false');
     842           
     843        if(!get_option( 'kommiku_no_slug' ))
     844            add_option("kommiku_no_slug", 'false');
     845           
     846        if(!is_dir(WP_LOAD_PATH."/comics"))
     847            mkdir(WP_LOAD_PATH."/comics", 0755);
     848           
     849        if ($version = '2.0') { update_option('kommiku_version', '2.0.3');  }   
     850        if ($version = '2.0.3') { update_option('kommiku_version', '2.0.3.1'); }       
     851       
     852        //Newest
     853        if ($version != '2.4' || $wpdb->query("SELECT * FROM `".$wpdb->prefix."_comic_chapter` ORDER BY `".$wpdb->prefix."_comic_chapter`.`pub_date` ASC")) {
     854            $updateTable = 'ALTER TABLE `'.$wpdb->prefix.'_comic_chapter`
     855                            ADD `pubdate` VARCHAR(30) NOT NULL ,
     856                            ADD `slug` VARCHAR(100)
     857                            NOT NULL';
     858            $wpdb->query($updateTable);
     859               
     860            update_option('kommiku_version', '2.0.4'); 
     861        }           
    854862       
    855863    }
  • kommiku/trunk/readme.txt

    r217188 r222642  
    2121== Changelog ==
    2222= 2.x =
     23V2.0.4 - March 14, 2010
     24* More bug fixes.
     25* Database "not created" detection installed.
     26* Added two awesome features to the Chapter Database: publishing date and slugs!
    2327V2.0.1 - March 14, 2010
    2428* Permission Bug Fix
Note: See TracChangeset for help on using the changeset viewer.