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 | header('Content-Type: application/rss+xml; charset=UTF-8'); |
||
23 | |||
24 | require_once __DIR__ . '/header.php'; |
||
25 | //require_once __DIR__ . '/include/functions.php'; |
||
0 ignored issues
–
show
|
|||
26 | |||
27 | $allads = AdslightUtility::returnAllAdsRss(); |
||
28 | $base_xoops = 'http://' . $_SERVER['SERVER_NAME'] . substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], 'modules')); |
||
29 | |||
30 | echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||
31 | <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
||
32 | <channel> |
||
33 | <title>' . $xoopsConfig['sitename'] . '</title> |
||
34 | <link>' . $base_xoops . '</link> |
||
35 | <description>' . $xoopsConfig['slogan'] . '</description> |
||
36 | <language>fr</language>'; |
||
37 | |||
38 | $adslink = 'http://' . $_SERVER['SERVER_NAME'] . substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/')); |
||
39 | |||
40 | for ($i = 0, $iMax = count($allads); $i < $iMax; ++$i) { |
||
41 | echo '<item> |
||
42 | <title>' |
||
43 | . $allads[$i]['title'] |
||
44 | . '</title> |
||
45 | <description><![CDATA[' |
||
46 | . stripslashes($allads[$i]['desctext']) |
||
47 | . '<br><strong>Ville:</strong> ' |
||
48 | . htmlspecialchars($allads[$i]['town']) |
||
49 | . ' - <strong>Prix:</strong> ' |
||
50 | . htmlspecialchars($allads[$i]['price']) |
||
51 | . '€ <br>'; |
||
52 | echo ']]></description> |
||
53 | <link><![CDATA[' . $adslink . '/viewads.php?lid=' . $allads[$i]['lid'] . ']]></link> |
||
54 | <guid><![CDATA[' . $adslink . '/viewads.php?lid=' . $allads[$i]['lid'] . ']]></guid> |
||
55 | <pubDate>' . date('D, d M Y H:i:s +0100', $allads[$i]['date']) . '</pubDate> |
||
56 | </item>'; |
||
57 | } |
||
58 | echo '</channel> |
||
59 | </rss>'; |
||
60 |
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.