1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* You may not change or alter any portion of this comment or credits |
4
|
|
|
* of supporting developers from this source code or any supporting source code |
5
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
6
|
|
|
* |
7
|
|
|
* This program is distributed in the hope that it will be useful, |
8
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
9
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* SmallWorld |
14
|
|
|
* |
15
|
|
|
* @package \XoopsModules\SmallWorld |
16
|
|
|
* @license GNU GPL (https://www.gnu.org/licenses/gpl-2.0.html/) |
17
|
|
|
* @copyright The XOOPS Project (https://xoops.org) |
18
|
|
|
* @copyright 2011 Culex |
19
|
|
|
* @author Michael Albertsen (http://culex.dk) <[email protected]> |
20
|
|
|
* @link https://github.com/XoopsModules25x/smallworld |
21
|
|
|
* @since 1.0 |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
require_once __DIR__ . '/admin_header.php'; |
25
|
|
|
/** |
26
|
|
|
* Vars defined by inclusion of ./admin_header.php |
27
|
|
|
* |
28
|
|
|
* @var \XoopsModules\Smallworld\Helper $helper |
29
|
|
|
* @var \XoopsModules\Smallworld\Admin $admin |
30
|
|
|
* @var \XoopsModules\Smallworld\SwUserHandler $swUserHandler |
31
|
|
|
* @var \XoopsModules\Smallworld\DoSync $d |
32
|
|
|
* @var \XoopsModules\Smallworld\User $check |
33
|
|
|
* @var \XoopsModules\Smallworld\SwDatabase $swDB |
34
|
|
|
* @var \XoopsModules\Smallworld\WallUpdates $wall |
35
|
|
|
* @var string $moduleDirName |
36
|
|
|
* @var string $moduleDirNameUpper |
37
|
|
|
*/ |
38
|
|
|
|
39
|
|
|
|
40
|
|
|
require_once $helper->path('include/functions.php'); |
41
|
|
|
$GLOBALS['xoopsLogger']->activated = false; |
42
|
|
|
$tpl = new \XoopsTpl(); |
43
|
|
|
|
44
|
|
|
$allusers_inspect = $admin->getAllUsers('yes'); |
45
|
|
View Code Duplication |
foreach ($allusers_inspect as $data) { |
|
|
|
|
46
|
|
|
$ai['id'] = $data['id']; |
47
|
|
|
$ai['userid'] = $data['userid']; |
48
|
|
|
$ai['username'] = $data['username']; |
49
|
|
|
$ai['realname'] = $data['realname']; |
50
|
|
|
$ai['userimage'] = $swUserHandler->getAvatarLink($data['userid'], $data['userimage']); |
51
|
|
|
$ai['avatar_size'] = smallworld_getImageSize(80, 100, $ai['userimage']); |
52
|
|
|
$ai['avatar_highwide'] = smallworld_imageResize($ai['avatar_size'][0], $ai['avatar_size'][1], 50); |
53
|
|
|
$ai['ip'] = $data['ip']; |
54
|
|
|
$ai['complaint'] = $data['complaint']; |
55
|
|
|
$ai['inspect_start'] = $data['inspect_start']; |
56
|
|
|
$ai['inspect_stop'] = $data['inspect_stop']; |
57
|
|
|
$ai['userinspect_timetotal'] = ($data['inspect_start'] + $data['inspect_stop']) - time(); |
58
|
|
|
$tpl->append('allusersinspect', $ai); |
59
|
|
|
} |
60
|
|
|
$tpl->assign('allusersinspectcounter', count($ai)); |
61
|
|
|
|
62
|
|
|
$allusers_noinspect = $admin->getAllUsers('no'); |
63
|
|
View Code Duplication |
foreach ($allusers_noinspect as $data) { |
|
|
|
|
64
|
|
|
$ani['id'] = $data['id']; |
65
|
|
|
$ani['userid'] = $data['userid']; |
66
|
|
|
$ani['username'] = $data['username']; |
67
|
|
|
$ani['realname'] = $data['realname']; |
68
|
|
|
$ani['userimage'] = $swUserHandler->getAvatarLink($data['userid'], $data['userimage']); |
69
|
|
|
$ani['avatar_size'] = smallworld_getImageSize(80, 100, $ani['userimage']); |
70
|
|
|
$ani['avatar_highwide'] = smallworld_imageResize($ani['avatar_size'][0], $ani['avatar_size'][1], 50); |
71
|
|
|
$ani['ip'] = $data['ip']; |
72
|
|
|
$ani['complaint'] = $data['complaint']; |
73
|
|
|
$ani['inspect_start'] = ''; |
74
|
|
|
$ani['inspect_stop'] = ''; |
75
|
|
|
$ani['userinspect_timetotal'] = ''; |
76
|
|
|
$tpl->append('allusersnoinspect', $ani); |
77
|
|
|
} |
78
|
|
|
$tpl->assign('allusersnoinspectcounter', count($ani)); |
79
|
|
|
$tpl->display($helper->path('templates/smallworld_alluserstodiv.tpl')); |
80
|
|
|
|
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.