Passed
Push — master ( 89b06b...05ee30 )
by Michael
02:40
created
Severity
1
<?php
2
/*
3
-------------------------------------------------------------------------
4
                     ADSLIGHT 2 : Module for Xoops
5
6
        Redesigned and ameliorate By Luc Bizet user at www.frxoops.org
7
        Started with the Classifieds module and made MANY changes
8
        Website : http://www.luc-bizet.fr
9
        Contact : [email protected]
10
-------------------------------------------------------------------------
11
             Original credits below Version History
12
##########################################################################
13
#                    Classified Module for Xoops                         #
14
#  By John Mordo user jlm69 at www.xoops.org and www.jlmzone.com         #
15
#      Started with the MyAds module and made MANY changes               #
16
##########################################################################
17
 Original Author: Pascal Le Boustouller
18
 Author Website : [email protected]
19
 Licence Type   : GPL
20
-------------------------------------------------------------------------
21
*/
22
23
use Xmf\Request;
24
25
require_once __DIR__ . '/header.php';
26
//require_once XOOPS_ROOT_PATH . '/modules/adslight/include/gtickets.php';
27
28
$myts      = \MyTextSanitizer::getInstance();
29
$module_id = $xoopsModule->getVar('mid');
30
31
$groups = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getGroups() : XOOPS_GROUP_ANONYMOUS;
32
/** @var \XoopsGroupPermHandler $grouppermHandler */
33
$grouppermHandler = xoops_getHandler('groupperm');
34
$perm_itemid      = Request::getInt('item_id', 0, 'POST');
35
//If no access
36
if (!$grouppermHandler->checkRight('adslight_view', $perm_itemid, $groups, $module_id)) {
37
    redirect_header(XOOPS_URL . '/index.php', 3, _NOPERM);
38
}
39
$prem_perm = $grouppermHandler->checkRight('adslight_premium', $perm_itemid, $groups, $module_id) ? '1' : '0';
40
41
#  function adslightMaps
42
#####################################################
43
function adslightMaps()
44
{
45
    global $xoopsDB, $xoopsConfig, $xoopsModule, $myts, $prem_perm;
46
47
    $GLOBALS['xoopsOption']['template_main'] = 'adslight_maps.tpl';
48
49
    require_once XOOPS_ROOT_PATH . '/header.php';
50
51
    $GLOBALS['xoopsTpl']->assign('xmid', $xoopsModule->getVar('mid'));
52
    $GLOBALS['xoopsTpl']->assign('add_from', _ADSLIGHT_ADDFROM . ' ' . $xoopsConfig['sitename']);
53
    $GLOBALS['xoopsTpl']->assign('add_from_title', _ADSLIGHT_ADDFROM);
54
    $GLOBALS['xoopsTpl']->assign('add_from_sitename', $xoopsConfig['sitename']);
55
    $GLOBALS['xoopsTpl']->assign('search_listings', _ADSLIGHT_SEARCH_LISTINGS);
56
    $GLOBALS['xoopsTpl']->assign('all_words', _ADSLIGHT_ALL_WORDS);
57
    $GLOBALS['xoopsTpl']->assign('any_words', _ADSLIGHT_ANY_WORDS);
58
    $GLOBALS['xoopsTpl']->assign('exact_match', _ADSLIGHT_EXACT_MATCH);
59
    $GLOBALS['xoopsTpl']->assign('only_pix', _ADSLIGHT_ONLYPIX);
60
    $GLOBALS['xoopsTpl']->assign('search', _ADSLIGHT_SEARCH);
61
    $GLOBALS['xoopsTpl']->assign('permit', $prem_perm);
62
    $GLOBALS['xoopsTpl']->assign('imgscss', XOOPS_URL . '/modules/adslight/assets/css/adslight.css');
63
    $GLOBALS['xoopsTpl']->assign('adslight_logolink', _ADSLIGHT_LOGOLINK);
64
65
    $GLOBALS['xoTheme']->addMeta('meta', 'robots', 'noindex, nofollow');
66
67
    $header_cssadslight = '<link rel="stylesheet" href="' . XOOPS_URL . '/modules/adslight/assets/css/adslight.css" type="text/css" media="all" >';
68
69
    $GLOBALS['xoopsTpl']->assign('xoops_module_header', $header_cssadslight);
70
71
    $maps_name   = $GLOBALS['xoopsModuleConfig']['adslight_maps_set'];
72
    $maps_width  = $GLOBALS['xoopsModuleConfig']['adslight_maps_width'];
73
    $maps_height = $GLOBALS['xoopsModuleConfig']['adslight_maps_height'];
74
75
    $GLOBALS['xoopsTpl']->assign('maps_name', $maps_name);
76
    $GLOBALS['xoopsTpl']->assign('maps_width', $maps_width);
77
    $GLOBALS['xoopsTpl']->assign('maps_height', $maps_height);
78
79
    $GLOBALS['xoopsTpl']->assign('adlight_maps_title', _ADSLIGHT_MAPS_TITLE);
80
    $GLOBALS['xoopsTpl']->assign('bullinfotext', _ADSLIGHT_MAPS_TEXT);
81
82
    // adslight 2
83
    $GLOBALS['xoopsTpl']->assign('adslight_active_menu', $GLOBALS['xoopsModuleConfig']['adslight_active_menu']);
84
    $GLOBALS['xoopsTpl']->assign('adslight_active_rss', $GLOBALS['xoopsModuleConfig']['adslight_active_rss']);
85
86
    if ($GLOBALS['xoopsUser']) {
87
        $member_usid = $GLOBALS['xoopsUser']->getVar('uid');
88
        if ($usid = $member_usid) {
0 ignored issues
show
The assignment to $usid is dead and can be removed.
Loading history...
89
            $GLOBALS['xoopsTpl']->assign('istheirs', true);
90
91
            [$show_user] = $xoopsDB->fetchRow($xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('adslight_listing') . " WHERE usid=$member_usid"));
92
93
            $GLOBALS['xoopsTpl']->assign('show_user', $show_user);
94
            $GLOBALS['xoopsTpl']->assign('show_user_link', "members.php?usid=$member_usid");
95
        }
96
    }
97
}
98
99
######################################################
100
101
$pa = Request::getInt('pa', null, 'GET');
102
$GLOBALS['xoopsOption']['template_main'] = 'adslight_maps.tpl';
103
adslightMaps();
104
break;
105
require_once XOOPS_ROOT_PATH . '/footer.php';
106