6 |
kaklik |
1 |
#*************************
|
|
|
2 |
# Coppermine Photo Gallery
|
|
|
3 |
# ************************
|
|
|
4 |
# Copyright (c) 2003-2005 Coppermine Dev Team
|
|
|
5 |
# v1.1 originaly written by Gregory DEMAR
|
|
|
6 |
#
|
|
|
7 |
# This program is free software; you can redistribute it and/or modify
|
|
|
8 |
# it under the terms of the GNU General Public License as published by
|
|
|
9 |
# the Free Software Foundation; either version 2 of the License, or
|
|
|
10 |
# (at your option) any later version.
|
|
|
11 |
# ********************************************
|
|
|
12 |
# Coppermine version: 1.3.3
|
|
|
13 |
# $Source: /cvsroot/coppermine/stable/sql/update.sql,v $
|
|
|
14 |
# $Revision: 1.14 $
|
|
|
15 |
# $Author: gaugau $
|
|
|
16 |
# $Date: 2005/04/19 03:17:12 $
|
|
|
17 |
#**********************************************
|
|
|
18 |
|
|
|
19 |
#
|
|
|
20 |
# Table structure for table `CPG_filetypes`
|
|
|
21 |
#
|
|
|
22 |
|
|
|
23 |
CREATE TABLE IF NOT EXISTS CPG_filetypes (
|
|
|
24 |
extension char(7) NOT NULL default '',
|
|
|
25 |
mime char(30) default NULL,
|
|
|
26 |
content char(15) default NULL,
|
|
|
27 |
KEY extension (extension)
|
|
|
28 |
) TYPE=MyISAM COMMENT='Used to store the file extensions';
|
|
|
29 |
|
|
|
30 |
ALTER TABLE `CPG_filetypes` DROP INDEX `EXTENSION`, ADD PRIMARY KEY ( `extension` );
|
|
|
31 |
|
|
|
32 |
INSERT INTO CPG_filetypes VALUES ('jpg', 'image/jpg', 'image');
|
|
|
33 |
INSERT INTO CPG_filetypes VALUES ('jpeg', 'image/jpeg', 'image');
|
|
|
34 |
INSERT INTO CPG_filetypes VALUES ('jpe', 'image/jpe', 'image');
|
|
|
35 |
INSERT INTO CPG_filetypes VALUES ('gif', 'image/gif', 'image');
|
|
|
36 |
INSERT INTO CPG_filetypes VALUES ('png', 'image/png', 'image');
|
|
|
37 |
INSERT INTO CPG_filetypes VALUES ('psd', 'image/psd', 'image');
|
|
|
38 |
INSERT INTO CPG_filetypes VALUES ('bmp', 'image/bmp', 'image');
|
|
|
39 |
INSERT INTO CPG_filetypes VALUES ('jpc', 'image/jpc', 'image');
|
|
|
40 |
INSERT INTO CPG_filetypes VALUES ('jp2', 'image/jp2', 'image');
|
|
|
41 |
INSERT INTO CPG_filetypes VALUES ('jpx', 'image/jpx', 'image');
|
|
|
42 |
INSERT INTO CPG_filetypes VALUES ('jb2', 'image/jb2', 'image');
|
|
|
43 |
INSERT INTO CPG_filetypes VALUES ('swc', 'image/swc', 'image');
|
|
|
44 |
INSERT INTO CPG_filetypes VALUES ('iff', 'image/iff', 'image');
|
|
|
45 |
UPDATE CPG_config SET value='ALL' WHERE name='allowed_img_types';
|
|
|
46 |
|
|
|
47 |
INSERT INTO CPG_filetypes VALUES ('asf', 'video/x-ms-asf', 'movie');
|
|
|
48 |
INSERT INTO CPG_filetypes VALUES ('asx', 'video/x-ms-asx', 'movie');
|
|
|
49 |
INSERT INTO CPG_filetypes VALUES ('mpg', 'video/mpeg', 'movie');
|
|
|
50 |
INSERT INTO CPG_filetypes VALUES ('mpeg', 'video/mpeg', 'movie');
|
|
|
51 |
INSERT INTO CPG_filetypes VALUES ('wmv', 'video/x-ms-wmv', 'movie');
|
|
|
52 |
INSERT INTO CPG_filetypes VALUES ('swf', 'application/x-shockwave-flash', 'movie');
|
|
|
53 |
INSERT INTO CPG_filetypes VALUES ('avi', 'video/avi', 'movie');
|
|
|
54 |
INSERT INTO CPG_filetypes VALUES ('mov', 'video/quicktime', 'movie');
|
|
|
55 |
INSERT INTO CPG_config VALUES ('allowed_mov_types', 'ALL');
|
|
|
56 |
|
|
|
57 |
INSERT INTO CPG_filetypes VALUES ('mp3', 'audio/mpeg3', 'audio');
|
|
|
58 |
INSERT INTO CPG_filetypes VALUES ('midi', 'audio/midi', 'audio');
|
|
|
59 |
INSERT INTO CPG_filetypes VALUES ('mid', 'audio/midi', 'audio');
|
|
|
60 |
INSERT INTO CPG_filetypes VALUES ('wma', 'audio/x-ms-wma', 'audio');
|
|
|
61 |
INSERT INTO CPG_filetypes VALUES ('wav', 'audio/wav', 'audio');
|
|
|
62 |
INSERT INTO CPG_filetypes VALUES ('ogg', 'audio/ogg', 'audio');
|
|
|
63 |
INSERT INTO CPG_config VALUES ('allowed_snd_types', 'ALL');
|
|
|
64 |
|
|
|
65 |
INSERT INTO CPG_filetypes VALUES ('ram', 'audio/x-pn-realaudio', 'document');
|
|
|
66 |
INSERT INTO CPG_filetypes VALUES ('ra', 'audio/x-realaudio', 'document');
|
|
|
67 |
INSERT INTO CPG_filetypes VALUES ('rm', 'audio/x-realmedia', 'document');
|
|
|
68 |
INSERT INTO CPG_filetypes VALUES ('tiff', 'image/tiff', 'document');
|
|
|
69 |
INSERT INTO CPG_filetypes VALUES ('tif', 'image/tif', 'document');
|
|
|
70 |
INSERT INTO CPG_filetypes VALUES ('doc', 'application/msword', 'document');
|
|
|
71 |
INSERT INTO CPG_filetypes VALUES ('txt', 'text/plain', 'document');
|
|
|
72 |
INSERT INTO CPG_filetypes VALUES ('rtf', 'text/richtext', 'document');
|
|
|
73 |
INSERT INTO CPG_filetypes VALUES ('pdf', 'application/pdf', 'document');
|
|
|
74 |
INSERT INTO CPG_filetypes VALUES ('xls', 'application/excel', 'document');
|
|
|
75 |
INSERT INTO CPG_filetypes VALUES ('pps', 'application/powerpoint', 'document');
|
|
|
76 |
INSERT INTO CPG_filetypes VALUES ('ppt', 'application/powerpoint', 'document');
|
|
|
77 |
INSERT INTO CPG_filetypes VALUES ('zip', 'application/zip', 'document');
|
|
|
78 |
INSERT INTO CPG_filetypes VALUES ('rar', 'application/rar', 'document');
|
|
|
79 |
INSERT INTO CPG_filetypes VALUES ('gz', 'application/gz', 'document');
|
|
|
80 |
INSERT INTO CPG_filetypes VALUES ('mdb', 'application/msaccess', 'document');
|
|
|
81 |
INSERT INTO CPG_config VALUES ('allowed_doc_types', 'ALL');
|
|
|
82 |
|
|
|
83 |
|
|
|
84 |
#
|
|
|
85 |
# Modify structure for table `CPG_comments`
|
|
|
86 |
#
|
|
|
87 |
|
|
|
88 |
ALTER TABLE CPG_comments add msg_raw_ip tinytext;
|
|
|
89 |
ALTER TABLE CPG_comments add msg_hdr_ip tinytext;
|
|
|
90 |
ALTER TABLE CPG_pictures add pic_raw_ip tinytext;
|
|
|
91 |
ALTER TABLE CPG_pictures add pic_hdr_ip tinytext;
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
INSERT INTO CPG_config VALUES ('thumb_use', 'any');
|
|
|
95 |
INSERT INTO CPG_config VALUES ('show_private', '0');
|
|
|
96 |
INSERT INTO CPG_config VALUES ('first_level', '1');
|
|
|
97 |
INSERT INTO CPG_config VALUES ('display_film_strip', '1');
|
|
|
98 |
INSERT INTO CPG_config VALUES ('max_film_strip_items', '5');
|
|
|
99 |
INSERT INTO CPG_config VALUES ('comment_email_notification', '0');
|
|
|
100 |
INSERT INTO CPG_config VALUES ('read_iptc_data', '0');
|
|
|
101 |
INSERT INTO CPG_config VALUES ('display_uploader', '0');
|
|
|
102 |
|
|
|
103 |
#gtroll wil implement
|
|
|
104 |
#INSERT INTO CPG_config VALUES ('picinfo_display_filename', '1');
|
|
|
105 |
#INSERT INTO CPG_config VALUES ('picinfo_display_album_name', '1');
|
|
|
106 |
#INSERT INTO CPG_config VALUES ('picinfo_display_file_size', '1');
|
|
|
107 |
#INSERT INTO CPG_config VALUES ('picinfo_display_dimensions', '1');
|
|
|
108 |
#INSERT INTO CPG_config VALUES ('picinfo_display_count_displayed', '1');
|
|
|
109 |
#INSERT INTO CPG_config VALUES ('picinfo_display_URL', '1');
|
|
|
110 |
#INSERT INTO CPG_config VALUES ('picinfo_display_URL_bookmark', '1');
|
|
|
111 |
#INSERT INTO CPG_config VALUES ('picinfo_display_favorites', 1');
|
|
|
112 |
|
|
|
113 |
INSERT INTO CPG_config VALUES ('reg_notify_admin_email', '0');
|
|
|
114 |
INSERT INTO CPG_config VALUES ('disable_comment_flood_protect', '0');
|
|
|
115 |
INSERT INTO CPG_config VALUES ('upl_notify_admin_email', '0');
|
|
|
116 |
|
|
|
117 |
INSERT INTO CPG_config VALUES ('language_list', '0');
|
|
|
118 |
INSERT INTO CPG_config VALUES ('language_flags', '0');
|
|
|
119 |
INSERT INTO CPG_config VALUES ('theme_list', '0');
|
|
|
120 |
INSERT INTO CPG_config VALUES ('language_reset', '1');
|
|
|
121 |
INSERT INTO CPG_config VALUES ('theme_reset', '1');
|
|
|
122 |
INSERT INTO CPG_config VALUES ('offline', '0');
|
|
|
123 |
|
|
|
124 |
INSERT INTO CPG_config VALUES ('allow_memberlist', '0');
|
|
|
125 |
INSERT INTO CPG_config VALUES ('display_faq', '0');
|
|
|
126 |
INSERT INTO CPG_config VALUES ('views_in_thumbview', '1');
|
|
|
127 |
INSERT INTO CPG_config VALUES ('show_bbcode_help', '1');
|
|
|
128 |
INSERT INTO CPG_config VALUES ('log_ecards', '0');
|
|
|
129 |
INSERT INTO CPG_config VALUES ('email_comment_notification', '0');
|
|
|
130 |
INSERT INTO CPG_config VALUES ('enable_zipdownload', '1');
|
|
|
131 |
INSERT INTO CPG_config VALUES ('debug_notice', '0');
|
|
|
132 |
INSERT INTO CPG_config VALUES ('slideshow_interval', '5000');
|
|
|
133 |
|
|
|
134 |
|
|
|
135 |
# Modify structure for category thumb
|
|
|
136 |
ALTER TABLE `CPG_categories` ADD `thumb` INT NOT NULL AFTER `parent` ;
|
|
|
137 |
|
|
|
138 |
# Modify structure for multi album pictures
|
|
|
139 |
ALTER TABLE `CPG_albums` ADD `keyword` VARCHAR( 50 ) NOT NULL ;
|
|
|
140 |
|
|
|
141 |
|
|
|
142 |
#
|
|
|
143 |
# Table structure for table `CPG_banned`
|
|
|
144 |
#
|
|
|
145 |
|
|
|
146 |
CREATE TABLE CPG_banned (
|
|
|
147 |
ban_id int(11) NOT NULL auto_increment,
|
|
|
148 |
user_id int(11) DEFAULT NULL,
|
|
|
149 |
ip_addr tinytext DEFAULT NULL,
|
|
|
150 |
expiry datetime DEFAULT NULL,
|
|
|
151 |
PRIMARY KEY (ban_id)
|
|
|
152 |
) TYPE=MyISAM;
|
|
|
153 |
|
|
|
154 |
#
|
|
|
155 |
# Table structure for table `CPG_exif`
|
|
|
156 |
#
|
|
|
157 |
CREATE TABLE CPG_exif (
|
|
|
158 |
`filename` varchar(255) NOT NULL default '',
|
|
|
159 |
`exifData` text NOT NULL,
|
|
|
160 |
UNIQUE KEY `filename` (`filename`)
|
|
|
161 |
) TYPE=MyISAM;
|
|
|
162 |
|
|
|
163 |
#
|
|
|
164 |
# Table structure for table `CPG_ecards`
|
|
|
165 |
#
|
|
|
166 |
|
|
|
167 |
CREATE TABLE CPG_ecards (
|
|
|
168 |
eid int(11) NOT NULL auto_increment,
|
|
|
169 |
sender_name varchar(50) NOT NULL default '',
|
|
|
170 |
sender_email text NOT NULL,
|
|
|
171 |
recipient_name varchar(50) NOT NULL default '',
|
|
|
172 |
recipient_email text NOT NULL,
|
|
|
173 |
link text NOT NULL,
|
|
|
174 |
date tinytext NOT NULL,
|
|
|
175 |
sender_ip tinytext NOT NULL,
|
|
|
176 |
PRIMARY KEY (eid)
|
|
|
177 |
) TYPE=MyISAM COMMENT='Used to log ecards';
|
|
|
178 |
|
|
|
179 |
#
|
|
|
180 |
# Modify structure for table 'CPG_usergroups' - Upload form control - Hyperion
|
|
|
181 |
#
|
|
|
182 |
|
|
|
183 |
ALTER TABLE `CPG_usergroups` ADD `upload_form_config` TINYINT(4) DEFAULT '3' NOT NULL;
|
|
|
184 |
ALTER TABLE `CPG_usergroups` ADD `custom_user_upload` TINYINT(4) DEFAULT '0' NOT NULL;
|
|
|
185 |
ALTER TABLE `CPG_usergroups` ADD `num_file_upload` TINYINT(4) DEFAULT '5' NOT NULL;
|
|
|
186 |
ALTER TABLE `CPG_usergroups` ADD `num_URI_upload` TINYINT(4) DEFAULT '3' NOT NULL;
|
|
|
187 |
|
|
|
188 |
|
|
|
189 |
|
|
|
190 |
#
|
|
|
191 |
# Table structure for table `CPG_temp_data` - Temporary data for file uploads - Hyperion
|
|
|
192 |
#
|
|
|
193 |
|
|
|
194 |
CREATE TABLE IF NOT EXISTS `CPG_temp_data` (
|
|
|
195 |
`unique_ID` CHAR( 8 ) NOT NULL ,
|
|
|
196 |
`encoded_string` BLOB NOT NULL ,
|
|
|
197 |
`timestamp` INT( 11 ) UNSIGNED NOT NULL ,
|
|
|
198 |
PRIMARY KEY ( `unique_ID` )
|
|
|
199 |
) TYPE = MYISAM COMMENT = 'Holds temporary file data for multiple file uploads';
|
|
|
200 |
|
|
|
201 |
#
|
|
|
202 |
# Close security hole and re-point default theme in 1.3 - Jack
|
|
|
203 |
#
|
|
|
204 |
|
|
|
205 |
UPDATE `CPG_config` SET value='classic' WHERE (name='theme' AND value='default');
|
|
|
206 |
DELETE FROM `CPG_filetypes` WHERE mime='text/html';
|
|
|
207 |
|
|
|
208 |
#
|
|
|
209 |
# Finally remove all user_lang references - Jack
|
|
|
210 |
#
|
|
|
211 |
|
|
|
212 |
ALTER TABLE `CPG_users` CHANGE user_lang user_group_list varchar(255) NOT NULL default '';
|
|
|
213 |
|
|
|
214 |
#
|
|
|
215 |
# Fix usermgr timing out with 1k+ users -Omni
|
|
|
216 |
#
|
|
|
217 |
ALTER TABLE CPG_pictures DROP INDEX `owner_id`;
|
|
|
218 |
ALTER TABLE CPG_pictures DROP INDEX `owner_id_2`;
|
|
|
219 |
ALTER TABLE CPG_pictures DROP INDEX `owner_id_3`;
|
|
|
220 |
ALTER TABLE CPG_pictures DROP INDEX `owner_id_4`;
|
|
|
221 |
ALTER TABLE CPG_pictures ADD INDEX owner_id( `owner_id` );
|
|
|
222 |
|
|
|
223 |
|
|
|
224 |
#
|
|
|
225 |
# Record the last hit IP
|
|
|
226 |
#
|
|
|
227 |
|
|
|
228 |
ALTER TABLE `CPG_pictures` ADD `lasthit_ip` TINYTEXT ;
|