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 | * GBOOK - MODULE FOR XOOPS |
||
5 | * Copyright (c) 2007 - 2012 |
||
6 | * Ingo H. de Boer (http://www.winshell.org) |
||
7 | * |
||
8 | * This program is free software; you can redistribute it and/or modify |
||
9 | * it under the terms of the GNU General Public License as published by |
||
10 | * the Free Software Foundation; either version 2 of the License, or |
||
11 | * (at your option) any later version. |
||
12 | * |
||
13 | * You may not change or alter any portion of this comment or credits |
||
14 | * of supporting developers from this source code or any supporting |
||
15 | * source code which is considered copyrighted (c) material of the |
||
16 | * original comment or credit authors. |
||
17 | * |
||
18 | * This program is distributed in the hope that it will be useful, |
||
19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
21 | * GNU General Public License for more details. |
||
22 | * --------------------------------------------------------------------------- |
||
23 | * |
||
24 | * @copyright Ingo H. de Boer (http://www.winshell.org) |
||
25 | * @license GNU General Public License (GPL) |
||
26 | * @package GBook |
||
27 | * @author Ingo H. de Boer ([email protected]) |
||
28 | * |
||
29 | * **************************************************************************** |
||
30 | */ |
||
31 | use Xmf\Request; |
||
32 | |||
33 | include_once __DIR__ . '/header.php'; |
||
34 | |||
35 | $GLOBALS['xoopsOption']['xoops_module_header'] = '<link rel="stylesheet" type="text/css" href="assets/css/gbook.css" />'; |
||
36 | |||
37 | /** @var GbookEntriesHandler $entriesHandler */ |
||
38 | $entriesHandler = xoops_getModuleHandler('entries'); |
||
39 | |||
40 | $start = Request::getInt('start', 0); |
||
41 | |||
42 | $GLOBALS['xoopsOption']['template_main'] = 'gbook_view_entries.tpl'; |
||
43 | include $GLOBALS['xoops']->path('header.php'); |
||
44 | |||
45 | $criteria = new CriteriaCompo(); |
||
46 | $criteria->setSort('id'); |
||
47 | $criteria->setOrder($xoopsModuleConfig['order_entries']); |
||
48 | |||
49 | // $GLOBALS['xoopsTpl']->assign('entries', $entriesHandler->getObjects($criteria, true, false) ); |
||
0 ignored issues
–
show
|
|||
50 | $all_entries = $entriesHandler->getObjects($criteria, true, false); |
||
51 | $all_count = count($all_entries); |
||
52 | |||
53 | $to = $start + $xoopsModuleConfig['num_entries']; |
||
54 | |||
55 | if ($to > $all_count) { |
||
56 | $to = $all_count; |
||
57 | } |
||
58 | |||
59 | include_once $GLOBALS['xoops']->path('class/pagenav.php'); |
||
60 | $nav = new XoopsPageNav($all_count, $xoopsModuleConfig['num_entries'], $start); |
||
61 | $xoopsTpl->assign('pagenav', $nav->renderNav()); |
||
62 | |||
63 | $count = 0; |
||
64 | foreach ($all_entries as $entry) { |
||
65 | if ($count >= $start && $count < $to) { |
||
66 | $entry['date'] = formatTimestamp($entry['time'], $xoopsModuleConfig['date_format']); |
||
67 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
||
68 | $entry['admin'] = "<a href='http://whois.domaintools.com/" . $entry['ip'] |
||
69 | . "' target='_blank'><img src='./assets/images/ip.png' border='0' /></a> " |
||
70 | . "<a href='admin/entries.php?id=" . $entry['id'] . "'><img src='" . $pathIcon16 |
||
71 | . "/edit.png' border='0' /></a> " . "<a href='admin/entries.php?op=delete&id=" |
||
72 | . $entry['id'] . "'><img src='" . $pathIcon16 . "/delete.png' border='0' /></a> "; |
||
73 | } |
||
74 | $xoopsTpl->append('entries', $entry); |
||
75 | } |
||
76 | ++$count; |
||
77 | } |
||
78 | |||
79 | $xoopsTpl->assign('signgbook', _MD_GBOOK_SIGN); |
||
80 | $xoopsTpl->assign('totalentries', sprintf(_MD_GBOOK_TOTAL_ENTRIES, '<strong>' . $all_count . '</strong>')); |
||
81 | |||
82 | include $GLOBALS['xoops']->path('footer.php'); |
||
83 |
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.