Plugin Directory

Changeset 453038


Ignore:
Timestamp:
10/19/2011 05:36:26 PM (14 years ago)
Author:
CJ_Jackson
Message:

Updated to 0.1.20

Location:
html5avmanager
Files:
77 added
4 edited

Legend:

Unmodified
Added
Removed
  • html5avmanager/trunk/html5avmanager.php

    r446745 r453038  
    55  Plugin URI: http://cj-jackson.com/
    66  Description: A video manager with a Modal-View-Controller and video uploader.
    7   Version: 0.1.18
     7  Version: 0.1.20
    88  Author: Christopher John Jackson
    99  Author URI: http://cj-jackson.com/
     
    147147        self::$video_view = $videoView;
    148148        self::$audio_view = $audioView;
    149 
     149       
    150150        $db = new html5av_dbal();
    151         if (!$db->tableExist()) {
    152             $db->setUpTables(); // Set up tables because tables does not exist.
    153         }
     151        $db->setUpTables();
    154152        $db->updateTables();
    155153        unset($db);
  • html5avmanager/trunk/lib/html5av_dbal.php

    r436043 r453038  
    2020
    2121    public function __construct() {
    22         global $table_prefix;
    23         $this->DB_NAME = DB_NAME;
    24         $this->DB_USER = DB_USER;
    25         $this->DB_PASSWD = DB_PASSWORD;
    26         $this->DB_HOST = DB_HOST;
    27         $this->DB_PREFIX = $table_prefix . 'html5av_';
     22        global $wpdb;
     23        $this->DB_NAME = $wpdb->dbname;
     24        $this->DB_USER = $wpdb->dbuser;
     25        $this->DB_PASSWD = $wpdb->dbpassword;
     26        $this->DB_HOST = $wpdb->dbhost;
     27        $this->DB_PREFIX = $wpdb->base_prefix . 'html5av_';
    2828        $tempHost = explode(':', $this->DB_HOST);
    2929        if (isset($tempHost[1])) {
     
    5050    }
    5151
    52     public function tableExist() {
    53         $result = $this->query("show tables;");
    54         $array = $result->fetchAll();
    55         $bool = false;
    56         foreach ($array as $key => $value) {
    57             if (preg_match('#^' . $this->DB_PREFIX . '#i', $value[0])) {
    58                 $bool = true;
    59             }
    60         }
    61         return $bool;
    62     }
    63 
    6452    public function setUpTables() {
    6553        $this->execFile('main.sql');
    66         update_option('html5av_manager_dbrev', self::DBRev);
     54        if (!(int) get_option('html5av_manager_dbrev')) {
     55            update_option('html5av_manager_dbrev', self::DBRev);
     56        }
    6757    }
    6858
     
    8171
    8272    private function execFile($file) {
    83         global $table_prefix;
     73        global $wpdb;
    8474        $file = html5av_manager::getDir() . "/sql/" . $file;
    8575        $sql = file_get_contents($file);
    8676        $sql = str_replace("_prefix_", $this->DB_PREFIX, $sql);
    87         $sql = str_replace("_wpprefix_", $table_prefix, $sql);
     77        $sql = str_replace("_wpprefix_", $wpdb->base_prefix, $sql);
    8878        $this->exec($sql);
     79        if ($this->errorCode() != 00000) {
     80            print_r($this->errorInfo());
     81        }
    8982    }
    9083
  • html5avmanager/trunk/readme.txt

    r446745 r453038  
    55Requires at least: 2.7
    66Tested up to: 3.2
    7 Stable tag: 0.1.18
     7Stable tag: 0.1.20
    88
    99A HTML5 Audio and Video manager that take full advantage of
     
    6161
    6262== Changelog ==
     63
     64= 0.1.20 =
     65* Now get database details from wpdb rather than wp-config.
     66
     67= 0.1.18 =
     68* Updated mediaelement.js
    6369
    6470= 0.1.17 =
  • html5avmanager/trunk/sql/main.sql

    r398851 r453038  
    11-- rev 2
    22
    3 CREATE TABLE `_prefix_audio_video` (
    4     ID bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
     3CREATE TABLE IF NOT EXISTS `_prefix_audio_video` (
     4    `ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    55    `type` varchar(20) NOT NULL,
    6     poster_path longtext NOT NULL,
    7     poster_filename longtext NOT NULL,
    8     width bigint(20) UNSIGNED NOT NULL,
    9     height bigint(20) UNSIGNED NOT NULL,
     6    `poster_path` longtext NOT NULL,
     7    `poster_filename` longtext NOT NULL,
     8    `width` bigint(20) UNSIGNED NOT NULL,
     9    `height` bigint(20) UNSIGNED NOT NULL,
    1010    `view` varchar(255),
    11     title varchar(255) NOT NULL,
    12     alt varchar(255),
    13     author_id bigint(20) UNSIGNED NOT NULL,
    14     created_on datetime NOT NULL,
    15     modified datetime NOT NULL
    16 ) ENGINE=innodb CHARACTER SET utf8 COLLATE utf8_general_ci;
     11    `title` varchar(255) NOT NULL,
     12    `alt` varchar(255),
     13    `author_id` bigint(20) UNSIGNED NOT NULL,
     14    `created_on` datetime NOT NULL,
     15    `modified` datetime NOT NULL
     16) ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_general_ci;
    1717
    18 CREATE TABLE `_prefix_source` (
    19     ID bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    20     order_no bigint(20) UNSIGNED NOT NULL,
     18CREATE TABLE IF NOT EXISTS `_prefix_source` (
     19    `ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
     20    `order_no` bigint(20) UNSIGNED NOT NULL,
    2121    `type` varchar(255) NOT NULL,
    22     external_mode boolean NOT NULL,
    23     external_url longtext,
    24     upload_path longtext,
    25     upload_filename longtext,
    26     disabled boolean NOT NULL,
    27     audio_video_id bigint(20) UNSIGNED NOT NULL,
     22    `external_mode` boolean NOT NULL,
     23    `external_url` longtext,
     24    `upload_path` longtext,
     25    `upload_filename` longtext,
     26    `disabled` boolean NOT NULL,
     27    `audio_video_id` bigint(20) UNSIGNED NOT NULL,
    2828    FOREIGN KEY (audio_video_id) REFERENCES `_prefix_audio_video`(ID)
    2929ON UPDATE CASCADE ON DELETE CASCADE
    30 ) ENGINE=innodb CHARACTER SET utf8 COLLATE utf8_general_ci;
     30) ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_general_ci;
    3131
    32 CREATE TABLE `_prefix_track` (
    33     ID bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
    34     order_no bigint(20) UNSIGNED NOT NULL,
    35     kind varchar(255) NOT NULL,
    36     external_mode boolean NOT NULL,
    37     external_url longtext,
    38     upload_path longtext,
    39     upload_filename longtext,
    40     srclang text,
    41     label text,
    42     disabled boolean NOT NULL,
    43     audio_video_id bigint(20) UNSIGNED NOT NULL,
     32CREATE TABLE IF NOT EXISTS `_prefix_track` (
     33    `ID` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
     34    `order_no` bigint(20) UNSIGNED NOT NULL,
     35    `kind` varchar(255) NOT NULL,
     36    `external_mode` boolean NOT NULL,
     37    `external_url` longtext,
     38    `upload_path` longtext,
     39    `upload_filename` longtext,
     40    `srclang` text,
     41    `label` text,
     42    `disabled` boolean NOT NULL,
     43    `audio_video_id` bigint(20) UNSIGNED NOT NULL,
    4444    FOREIGN KEY (audio_video_id) REFERENCES `_prefix_audio_video`(ID)
    4545ON UPDATE CASCADE ON DELETE CASCADE
    46 ) ENGINE=innodb CHARACTER SET utf8 COLLATE utf8_general_ci;
     46) ENGINE = innodb CHARACTER SET utf8 COLLATE utf8_general_ci;
Note: See TracChangeset for help on using the changeset viewer.