1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* extcal module. |
4
|
|
|
* |
5
|
|
|
* You may not change or alter any portion of this comment or credits |
6
|
|
|
* of supporting developers from this source code or any supporting source code |
7
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
8
|
|
|
* This program is distributed in the hope that it will be useful, |
9
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11
|
|
|
* |
12
|
|
|
* @copyright XOOPS Project (http://xoops.org) |
13
|
|
|
* @license http://www.fsf.org/copyleft/gpl.html GNU public license |
14
|
|
|
* |
15
|
|
|
* @since 2.2 |
16
|
|
|
* |
17
|
|
|
* @author JJDai <http://xoops.kiolo.com> |
18
|
|
|
**/ |
19
|
|
|
//---------------------------------------------------- |
20
|
|
|
class Extcal_2_15 |
|
|
|
|
21
|
|
|
{ |
22
|
|
|
//---------------------------------------------------- |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @param XoopsModule $module |
26
|
|
|
* @param $options |
27
|
|
|
*/ |
28
|
|
|
public function __construct(XoopsModule $module, $options) |
|
|
|
|
29
|
|
|
{ |
30
|
|
|
global $xoopsDB; |
|
|
|
|
31
|
|
|
|
32
|
|
|
//$xoopsDB = Database::getInstance(); |
|
|
|
|
33
|
|
|
$xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
34
|
|
|
|
35
|
|
|
$sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . "` CHANGE `event_approved` `event_approved` TINYINT( 1 ) NOT NULL DEFAULT '0' ;"; |
36
|
|
|
$xoopsDB->query($sql); |
37
|
|
|
|
38
|
|
|
$sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_isrecur` TINYINT( 1 ) NOT NULL AFTER `event_nbmember` ;'; |
39
|
|
|
$xoopsDB->query($sql); |
40
|
|
|
|
41
|
|
|
$sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_recur_rules` VARCHAR( 255 ) NOT NULL AFTER `event_isrecur` '; |
42
|
|
|
$xoopsDB->query($sql); |
43
|
|
|
|
44
|
|
|
$sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_recur_start` INT( 11 ) NOT NULL AFTER `event_recur_rules` ;'; |
45
|
|
|
$xoopsDB->query($sql); |
46
|
|
|
|
47
|
|
|
$sql = 'ALTER TABLE `' . $xoopsDB->prefix('extcal_event') . '` ADD `event_recur_end` INT( 11 ) NOT NULL AFTER `event_recur_start` ;'; |
48
|
|
|
$xoopsDB->query($sql); |
49
|
|
|
|
50
|
|
|
$sql = 'CREATE TABLE `' . $xoopsDB->prefix('extcal_event') |
51
|
|
|
. "` (`eventnotmember_id` int(11) NOT NULL auto_increment,`event_id` int(11) NOT NULL default '0',`uid` int(11) NOT NULL default '0',PRIMARY KEY (`eventnotmember_id`),UNIQUE KEY `eventnotmember` (`event_id`,`uid`)) COMMENT='eXtcal By Zoullou' ;"; |
52
|
|
|
$xoopsDB->query($sql); |
53
|
|
|
|
54
|
|
|
$sql = 'CREATE TABLE `' . $xoopsDB->prefix('extcal_file') |
55
|
|
|
. "` (`file_id` int(11) NOT NULL auto_increment,`file_name` varchar(255) NOT NULL,`file_nicename` varchar(255) NOT NULL,`file_mimetype` varchar(255) NOT NULL,`file_size` int(11) NOT NULL,`file_download` int(11) NOT NULL,`file_date` int(11) NOT NULL,`file_approved` tinyint(1) NOT NULL,`event_id` int(11) NOT NULL,`uid` int(11) NOT NULL,PRIMARY KEY (`file_id`)) COMMENT='eXtcal By Zoullou' ;"; |
56
|
|
|
$xoopsDB->query($sql); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
//----------------------------------------------------------------- |
60
|
|
|
} // fin de la classe |
61
|
|
|
|
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.