Passed
Push — master ( e8b784...3aca22 )
by Michael
15:11 queued 10:10
created
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
30
$myts      = \MyTextSanitizer::getInstance();
31
$module_id = $xoopsModule->getVar('mid');
32
33
$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
34
/** @var \XoopsGroupPermHandler $grouppermHandler */
35
$grouppermHandler = xoops_getHandler('groupperm');
36
$perm_itemid      = Request::getInt('item_id', 0, 'POST');
37
//If no access
38
if (!$grouppermHandler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
39
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
40
}
41
$prem_perm = $grouppermHandler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id) ? '1' : '0';
42
43
#  function adslightMaps
44
#####################################################
45
function adslightMaps()
46
{
47
    global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $prem_perm;
48
49
    $GLOBALS['xoopsOption']['template_main'] = 'adslight_maps.tpl';
50
51
    require_once XOOPS_ROOT_PATH . '/header.php';
52
53
    $GLOBALS['xoopsTpl']->assign('xmid', $xoopsModule->getVar('mid'));
54
    $GLOBALS['xoopsTpl']->assign('add_from', _ADSLIGHT_ADDFROM . ' ' . $xoopsConfig['sitename']);
55
    $GLOBALS['xoopsTpl']->assign('add_from_title', _ADSLIGHT_ADDFROM);
56
    $GLOBALS['xoopsTpl']->assign('add_from_sitename', $xoopsConfig['sitename']);
57
    $GLOBALS['xoopsTpl']->assign('search_listings', _ADSLIGHT_SEARCH_LISTINGS);
58
    $GLOBALS['xoopsTpl']->assign('all_words', _ADSLIGHT_ALL_WORDS);
59
    $GLOBALS['xoopsTpl']->assign('any_words', _ADSLIGHT_ANY_WORDS);
60
    $GLOBALS['xoopsTpl']->assign('exact_match', _ADSLIGHT_EXACT_MATCH);
61
    $GLOBALS['xoopsTpl']->assign('only_pix', _ADSLIGHT_ONLYPIX);
62
    $GLOBALS['xoopsTpl']->assign('search', _ADSLIGHT_SEARCH);
63
    $GLOBALS['xoopsTpl']->assign('permit', $prem_perm);
64
    $GLOBALS['xoopsTpl']->assign('imgscss', XOOPS_URL . '/modules/adslight/assets/css/adslight.css');
65
    $GLOBALS['xoopsTpl']->assign('adslight_logolink', _ADSLIGHT_LOGOLINK);
66
67
    $GLOBALS['xoTheme']->addMeta('meta', 'robots', 'noindex, nofollow');
68
69
    $header_cssadslight = '<link rel="stylesheet" href="' . XOOPS_URL . '/modules/adslight/assets/css/adslight.css" type="text/css" media="all" >';
70
71
    $GLOBALS['xoopsTpl']->assign('xoops_module_header', $header_cssadslight);
72
73
    $maps_name   = $GLOBALS['xoopsModuleConfig']['adslight_maps_set'];
74
    $maps_width  = $GLOBALS['xoopsModuleConfig']['adslight_maps_width'];
75
    $maps_height = $GLOBALS['xoopsModuleConfig']['adslight_maps_height'];
76
77
    $GLOBALS['xoopsTpl']->assign('maps_name', $maps_name);
78
    $GLOBALS['xoopsTpl']->assign('maps_width', $maps_width);
79
    $GLOBALS['xoopsTpl']->assign('maps_height', $maps_height);
80
81
    $GLOBALS['xoopsTpl']->assign('adlight_maps_title', _ADSLIGHT_MAPS_TITLE);
82
    $GLOBALS['xoopsTpl']->assign('bullinfotext', _ADSLIGHT_MAPS_TEXT);
83
84
    // adslight 2
85
    $GLOBALS['xoopsTpl']->assign('adslight_active_menu', $GLOBALS['xoopsModuleConfig']['adslight_active_menu']);
86
    $GLOBALS['xoopsTpl']->assign('adslight_active_rss', $GLOBALS['xoopsModuleConfig']['adslight_active_rss']);
87
88
    if ($GLOBALS['xoopsUser']) {
89
        $member_usid = $GLOBALS['xoopsUser']->getVar('uid');
90
        if ($usid = $member_usid) {
0 ignored issues
show
The assignment to $usid is dead and can be removed.
Loading history...
91
            $GLOBALS['xoopsTpl']->assign('istheirs', true);
92
93
            [$show_user] = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . " WHERE usid=$member_usid"));
94
95
            $GLOBALS['xoopsTpl']->assign('show_user', $show_user);
96
            $GLOBALS['xoopsTpl']->assign('show_user_link', "members.php?usid=$member_usid");
97
        }
98
    }
99
}
100
101
######################################################
102
103
$pa                                      = Request::getInt('pa', null, 'GET');
104
$GLOBALS['xoopsOption']['template_main'] = 'adslight_maps.tpl';
105
adslightMaps();
106
break;
107
require_once XOOPS_ROOT_PATH . '/footer.php';
108