This repository has been archived by the owner on Jul 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.php
69 lines (57 loc) · 2.72 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/*
Website Baker Project <http://www.websitebaker.org/>
Copyright (C) 2004-2008, Ryan Djurovich
Website Baker 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.
Website Baker 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 Website Baker; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// prevent this file from being accessed directly
if (!defined('WB_PATH'))
die(header('Location: index.php'));
/*
* Delete existing tables
*/
$database->query("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "mod_foldergallery_settings`");
$database->query("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "mod_foldergallery_files`");
$database->query("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "mod_foldergallery_categories`");
// create a new, clean module DB-table)
$sql = "CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "mod_foldergallery_settings` ("
. "`id` int(11) NOT NULL AUTO_INCREMENT,"
. "`section_id` int(11) NOT NULL,"
. "`s_name` varchar(100) NOT NULL,"
. "`s_value` TEXT NOT NULL,"
. "PRIMARY KEY (`id`));";
$database->query($sql);
$sql = 'CREATE TABLE `' . TABLE_PREFIX . 'mod_foldergallery_files` ( '
. '`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,'
. '`parent_id` INT NOT NULL DEFAULT \'0\','
. '`file_name` VARCHAR(255) NOT NULL DEFAULT \'\','
. '`position` INT NOT NULL DEFAULT \'0\', '
. '`caption` TEXT NOT NULL DEFAULT \'\');';
$database->query($sql);
$sql = 'CREATE TABLE `' . TABLE_PREFIX . 'mod_foldergallery_categories` ( '
. '`id` INT AUTO_INCREMENT,'
. '`section_id` INT NOT NULL DEFAULT \'0\','
. '`parent_id` INT NOT NULL DEFAULT \'0\','
. '`categorie` VARCHAR(255) NOT NULL DEFAULT \'\','
. '`parent` VARCHAR(255) NOT NULL DEFAULT \'\','
. '`cat_name` VARCHAR(255) NOT NULL DEFAULT \'\','
. '`active` TINYINT NOT NULL DEFAULT \'1\','
. '`is_empty` INT NOT NULL DEFAULT \'1\','
. '`position`INT NOT NULL DEFAULT \'0\','
. '`niveau` INT NOT NULL DEFAULT \'-1\','
. '`has_child` INT NOT NULL DEFAULT \'0\','
. '`childs` VARCHAR(255) NOT NULL DEFAULT \'\','
. '`description` TEXT NOT NULL DEFAULT \'\','
. 'PRIMARY KEY (id));';
$database->query($sql);
?>