1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* MyLinks category.php |
4
|
|
|
* |
5
|
|
|
* Xoops mylinks - a multicategory links module |
6
|
|
|
* |
7
|
|
|
* @copyright :: {@link http://xoops.org/ XOOPS Project} |
8
|
|
|
* @license :: {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License} |
9
|
|
|
* @package :: mylinks |
10
|
|
|
* @subpackage:: class |
11
|
|
|
* @author :: Thatware - http://thatware.org/ |
12
|
|
|
*/ |
13
|
|
|
// ------------------------------------------------------------------------- // |
14
|
|
|
// XOOPS - PHP Content Management System // |
15
|
|
|
// <http://www.xoops.org/> // |
16
|
|
|
// ------------------------------------------------------------------------- // |
17
|
|
|
// Based on: // |
18
|
|
|
// myPHPNUKE Web Portal System - http://myphpnuke.com/ // |
19
|
|
|
// PHP-NUKE Web Portal System - http://phpnuke.org/ // |
20
|
|
|
// Thatware - http://thatware.org/ // |
21
|
|
|
// ------------------------------------------------------------------------- // |
22
|
|
|
// This program is free software; you can redistribute it and/or modify // |
23
|
|
|
// it under the terms of the GNU General Public License as published by // |
24
|
|
|
// the Free Software Foundation; either version 2 of the License, or // |
25
|
|
|
// (at your option) any later version. // |
26
|
|
|
// // |
27
|
|
|
// This program is distributed in the hope that it will be useful, // |
28
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
29
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
30
|
|
|
// GNU General Public License for more details. // |
31
|
|
|
// // |
32
|
|
|
// You should have received a copy of the GNU General Public License // |
33
|
|
|
// along with this program; if not, write to the Free Software // |
34
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
35
|
|
|
// ------------------------------------------------------------------------- // |
36
|
|
|
|
37
|
|
|
include __DIR__ . '/admin_header.php'; |
38
|
|
|
xoops_cp_header(); |
39
|
|
|
|
40
|
|
|
$indexAdmin = new ModuleAdmin(); |
41
|
|
|
|
42
|
|
|
// Temporarily 'homeless' links (to be revised in admin.php breakup) |
43
|
|
|
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_broken') . ''); |
44
|
|
|
list($totalBrokenLinks) = $xoopsDB->fetchRow($result); |
45
|
|
|
if ($totalBrokenLinks > 0) { |
46
|
|
|
$totalBrokenLinks = "<span style='color: #ff0000; font-weight: bold'>{$totalBrokenLinks}</span>"; |
47
|
|
|
} |
48
|
|
|
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_mod') . ''); |
49
|
|
|
list($totalModRequests) = $xoopsDB->fetchRow($result); |
50
|
|
|
if ($totalModRequests > 0) { |
51
|
|
|
$totalModRequests = "<span style='color: #ff0000; font-weight: bold'>{$totalModRequests}</span>"; |
52
|
|
|
} |
53
|
|
|
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_links') . " WHERE status='0'"); |
54
|
|
|
list($totalNewLinks) = $xoopsDB->fetchRow($result); |
55
|
|
|
if ($totalNewLinks > 0) { |
56
|
|
|
$totalNewLinks = "<span style='color: #ff0000; font-weight: bold'>{$totalNewLinks}</span>"; |
57
|
|
|
} |
58
|
|
|
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('mylinks_links') . ' WHERE status>0'); |
59
|
|
|
list($activeLinks) = $xoopsDB->fetchRow($result); |
60
|
|
|
|
61
|
|
|
$indexAdmin->addInfoBox(_MD_MYLINKS_WEBLINKSCONF); |
62
|
|
|
|
63
|
|
View Code Duplication |
if (0 == $totalNewLinks) { |
|
|
|
|
64
|
|
|
//$indexAdmin->addLineLabel(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_LINKSWAITING, $totalNewLinks, 'Green'); |
65
|
|
|
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_LINKSWAITING, $totalNewLinks, 'Green'); |
66
|
|
|
} else { |
67
|
|
|
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_LINKSWAITING, $totalNewLinks, 'Red'); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
View Code Duplication |
if (0 == $totalBrokenLinks) { |
|
|
|
|
71
|
|
|
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_BROKENREPORTS, $totalBrokenLinks, 'Green'); |
72
|
|
|
} else { |
73
|
|
|
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_BROKENREPORTS, $totalBrokenLinks, 'Red'); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
View Code Duplication |
if (0 == $totalModRequests) { |
|
|
|
|
77
|
|
|
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_MODREQUESTS, $totalModRequests, 'Green'); |
78
|
|
|
} else { |
79
|
|
|
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_MODREQUESTS, $totalModRequests, 'Red'); |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
$indexAdmin->addInfoBoxLine(_MD_MYLINKS_WEBLINKSCONF, _MD_MYLINKS_THEREARE, $activeLinks); |
83
|
|
|
//------------------------------ |
84
|
|
|
|
85
|
|
|
echo $indexAdmin->addNavigation(basename(__FILE__)); |
86
|
|
|
echo $indexAdmin->renderIndex(); |
87
|
|
|
|
88
|
|
|
include __DIR__ . '/admin_footer.php'; |
89
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.