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_21 |
|
|
|
|
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
|
|
|
// Create eXtcal upload directory if don't exist |
33
|
|
|
$dir = XOOPS_ROOT_PATH . '/uploads/extcal'; |
34
|
|
|
if (!is_dir($dir)) { |
35
|
|
|
mkdir($dir); |
36
|
|
|
|
37
|
|
|
// Copy index.html files on uploads folders |
38
|
|
|
$indexFile = __DIR__ . '/index.html'; |
39
|
|
|
copy($indexFile, XOOPS_ROOT_PATH . '/uploads/extcal/index.html'); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
// Create who's not going table to fix bug. If the table exist, the query will faile |
43
|
|
|
$sql = 'CREATE TABLE `' . $xoopsDB->prefix('extcal_eventnotmember') |
44
|
|
|
. "` (`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' ;"; |
45
|
|
|
$xoopsDB->query($sql); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
//----------------------------------------------------------------- |
49
|
|
|
} // fin de la classe |
50
|
|
|
|
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.