This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpntables.php
268 lines (234 loc) · 9.64 KB
/
pntables.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
<?php
// $Id$
//
// Mediashare by Jorn Wildt (C)
//
/**
* This function is called internally by the core whenever the module is
* loaded. It adds in information about the tables that the module uses.
*/
function mediashare_pntables()
{
$pntable = array();
// Album and media setup
$pntable['mediashare_albums'] = DBUtil::getLimitedTablename('mediashare_albums');
$pntable['mediashare_albums_column'] = array(
'id' => 'ms_id',
'ownerId' => 'ms_ownerid',
'createdDate' => 'ms_createddate',
'modifiedDate' => 'ms_modifieddate',
'title' => 'ms_title',
'keywords' => 'ms_keywords',
'summary' => 'ms_summary',
'description' => 'ms_description',
'template' => 'ms_template',
'parentAlbumId' => 'ms_parentAlbumId',
'access' => 'ms_accesslevel',
'viewKey' => 'ms_viewkey',
'mainMediaId' => 'ms_mainmediaid',
'thumbnailSize' => 'ms_thumbnailsize',
'nestedSetLeft' => 'ms_nestedsetleft',
'nestedSetRight' => 'ms_nestedsetright',
'nestedSetLevel' => 'ms_nestedsetlevel',
'extappURL' => 'ms_extappURL',
'extappData' => 'ms_extappData'
);
$pntable['mediashare_albums_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'ownerId' => 'I NOTNULL',
'createdDate' => 'T NOTNULL',
'modifiedDate' => 'T NOTNULL DEFTIMESTAMP',
'title' => "C(255) NOTNULL DEFAULT ''",
'keywords' => "C(255) NOTNULL DEFAULT ''",
'summary' => "X NOTNULL DEFAULT ''",
'description' => "X NOTNULL DEFAULT ''",
'template' => "C(255) NOTNULL DEFAULT 'msslideshow'",
'parentAlbumId' => 'I',
'access' => 'I1 NOTNULL DEFAULT 0',
'viewKey' => 'C(32) NOTNULL',
'mainMediaId' => 'I NOTNULL DEFAULT 0',
'thumbnailSize' => 'I NOTNULL',
'nestedSetLeft' => 'I NOTNULL DEFAULT 0',
'nestedSetRight' => 'I NOTNULL DEFAULT 0',
'nestedSetLevel' => 'I NOTNULL DEFAULT 0',
'extappURL' => 'C(255)',
'extappData' => 'C(512)'
);
// Media information
$pntable['mediashare_media'] = DBUtil::getLimitedTablename('mediashare_media');
$pntable['mediashare_media_column'] = array(
'id' => 'ms_id',
'ownerId' => 'ms_ownerid',
'createdDate' => 'ms_createddate',
'modifiedDate' => 'ms_modifieddate',
'title' => 'ms_title',
'keywords' => 'ms_keywords',
'description' => 'ms_description',
'parentAlbumId' => 'ms_parentalbumid',
'position' => 'ms_position',
'mediaHandler' => 'ms_mediahandler',
'thumbnailId' => 'ms_thumbnailid',
'previewId' => 'ms_previewid',
'originalId' => 'ms_originalid'
);
$pntable['mediashare_media_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'ownerId' => 'I NOTNULL',
'createdDate' => 'T NOTNULL',
'modifiedDate' => 'T NOTNULL DEFTIMESTAMP',
'title' => "C(255) NOTNULL DEFAULT ''",
'keywords' => "C(255) NOTNULL DEFAULT ''",
'description' => "X NOTNULL DEFAULT ''",
'parentAlbumId' => 'I NOTNULL',
'position' => 'I NOTNULL',
'mediaHandler' => 'C(50) NOTNULL',
'thumbnailId' => 'I NOTNULL',
'previewId' => 'I NOTNULL',
'originalId' => 'I NOTNULL'
);
// Keyword handling
$pntable['mediashare_keywords'] = DBUtil::getLimitedTablename('mediashare_keywords');
$pntable['mediashare_keywords_column'] = array(
'itemId' => 'ms_itemid',
'type' => 'ms_type',
'keyword' => 'ms_keyword'
);
$pntable['mediashare_keywords_column_def'] = array(
'itemId' => 'I NOTNULL',
'type' => 'C(5) NOTNULL',
'keyword' => 'C(50) NOTNULL'
);
$pntable['mediashare_keywords_column_idx'] = array('keywordIdx' => array('keyword'));
// Media storage (image information)
$pntable['mediashare_mediastore'] = DBUtil::getLimitedTablename('mediashare_mediastore');
$pntable['mediashare_mediastore_column'] = array(
'id' => 'mss_id',
'fileRef' => 'mss_fileref',
'mimeType' => 'mss_mimetype',
'width' => 'mss_width',
'height' => 'mss_height',
'bytes' => 'mss_bytes'
);
$pntable['mediashare_mediastore_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'fileRef' => 'C(300) NOTNULL',
'mimeType' => 'C(100) NOTNULL',
'width' => 'I2 NOTNULL',
'height' => 'I2 NOTNULL',
'bytes' => 'I NOTNULL'
);
// Media DB storage (image data for storing images in DB)
$pntable['mediashare_mediadb'] = DBUtil::getLimitedTablename('mediashare_mediadb');
$pntable['mediashare_mediadb_column'] = array(
'id' => 'mdb_id',
'fileref' => 'mdb_ref',
'mode' => 'mdb_mode',
'type' => 'mdb_type',
'bytes' => 'mdb_bytes',
'data' => 'mdb_data'
);
$pntable['mediashare_mediadb_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'fileref' => 'C(50) NOTNULL',
'mode' => 'C(20) NOTNULL',
'type' => 'C(10) NOTNULL',
'bytes' => 'I NOTNULL',
'data' => 'B NOTNULL'
);
// Media handlers
$pntable['mediashare_mediahandlers'] = DBUtil::getLimitedTablename('mediashare_mediahandlers');
$pntable['mediashare_mediahandlers_column'] = array(
'id' => 'ms_id',
'mimeType' => 'ms_mimetype',
'fileType' => 'ms_filetype',
'foundMimeType' => 'ms_foundmimetype',
'foundFileType' => 'ms_foundfiletype',
'handler' => 'ms_handler',
'title' => 'ms_title',
'active' => 'ms_active'
);
$pntable['mediashare_mediahandlers_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'mimeType' => 'C(50)',
'fileType' => 'C(10)',
'foundMimeType' => 'C(50) NOTNULL',
'foundFileType' => 'C(50) NOTNULL',
'handler' => 'C(50) NOTNULL',
'title' => "C(50) NOTNULL DEFAULT ''",
'active' => 'I1 NOTNULL DEFAULT 1'
);
// Sources
$pntable['mediashare_sources'] = DBUtil::getLimitedTablename('mediashare_sources');
$pntable['mediashare_sources_column'] = array(
'id' => 'ms_id',
'name' => 'ms_name',
'title' => 'ms_title',
'formEncType' => 'ms_formenctype',
'active' => 'ms_active'
);
$pntable['mediashare_sources_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'name' => 'C(50) NOTNULL',
'title' => "C(50) NOTNULL DEFAULT ''",
'formEncType' => "C(50) NOTNULL DEFAULT 'multipart/form-data'",
'active' => 'I1 NOTNULL DEFAULT 1'
);
// Access table setup
$pntable['mediashare_access'] = DBUtil::getLimitedTablename('mediashare_access');
$pntable['mediashare_access_column'] = array(
'id' => 'msa_id', // Unique ID
'albumId' => 'msa_albumid', // album ID for which access applies
'groupId' => 'msa_groupid', // (user) group ID for which access applies
'access' => 'msa_access' // access type
);
$pntable['mediashare_access_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'albumId' => 'I NOTNULL',
'groupId' => 'I NOTNULL',
'access' => 'I NOTNULL'
);
$pntable['mediashare_access_column_idx'] = array('albumIdIdx' => array('albumId'));
// Setup table setup
$pntable['mediashare_setup'] = DBUtil::getLimitedTablename('mediashare_setup');
$pntable['mediashare_setup_column'] = array(
'id' => 'ms_id', // Unique ID
'kind' => 'ms_kind', // 0: group, 1: user
'storageLimit' => 'ms_storagelimit', // Storage limit
'unitId' => 'ms_unitid' // User or group id this applies to
);
$pntable['mediashare_setup_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'kind' => 'I1 NOTNULL',
'storageLimit' => 'I NOTNULL',
'unitId' => 'I NOTNULL'
);
// Invitations table
$pntable['mediashare_invitation'] = DBUtil::getLimitedTablename('mediashare_invitation');
$pntable['mediashare_invitation_column'] = array(
'id' => 'msinv_id',
'created' => 'msinv_created',
'albumId' => 'msinv_albumid',
'key' => 'msinv_key',
'viewCount' => 'msinv_count',
'email' => 'msinv_email',
'subject' => 'msinv_subject',
'text' => 'msinv_text',
'sender' => 'msinv_sender',
'expires' => 'msinv_expires'
);
$pntable['mediashare_invitation_column_def'] = array(
'id' => 'I NOTNULL AUTO PRIMARY',
'created' => 'T NOTNULL',
'albumId' => 'I NOTNULL',
'key' => "C(20) NOTNULL DEFAULT ''",
'viewCount' => 'I NOTNULL DEFAULT 0',
'email' => "C(100) NOTNULL DEFAULT ''",
'subject' => "C(255) NOTNULL DEFAULT ''",
'text' => "X NOTNULL DEFAULT ''",
'sender' => "C(50) NOTNULL DEFAULT ''",
'expires' => 'T'
);
// Photoshare upgrade table (deprecated)
$pntable['mediashare_photoshare'] = DBUtil::getLimitedTablename('mediashare_photoshare');
return $pntable;
}