2010-09-24 04:02:46 +00:00
|
|
|
<?php defined("SYSPATH") or die("No direct script access.");
|
|
|
|
/**
|
|
|
|
* Gallery - a web based photo album viewer and editor
|
2011-04-22 04:33:11 +00:00
|
|
|
* Copyright (C) 2000-2010 Bharat Mediratta
|
2010-09-24 04:02:46 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
2011-04-22 04:33:11 +00:00
|
|
|
|
|
|
|
// rWatcher Edit: This file was server_add_installer.
|
|
|
|
// All occurences of server_add have been replaced with videos.
|
|
|
|
// The installer has been edited to create an additional table and module variable.
|
|
|
|
// The upgrader has been edited to skip everything before version 4, to keep version numbers in sync with server_add.
|
|
|
|
|
2010-09-24 04:02:46 +00:00
|
|
|
class videos_installer {
|
|
|
|
static function install() {
|
|
|
|
$db = Database::instance();
|
2011-04-22 04:33:11 +00:00
|
|
|
$db->query("CREATE TABLE {videos_entries} (
|
2010-09-24 04:02:46 +00:00
|
|
|
`id` int(9) NOT NULL auto_increment,
|
2011-04-22 04:33:11 +00:00
|
|
|
`checked` boolean default 0,
|
|
|
|
`is_directory` boolean default 0,
|
2010-09-24 04:02:46 +00:00
|
|
|
`item_id` int(9),
|
|
|
|
`parent_id` int(9),
|
2011-04-22 04:33:11 +00:00
|
|
|
`path` varchar(255) NOT NULL,
|
2010-09-24 04:02:46 +00:00
|
|
|
`task_id` int(9) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`))
|
|
|
|
DEFAULT CHARSET=utf8;");
|
2011-04-22 04:33:11 +00:00
|
|
|
|
|
|
|
// rWatcher Edit: My Table.
|
2010-09-24 04:02:46 +00:00
|
|
|
$db->query("CREATE TABLE {items_videos} (
|
|
|
|
`id` int(9) NOT NULL auto_increment,
|
|
|
|
`item_id` int(9) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`),
|
|
|
|
KEY (`item_id`, `id`))
|
|
|
|
DEFAULT CHARSET=utf8;");
|
2011-04-22 04:33:11 +00:00
|
|
|
// rWatcher Edit: My Variable.
|
2010-09-24 04:02:46 +00:00
|
|
|
module::set_var("videos", "allowed_extensions", serialize(array("avi", "mpg", "mpeg", "mov", "wmv", "asf", "mts")));
|
2011-04-22 04:33:11 +00:00
|
|
|
|
|
|
|
module::set_version("videos", 4);
|
2010-09-24 04:02:46 +00:00
|
|
|
videos::check_config();
|
|
|
|
}
|
|
|
|
|
2011-04-22 04:33:11 +00:00
|
|
|
static function upgrade($version) {
|
|
|
|
$db = Database::instance();
|
|
|
|
|
|
|
|
if ($version < 4) {
|
|
|
|
$db->query("DROP TABLE {videos_files}");
|
|
|
|
$db->query("CREATE TABLE {videos_entries} (
|
|
|
|
`id` int(9) NOT NULL auto_increment,
|
|
|
|
`checked` boolean default 0,
|
|
|
|
`is_directory` boolean default 0,
|
|
|
|
`item_id` int(9),
|
|
|
|
`parent_id` int(9),
|
|
|
|
`path` varchar(255) NOT NULL,
|
|
|
|
`task_id` int(9) NOT NULL,
|
|
|
|
PRIMARY KEY (`id`))
|
|
|
|
DEFAULT CHARSET=utf8;");
|
|
|
|
module::set_version("videos", $version = 4);
|
|
|
|
}
|
2010-09-24 04:02:46 +00:00
|
|
|
}
|
|
|
|
|
2011-04-22 04:33:11 +00:00
|
|
|
static function deactivate() {
|
|
|
|
site_status::clear("videos_configuration");
|
2010-09-24 04:02:46 +00:00
|
|
|
}
|
|
|
|
}
|