Completed
Push — master ( 0424ea...923121 )
by Michael
03:57
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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 30 and the first side effect is on line 23.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
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
include_once __DIR__ . '/header.php';
24
require_once( XOOPS_ROOT_PATH."/modules/adslight/include/gtickets.php" ) ;
25
include(XOOPS_ROOT_PATH."/modules/adslight/include/functions.php");
26
27
/**
28
 * @param $lid
29
 */
30
function PrintAd($lid)
31
{
32
    global $xoopsConfig, $xoopsUser, $xoopsDB, $xoopsModuleConfig, $useroffset, $myts, $xoopsLogger, $moduleDirName, $main_lang;
33
34
    $currenttheme = $xoopsConfig['theme_set'];
35
36
    $result = $xoopsDB->query("select l.lid, l.title, l.expire, l.type, l.desctext, l.tel, l.price, l.typeprice, l.date, l.email, l.submitter, l.town, l.country, l.photo, p.cod_img, p.lid, p.uid_owner, p.url FROM ".$xoopsDB->prefix("adslight_listing")." l LEFT JOIN ".$xoopsDB->prefix("adslight_pictures")." p ON l.lid=p.lid where l.lid=".mysql_real_escape_string($lid)."");
37
    list($lid, $title, $expire, $type, $desctext, $tel, $price, $typeprice, $date, $email, $submitter, $town, $country, $photo, $cod_img, $pic_lid, $uid_owner, $url) = $xoopsDB->fetchRow($result);
38
39
    $title = $myts->htmlSpecialChars($title);
40
    $expire = $myts->htmlSpecialChars($expire);
41
    $type = adslight_NameType($myts->htmlSpecialChars($type));
42
    $desctext = $myts->displayTarea($desctext, 1, 1, 1, 1, 1);
43
    $tel = $myts->htmlSpecialChars($tel);
44
    $price = $myts->htmlSpecialChars($price);
45
    $typeprice = $myts->htmlSpecialChars($typeprice);
46
    $submitter = $myts->htmlSpecialChars($submitter);
47
    $town = $myts->htmlSpecialChars($town);
48
    $country = $myts->htmlSpecialChars($country);
49
50
    echo "
51
    <html>
52
    <head><title>".$xoopsConfig['sitename']."</title>
53
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
54
    <meta http-equiv=\”robots\” content=\"noindex, nofollow, noarchive\" />
55
    <link rel=\"StyleSheet\" href=\"../../themes/".$currenttheme."/style/style.css\" type=\"text/css\">
56
    </head>
57
    <body bgcolor=\"#FFFFFF\" text=\"#000000\">
58
    <table border=0><tr><td>
59
    <table border=0 width=100% cellpadding=0 cellspacing=1 bgcolor=\"#000000\"><tr><td>
60
    <table border=0 width=100% cellpadding=15 cellspacing=1 bgcolor=\"#FFFFFF\"><tr><td>";
61
62
    $useroffset = "";
63 View Code Duplication
    if ($xoopsUser) {
64
        $timezone = $xoopsUser->timezone();
65
        if (isset($timezone)) {
66
            $useroffset = $xoopsUser->timezone();
67
        } else {
68
            $useroffset = $xoopsConfig['default_TZ'];
69
        }
70
    }
71
    $date = ($useroffset*3600) + $date;
72
    $date2 = $date + ($expire*86400);
73
    $date = formatTimestamp($date,"s");
74
    $date2 = formatTimestamp($date2,"s");
75
76
    echo "<br /><br /><table width=99% border=0>
77
        <tr>
78
      <td>"._ADSLIGHT_CLASSIFIED." (No. $lid ) <br />"._ADSLIGHT_FROM." $submitter <br /><br />";
79
80
    echo " <strong>$type :</strong> <i>$title</i><br />";
81
    if ($price > 0) {
82
        echo"<strong>"._ADSLIGHT_PRICE2."</strong> $price ". $xoopsModuleConfig["adslight_money"]."  - $typeprice<br />";
83
    }
84
    if ($photo) {
85
        echo "<tr><td><left><img class=\"thumb\" src=\"".XOOPS_URL."/uploads/AdsLight/$url\" width=\"130px\" border=0 /></center>";
86
    }
87
    echo "</td>
88
          </tr>
89
    <tr>
90
      <td><strong>"._ADSLIGHT_DESC."</strong><br /><br /><div style=\"text-align:justify;\">$desctext</div><p>";
91
    if ($tel) {
92
        echo "<br /><strong>"._ADSLIGHT_TEL."</strong> $tel";
93
    }
94
    if ($town) {
95
        echo "<br /><strong>"._ADSLIGHT_TOWN."</strong> $town";
96
    }
97
    if ($country) {
98
        echo "<br /><strong>"._ADSLIGHT_COUNTRY."</strong> $country";
99
    }
100
    echo "<hr />";
101
    echo ""._ADSLIGHT_NOMAIL." <br />".XOOPS_URL."/modules/adslight/viewads.php?lid=".$lid."<br />";
102
    echo "<br /><br />"._ADSLIGHT_DATE2." $date "._ADSLIGHT_AND." "._ADSLIGHT_DISPO." $date2<br /><br />";
103
    echo "</td>
104
    </tr>
105
    </table>";
106
    echo "<br /><br /></td></tr></table></td></tr></table>
107
    <br /><br /><center>
108
    "._ADSLIGHT_EXTRANN." <strong>".$xoopsConfig['sitename']."</strong><br />
109
    <a href=\"".XOOPS_URL."/modules/adslight/\">".XOOPS_URL."/modules/adslight/</a>
110
    </td></tr></table>
111
    </body>
112
    </html>";
113
}
114
115
##############################################################
116
117 View Code Duplication
if (!isset($_POST['lid']) && isset($_GET['lid']) ) {
118
    $lid = intval($_GET['lid']) ;
119
} else {
120
    $lid = intval($_POST['lid']) ;
121
}
122
123
$op= '';
124
if (!empty($_GET['op'])) {
125
    $op = $_GET['op'];
126
} elseif (!empty($_POST['op'])) {
127
    $op = $_POST['op'];
128
}
129
130
switch ($op) {
131
132
    case "PrintAd":
133
    PrintAd($lid);
134
    break;
135
136
    default:
137
    redirect_header("index.php",3,""._RETURNGLO."");
138
    break;
139
140
}
141