1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* You may not change or alter any portion of this comment or credits |
4
|
|
|
* of supporting developers from this source code or any supporting source code |
5
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
* |
7
|
|
|
* This program is distributed in the hope that it will be useful, |
8
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @copyright {@link http://xoops.org/ XOOPS Project} |
14
|
|
|
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
15
|
|
|
* @package |
16
|
|
|
* @since |
17
|
|
|
* @author XOOPS Development Team, |
18
|
|
|
* @author GIJ=CHECKMATE (PEAK Corp. http://www.peak.ne.jp/) |
19
|
|
|
* @author Antiques Promotion (http://www.antiquespromotion.ca) |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
defined('XOOPS_ROOT_PATH') || exit('XOOPS Root Path not defined'); |
23
|
|
|
|
24
|
|
|
$moduleDirName = basename(dirname(__DIR__)); |
25
|
|
|
if (!preg_match('/^(\D+)(\d*)$/', $moduleDirName, $regs)) { |
26
|
|
|
die('invalid dirname: ' . htmlspecialchars($moduleDirName)); |
27
|
|
|
} |
28
|
|
|
$mydirnumber = $regs[2] === '' ? '' : (int)$regs[2]; |
29
|
|
|
|
30
|
|
|
eval(' |
31
|
|
|
|
32
|
|
|
function apcal' . $mydirnumber . '_search( $keywords , $andor , $limit , $offset , $uid ) |
33
|
|
|
{ |
34
|
|
|
return apcal_search_base( "' . $moduleDirName . '" , $keywords , $andor , $limit , $offset , $uid ) ; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
'); |
38
|
|
|
|
39
|
|
|
if (!function_exists('apcal_search_base')) { |
40
|
|
|
/** |
41
|
|
|
* @param $moduleDirName |
42
|
|
|
* @param $keywords |
43
|
|
|
* @param $andor |
44
|
|
|
* @param $limit |
45
|
|
|
* @param $offset |
46
|
|
|
* @param $uid |
47
|
|
|
* @return array |
48
|
|
|
*/ |
49
|
|
|
function apcal_search_base($moduleDirName, $keywords, $andor, $limit, $offset, $uid) |
50
|
|
|
{ |
51
|
|
|
global $xoopsConfig, $xoopsDB, $xoopsUser; |
52
|
|
|
|
53
|
|
|
// setting physical & virtual paths |
54
|
|
|
$mod_path = XOOPS_ROOT_PATH . "/modules/$moduleDirName"; |
55
|
|
|
$mod_url = XOOPS_URL . "/modules/$moduleDirName"; |
56
|
|
|
|
57
|
|
|
// defining class of APCal |
58
|
|
|
if (!class_exists('APCal_xoops')) { |
59
|
|
|
require_once "$mod_path/class/APCal.php"; |
60
|
|
|
require_once "$mod_path/class/APCal_xoops.php"; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
// creating an instance of APCal |
64
|
|
|
$cal = new APCal_xoops('', $xoopsConfig['language'], true); |
65
|
|
|
$cal->use_server_TZ = true; |
66
|
|
|
|
67
|
|
|
// setting properties of APCal |
68
|
|
|
$cal->conn = $GLOBALS['xoopsDB']->conn; |
69
|
|
|
include "$mod_path/include/read_configs.php"; |
70
|
|
|
$cal->images_url = "$mod_url/assets/images/$skin_folder"; |
|
|
|
|
71
|
|
|
$cal->images_path = "$mod_path/assets/images/$skin_folder"; |
72
|
|
|
|
73
|
|
|
$ret = $cal->get_xoops_search_result($keywords, $andor, $limit, $offset, $uid); |
74
|
|
|
|
75
|
|
|
return $ret; |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.