Passed
Push — master ( 2aaf26...f22b21 )
by Michael
03:06
created
Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * You may not change or alter any portion of this comment or credits
7
 * of supporting developers from this source code or any supporting source code
8
 * which is considered copyrighted (c) material of the original comment or credit authors.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 */
14
15
/**
16
 * @copyright    XOOPS Project (https://xoops.org)
17
 * @license      GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
18
 * @author       XOOPS Development Team
19
 * @author       Pascal Le Boustouller: original author ([email protected])
20
 * @author       Luc Bizet (www.frxoops.org)
21
 * @author       jlm69 (www.jlmzone.com)
22
 * @author       mamba (www.xoops.org)
23
 */
24
25
use Xmf\Request;
26
27
require_once __DIR__ . '/header.php';
28
//require_once XOOPS_ROOT_PATH . '/modules/adslight/include/gtickets.php';
29
global $xoopsModule;
30
31
$myts      = \MyTextSanitizer::getInstance();
32
$moduleId = $xoopsModule->getVar('mid');
33
34
$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
35
/** @var \XoopsGroupPermHandler $grouppermHandler */
36
$grouppermHandler = xoops_getHandler('groupperm');
37
$perm_itemid      = Request::getInt('item_id', 0, 'POST');
38
//If no access
39
if (!$grouppermHandler->checkRight('adslight_view', $perm_itemid, $groups, $moduleId)) {
40
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
41
}
42
$prem_perm = $grouppermHandler->checkRight('adslight_premium', $perm_itemid, $groups, $moduleId) ? '1' : '0';
43
44
#  function adslightMaps
45
#####################################################
46
function adslightMaps(): void
47
{
48
    global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $prem_perm;
49
50
    $GLOBALS['xoopsOption']['template_main'] = 'adslight_maps.tpl';
51
    $helper = Helper::getInstance();
0 ignored issues
show
The type Helper was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
52
53
    require_once XOOPS_ROOT_PATH . '/header.php';
54
55
    $GLOBALS['xoopsTpl']->assign('xmid', $xoopsModule->getVar('mid'));
56
    $GLOBALS['xoopsTpl']->assign('add_from', _ADSLIGHT_ADDFROM . ' ' . $xoopsConfig['sitename']);
57
    $GLOBALS['xoopsTpl']->assign('add_from_title', _ADSLIGHT_ADDFROM);
58
    $GLOBALS['xoopsTpl']->assign('add_from_sitename', $xoopsConfig['sitename']);
59
    $GLOBALS['xoopsTpl']->assign('search_listings', _ADSLIGHT_SEARCH_LISTINGS);
60
    $GLOBALS['xoopsTpl']->assign('all_words', _ADSLIGHT_ALL_WORDS);
61
    $GLOBALS['xoopsTpl']->assign('any_words', _ADSLIGHT_ANY_WORDS);
62
    $GLOBALS['xoopsTpl']->assign('exact_match', _ADSLIGHT_EXACT_MATCH);
63
    $GLOBALS['xoopsTpl']->assign('only_pix', _ADSLIGHT_ONLYPIX);
64
    $GLOBALS['xoopsTpl']->assign('search', _ADSLIGHT_SEARCH);
65
    $GLOBALS['xoopsTpl']->assign('permit', $prem_perm);
66
    $GLOBALS['xoopsTpl']->assign('imgscss', XOOPS_URL . '/modules/adslight/assets/css/adslight.css');
67
    $GLOBALS['xoopsTpl']->assign('adslight_logolink', _ADSLIGHT_LOGOLINK);
68
69
    $GLOBALS['xoTheme']->addMeta('meta', 'robots', 'noindex, nofollow');
70
71
    $header_cssadslight = '<link rel="stylesheet" href="' . XOOPS_URL . '/modules/adslight/assets/css/adslight.css" type="text/css" media="all" >';
72
73
    $GLOBALS['xoopsTpl']->assign('xoops_module_header', $header_cssadslight);
74
75
    $maps_name   = $helper->getConfig('adslight_maps_set');
76
    $maps_width  = $helper->getConfig('adslight_maps_width');
77
    $maps_height = $helper->getConfig('adslight_maps_height');
78
79
    $GLOBALS['xoopsTpl']->assign('maps_name', $maps_name);
80
    $GLOBALS['xoopsTpl']->assign('maps_width', $maps_width);
81
    $GLOBALS['xoopsTpl']->assign('maps_height', $maps_height);
82
83
    $GLOBALS['xoopsTpl']->assign('adlight_maps_title', _ADSLIGHT_MAPS_TITLE);
84
    $GLOBALS['xoopsTpl']->assign('bullinfotext', _ADSLIGHT_MAPS_TEXT);
85
86
    // adslight 2
87
    $GLOBALS['xoopsTpl']->assign('adslight_active_menu', $helper->getConfig('adslight_active_menu'));
88
    $GLOBALS['xoopsTpl']->assign('adslight_active_rss', $helper->getConfig('adslight_active_rss'));
89
90
    if ($GLOBALS['xoopsUser']) {
91
        $member_usid = $GLOBALS['xoopsUser']->getVar('uid');
92
        if ($usid = $member_usid) {
93
            $GLOBALS['xoopsTpl']->assign('istheirs', true);
94
95
            $sql = 'SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . " WHERE usid=${member_usid}";
96
            [$show_user] = $xoopsDB->fetchRow($xoopsDB->query($sql));
97
98
            $GLOBALS['xoopsTpl']->assign('show_user', $show_user);
99
            $GLOBALS['xoopsTpl']->assign('show_user_link', "members.php?usid=${member_usid}");
100
        }
101
    }
102
}
103
104
######################################################
105
106
$pa                                      = Request::getInt('pa', null, 'GET');
107
$GLOBALS['xoopsOption']['template_main'] = 'adslight_maps.tpl';
108
adslightMaps();
109
//break;
110
require_once XOOPS_ROOT_PATH . '/footer.php';
111