Completed
Push — master ( 8ca430...3024c9 )
by Michael
03:12
created

admin/index.php (2 issues)

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
 * Module: XoopsTube
4
 *
5
 * You may not change or alter any portion of this comment or credits
6
 * of supporting developers from this source code or any supporting source code
7
 * which is considered copyrighted (c) material of the original comment or credit authors.
8
 *
9
 * PHP version 5
10
 *
11
 * @category        Module
12
 * @package         Xoopstube
13
 * @author          XOOPS Development Team
14
 * @copyright       2001-2013 The XOOPS Project
15
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @version         $Id$
17
 * @link            http://sourceforge.net/projects/xoops/
18
 * @since           1.0.6
19
 */
20
21
include_once __DIR__ . '/admin_header.php';
22
//include_once __DIR__ . '/admin_header.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...
23
xoops_cp_header();
24
25
$indexAdmin = new ModuleAdmin();
26
27
global $xoopsDB;
28
29
$start     = xtubeCleanRequestVars($_REQUEST, 'start', 0);
30
$start1    = xtubeCleanRequestVars($_REQUEST, 'start1', 0);
31
$start2    = xtubeCleanRequestVars($_REQUEST, 'start2', 0);
32
$start3    = xtubeCleanRequestVars($_REQUEST, 'start3', 0);
33
$start4    = xtubeCleanRequestVars($_REQUEST, 'start4', 0);
34
$start5    = xtubeCleanRequestVars($_REQUEST, 'start5', 0);
35
$totalcats = xtubeGetTotalCategoryCount();
36
37
$result = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('xoopstube_broken'));
38
list($totalbrokenvideos) = $xoopsDB->fetchRow($result);
39
$result2 = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('xoopstube_mod'));
40
list($totalmodrequests) = $xoopsDB->fetchRow($result2);
41
$result3 = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('xoopstube_videos') . ' WHERE published = 0');
42
list($totalnewvideos) = $xoopsDB->fetchRow($result3);
43
$result4 = $xoopsDB->query('SELECT COUNT(*) FROM ' . $xoopsDB->prefix('xoopstube_videos') . ' WHERE published > 0');
44
list($totalvideos) = $xoopsDB->fetchRow($result4);
45
46
//$xxx='<a href="brokenvideo.php">' . _AM_XOOPSTUBE_SBROKENSUBMIT . '</a><b>';
47
48
$indexAdmin->addInfoBox(_AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY);
49 View Code Duplication
if ($totalcats > 0) {
50
    $indexAdmin->addInfoBoxLine(
51
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
52
        "<infolabel>" . '<a href="category.php">' . _AM_XOOPSTUBE_SCATEGORY . '</a><b>' . "</infolabel>",
53
        $totalcats,
54
        'Green'
55
    );
56
} else {
57
    $indexAdmin->addInfoBoxLine(
58
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
59
        "<infolabel>" . _AM_XOOPSTUBE_SCATEGORY . "</infolabel>",
60
        $totalcats,
61
        'Green'
62
    );
63
}
64
65 View Code Duplication
if ($totalvideos > 0) {
66
    $indexAdmin->addInfoBoxLine(
67
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
68
        "<infolabel>" . '<a href="main.php">' . _AM_XOOPSTUBE_SFILES . '</a><b>' . "</infolabel>",
69
        $totalvideos,
70
        'Green'
71
    );
72
} else {
73
    $indexAdmin->addInfoBoxLine(
74
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
75
        "<infolabel>" . _AM_XOOPSTUBE_SFILES . "</infolabel>",
76
        $totalvideos,
77
        'Green'
78
    );
79
}
80
81 View Code Duplication
if ($totalnewvideos > 0) {
82
    $indexAdmin->addInfoBoxLine(
83
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
84
        "<infolabel>" . '<a href="newvideos.php">' . _AM_XOOPSTUBE_SNEWFILESVAL . '</a><b>' . "</infolabel>",
85
        $totalnewvideos,
86
        'Red'
87
    );
88
} else {
89
    $indexAdmin->addInfoBoxLine(
90
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
91
        "<infolabel>" . _AM_XOOPSTUBE_SNEWFILESVAL . "</infolabel>",
92
        $totalnewvideos,
93
        'Red'
94
    );
95
}
96 View Code Duplication
if ($totalmodrequests > 0) {
97
    $indexAdmin->addInfoBoxLine(
98
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
99
        "<infolabel>" . '<a href="modifications.php">' . _AM_XOOPSTUBE_SMODREQUEST . '</a><b>' . "</infolabel>",
100
        $totalmodrequests,
101
        'Red'
102
    );
103
} else {
104
    $indexAdmin->addInfoBoxLine(
105
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
106
        "<infolabel>" . _AM_XOOPSTUBE_SMODREQUEST . "</infolabel>",
107
        $totalmodrequests,
108
        'Red'
109
    );
110
}
111
112 View Code Duplication
if ($totalbrokenvideos > 0) {
113
    $indexAdmin->addInfoBoxLine(
114
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
115
        "<infolabel>" . '<a href="brokenvideo.php">' . _AM_XOOPSTUBE_SBROKENSUBMIT . '</a><b>' . "</infolabel><infotext>",
116
        $totalbrokenvideos . "</infotext>",
117
        'Red'
118
    );
119
} else {
120
    $indexAdmin->addInfoBoxLine(
121
        _AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY,
122
        "<infolabel>" . _AM_XOOPSTUBE_SBROKENSUBMIT . "</infolabel><infotext>",
123
        $totalbrokenvideos . "</infotext>",
124
        'Red'
125
    );
126
}
127
128
echo $indexAdmin->addNavigation('index.php');
129
echo $indexAdmin->renderIndex();
130
131
//------ check directories ---------------
132
include_once dirname(__DIR__) . '/include/directorychecker.php';
133
134
$indexAdmin->addConfigBoxLine('');
135
$redirectFile = $_SERVER['PHP_SELF'];
136
137
$languageConstants = array(
138
    _AM_XOOPSTUBE_AVAILABLE,
139
    _AM_XOOPSTUBE_NOTAVAILABLE,
140
    _AM_XOOPSTUBE_CREATETHEDIR,
141
    _AM_XOOPSTUBE_NOTWRITABLE,
142
    _AM_XOOPSTUBE_SETMPERM,
143
    _AM_XOOPSTUBE_DIRCREATED,
144
    _AM_XOOPSTUBE_DIRNOTCREATED,
145
    _AM_XOOPSTUBE_PERMSET,
146
    _AM_XOOPSTUBE_PERMNOTSET
147
);
148
149
$path = $xoopsModuleConfig['uploaddir'] . '/';
150
$indexAdmin->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
151
152
$path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['screenshots'] . '/';
153
$indexAdmin->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
154
155
$path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['catimage'] . '/';
156
$indexAdmin->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
157
158
$path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['mainimagedir'] . '/';
159
$indexAdmin->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
160
161
$path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['catimage'] . '/';
162
$indexAdmin->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
163
164
$path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['mainimagedir'] . '/';
165
$indexAdmin->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
166
167
//echo $indexAdmin->addNavigation('index.php');
0 ignored issues
show
Unused Code Comprehensibility introduced by
63% 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...
168
//echo $indexAdmin->renderIndex();
169
//echo wfd_serverstats();
170
//---------------------------
171
172
xtubeFileChecks();
173
174
include_once __DIR__ . '/admin_footer.php';
175