Completed
Branch master (ddc2b8)
by Michael
02:46
created

admin/index.php (4 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-2016 XOOPS Project (http://xoops.org)
15
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @link            http://xoops.org/
17
 * @since           1.0.6
18
 */
19
20
require_once __DIR__ . '/admin_header.php';
21
xoops_cp_header();
22
23
$adminObject  = \Xmf\Module\Admin::getInstance();
24
25
$start     = XoopsRequest::getInt('start', 0, 'POST');// xtubeCleanRequestVars($_REQUEST, 'start', 0);
26
$start1    = XoopsRequest::getInt('start1', 0, 'POST');// xtubeCleanRequestVars($_REQUEST, 'start1', 0);
27
$start2    = XoopsRequest::getInt('start2', 0, 'POST');// xtubeCleanRequestVars($_REQUEST, 'start2', 0);
28
$start3    = XoopsRequest::getInt('start3', 0, 'POST');// xtubeCleanRequestVars($_REQUEST, 'start3', 0);
29
$start4    = XoopsRequest::getInt('start4', 0, 'POST');// xtubeCleanRequestVars($_REQUEST, 'start4', 0);
30
$start5    = XoopsRequest::getInt('start5', 0, 'POST');// xtubeCleanRequestVars($_REQUEST, 'start5', 0);
31
$totalcats = XoopstubeUtility::xtubeGetTotalCategoryCount();
32
33
$result = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_broken'));
34
list($totalbrokenvideos) = $GLOBALS['xoopsDB']->fetchRow($result);
35
$result2 = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_mod'));
36
list($totalmodrequests) = $GLOBALS['xoopsDB']->fetchRow($result2);
37
$result3 = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published = 0');
38
list($totalnewvideos) = $GLOBALS['xoopsDB']->fetchRow($result3);
39
$result4 = $GLOBALS['xoopsDB']->query('SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published > 0');
40
list($totalvideos) = $GLOBALS['xoopsDB']->fetchRow($result4);
41
42
//$xxx='<a href="brokenvideo.php">' . _AM_XOOPSTUBE_SBROKENSUBMIT . '</a><b>';
43
44
$adminObject->addInfoBox(_AM_XOOPSTUBE_MINDEX_VIDEOSUMMARY);
45 View Code Duplication
if ($totalcats > 0) {
46
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="category.php">' . _AM_XOOPSTUBE_SCATEGORY . '</a><b>' . '</infolabel>', $totalcats), '', 'Green');
47
} else {
48
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_XOOPSTUBE_SCATEGORY . '</infolabel>', $totalcats), '', 'Green');
49
}
50
51 View Code Duplication
if ($totalvideos > 0) {
0 ignored issues
show
This code seems to be duplicated across your project.

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.

Loading history...
52
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="main.php">' . _AM_XOOPSTUBE_SFILES . '</a><b>' . '</infolabel>', $totalvideos), '', 'Green');
53
} else {
54
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_XOOPSTUBE_SFILES . '</infolabel>', $totalvideos), '', 'Green');
55
}
56
57 View Code Duplication
if ($totalnewvideos > 0) {
0 ignored issues
show
This code seems to be duplicated across your project.

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.

Loading history...
58
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="newvideos.php">' . _AM_XOOPSTUBE_SNEWFILESVAL . '</a><b>' . '</infolabel>', $totalnewvideos), '', 'Red');
59
} else {
60
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_XOOPSTUBE_SNEWFILESVAL . '</infolabel>', $totalnewvideos), '', 'Red');
61
}
62 View Code Duplication
if ($totalmodrequests > 0) {
0 ignored issues
show
This code seems to be duplicated across your project.

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.

Loading history...
63
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="modifications.php">' . _AM_XOOPSTUBE_SMODREQUEST . '</a><b>' . '</infolabel>', $totalmodrequests), '', 'Red');
64
} else {
65
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_XOOPSTUBE_SMODREQUEST . '</infolabel>', $totalmodrequests), '', 'Red');
66
}
67
68 View Code Duplication
if ($totalbrokenvideos > 0) {
0 ignored issues
show
This code seems to be duplicated across your project.

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.

Loading history...
69
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . '<a href="brokenvideo.php">' . _AM_XOOPSTUBE_SBROKENSUBMIT . '</a><b>' . '</infolabel><infotext>',
70
                                $totalbrokenvideos . '</infotext>'), '', 'Red');
71
} else {
72
    $adminObject->addInfoBoxLine(sprintf('<infolabel>' . _AM_XOOPSTUBE_SBROKENSUBMIT . '</infolabel><infotext>', $totalbrokenvideos . '</infotext>'), '', 'Red');
73
}
74
75
//------ create directories ---------------
76
/*
77
$folderMode = $GLOBALS['xoopsModuleConfig']['dirmode'];
78
//require_once __DIR__ . '/../class/utility.php';
79
foreach (array_keys($uploadFolders) as $i) {
80
    XoopstubeUtility::prepareFolder($uploadFolders[$i], $folderMode);
81
    $adminObject->addConfigBoxLine($uploadFolders[$i], 'folder');
82
    //    $adminObject->addConfigBoxLine(array($uploadFolders[$i], $folderMode), 'chmod');
83
}
84
*/
85
86
require_once __DIR__ . '/../testdata/index.php';
87
$adminObject->addItemButton(_AM_XOOPSTUBE_ADD_SAMPLEDATA, '__DIR__ . /../../testdata/index.php?op=load', 'add');
88
89
$adminObject->displayNavigation(basename(__FILE__));
90
$adminObject->displayButton('left', '');
91
$adminObject->displayIndex();
92
93
/*
94
//------ check directories ---------------
95
require_once __DIR__ . '/../include/directorychecker.php';
96
97
$adminObject->addConfigBoxLine('');
98
$redirectFile = $_SERVER['PHP_SELF'];
99
100
$languageConstants = array(
101
    _AM_XOOPSTUBE_AVAILABLE,
102
    _AM_XOOPSTUBE_NOTAVAILABLE,
103
    _AM_XOOPSTUBE_CREATETHEDIR,
104
    _AM_XOOPSTUBE_NOTWRITABLE,
105
    _AM_XOOPSTUBE_SETMPERM,
106
    _AM_XOOPSTUBE_DIRCREATED,
107
    _AM_XOOPSTUBE_DIRNOTCREATED,
108
    _AM_XOOPSTUBE_PERMSET,
109
    _AM_XOOPSTUBE_PERMNOTSET
110
);
111
112
$path = $GLOBALS['xoopsModuleConfig']['uploaddir'] . '/';
113
$adminObject->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
114
115
$path = XOOPS_ROOT_PATH . '/' . $GLOBALS['xoopsModuleConfig']['screenshots'] . '/';
116
$adminObject->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
117
118
$path = XOOPS_ROOT_PATH . '/' . $GLOBALS['xoopsModuleConfig']['catimage'] . '/';
119
$adminObject->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
120
121
$path = XOOPS_ROOT_PATH . '/' . $GLOBALS['xoopsModuleConfig']['mainimagedir'] . '/';
122
$adminObject->addConfigBoxLine(DirectoryChecker::getDirectoryStatus($path, 0777, $languageConstants, $redirectFile));
123
124
//$adminObject->displayNavigation(basename(__FILE__));
125
//$adminObject->displayIndex();
126
//echo wfd_serverstats();
127
//---------------------------
128
129
xtubeFileChecks();
130
131
*/
132
133
require_once __DIR__ . '/admin_footer.php';
134