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 https://xoops.org/ XOOPS Project} |
14
|
|
|
* @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
15
|
|
|
* @package efqdirectory |
16
|
|
|
* @since |
17
|
|
|
* @author Martijn Hertog (aka wtravel) |
18
|
|
|
* @author XOOPS Development Team, |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
/****************************************************************************** |
22
|
|
|
* Function: b_efqdiralpha1_menu_show |
23
|
|
|
* Input : $options[0] = date for the most recent links |
24
|
|
|
* hits for the most popular links |
25
|
|
|
* $block['content'] = The optional above content |
26
|
|
|
* $options[1] = How many reviews are displayes |
27
|
|
|
* Output : Returns the desired most recent or most popular links |
28
|
|
|
***************************************************************************** |
29
|
|
|
* @param $options |
30
|
|
|
* @return array |
31
|
|
|
*/ |
32
|
|
|
|
33
|
|
|
function b_efqdiralpha1_menu_show($options) |
|
|
|
|
34
|
|
|
{ |
35
|
|
|
global $xoopsDB, $xoopsModule, $eh; |
36
|
|
|
// $info = __DIR__; |
|
|
|
|
37
|
|
|
// $split = preg_split("#[\\\]#", $info); |
|
|
|
|
38
|
|
|
// $count = count($split) - 2; |
|
|
|
|
39
|
|
|
// $moddir = $split[$count]; |
|
|
|
|
40
|
|
|
// $moddir = $xoopsModule->getvar("dirname"); |
|
|
|
|
41
|
|
|
$dirname = basename(dirname(__DIR__)); |
42
|
|
|
$moduleHandler = xoops_getHandler('module'); |
|
|
|
|
43
|
|
|
$module = $moduleHandler->getByDirname($dirname); |
44
|
|
|
$moddir = $module->getvar('dirname'); |
45
|
|
|
|
46
|
|
|
$block = array(); |
47
|
|
|
$block['lang_dirmenu'] = _MB_EFQDIR_MENU; |
48
|
|
|
$block['moddir'] = $moddir; |
49
|
|
|
$myts = MyTextSanitizer::getInstance(); |
|
|
|
|
50
|
|
|
$result = $xoopsDB->query('SELECT dirid, name, descr FROM ' . $xoopsDB->prefix($module->getVar('dirname', 'n') . '_dir') . " WHERE open='1' ORDER BY name") or $eh->show('0013'); |
51
|
|
View Code Duplication |
while ($myrow = $xoopsDB->fetchArray($result)) { |
|
|
|
|
52
|
|
|
$directory = array(); |
53
|
|
|
$name = $myts->htmlSpecialChars($myrow['name']); |
54
|
|
|
$directory['dirid'] = $myrow['dirid']; |
55
|
|
|
$directory['name'] = $name; |
56
|
|
|
$directory['descr'] = $myrow['descr']; |
57
|
|
|
$block['directories'][] = $directory; |
58
|
|
|
} |
59
|
|
|
$sublink = array(); |
|
|
|
|
60
|
|
|
|
61
|
|
|
return $block; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @param $options |
66
|
|
|
* @return string |
67
|
|
|
*/ |
68
|
|
View Code Duplication |
function b_efqdiralpha1_menu_edit($options) |
|
|
|
|
69
|
|
|
{ |
70
|
|
|
$form = '' . _MB_EFQDIR_DISP . ' '; |
71
|
|
|
$form .= "<input type='hidden' name='options[]' value='"; |
72
|
|
|
if ($options[0] === 'date') { |
73
|
|
|
$form .= "date'"; |
74
|
|
|
} else { |
75
|
|
|
$form .= "hits'"; |
76
|
|
|
} |
77
|
|
|
$form .= '>'; |
78
|
|
|
$form .= "<input type='text' name='options[]' value='" . $options[1] . '\'> ' . _MB_EFQDIR_LISTINGS . ''; |
79
|
|
|
$form .= ' <br>' . _MB_EFQDIR_CHARS . " <input type='text' name='options[]' value='" . $options[2] . '\'> ' . _MB_EFQDIR_LENGTH . ''; |
80
|
|
|
|
81
|
|
|
return $form; |
82
|
|
|
} |
83
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.