Completed
Branch master (f83415)
by Michael
02:57 queued 18s
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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
/////////////////////////////////////
24
// AdsLight UrlRewrite By Nikita   //
25
// http://www.aideordi.com         //
26
/////////////////////////////////////
27
28
$seoOp    = $_GET['seoOp'];
29
$seoArg   = $_GET['seoArg'];
30
$seoOther = $_GET['seoOther'];
31
32
if (!empty($seoOther)) {
33
    $seoOther = explode('/', $seoOther);
34
}
35
36
$seoMap = array(
37
    'c' => 'viewcats.php',
38
    'p' => 'viewads.php'//  'addlisting' => 'addlisting.php'
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
39
40
);
41
42
if (!empty($seoOp) && !empty($seoMap[$seoOp])) {
43
    // module specific dispatching logic, other module must implement as
44
    // per their requirements.
45
    $newUrl = '/modules/adslight/' . $seoMap[$seoOp];
46
47
    /// if your site is in a folder.  ex: www.welcome.com/xoops_site/
48
    /// Replace the line above, for it ///
49
    /// $newUrl = '/yourfile/modules/adslight/' . $seoMap[$seoOp];
50
51
    $_ENV['PHP_SELF']       = $newUrl;
52
    $_SERVER['SCRIPT_NAME'] = $newUrl;
53
    $_SERVER['PHP_SELF']    = $newUrl;
54
    switch ($seoOp) {
55 View Code Duplication
        case 'c':
56
            $_SERVER['REQUEST_URI'] = $newUrl . '?cid=' . $seoArg;
57
            $_GET['cid']            = $seoArg;
58
            break;
59 View Code Duplication
        case 'p':
60
            $_SERVER['REQUEST_URI'] = $newUrl . '?lid=' . $seoArg;
61
            $_GET['lid']            = $seoArg;
62
            break;
63
64
    }
65
66
    include($seoMap[$seoOp]);
67
}
68
69
exit;
70