@@ -33,83 +33,83 @@ |
||
33 | 33 | */ |
34 | 34 | function getConfig() |
35 | 35 | { |
36 | - $moduleDirName = basename(dirname(__DIR__)); |
|
37 | - $moduleDirNameUpper = strtoupper($moduleDirName); |
|
38 | - return (object)[ |
|
39 | - 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
40 | - 'paths' => [ |
|
41 | - 'dirname' => $moduleDirName, |
|
42 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
43 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
44 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
45 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
46 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
47 | - ], |
|
48 | - 'uploadFolders' => [ |
|
49 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
50 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
36 | + $moduleDirName = basename(dirname(__DIR__)); |
|
37 | + $moduleDirNameUpper = strtoupper($moduleDirName); |
|
38 | + return (object)[ |
|
39 | + 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
40 | + 'paths' => [ |
|
41 | + 'dirname' => $moduleDirName, |
|
42 | + 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
43 | + 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
44 | + 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
45 | + 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
46 | + 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
47 | + ], |
|
48 | + 'uploadFolders' => [ |
|
49 | + constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
50 | + constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
51 | 51 | |
52 | - //XOOPS_UPLOAD_PATH . '/flags' |
|
53 | - ], |
|
54 | - 'copyBlankFiles' => [ |
|
55 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
56 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
57 | - //XOOPS_UPLOAD_PATH . '/flags' |
|
58 | - ], |
|
52 | + //XOOPS_UPLOAD_PATH . '/flags' |
|
53 | + ], |
|
54 | + 'copyBlankFiles' => [ |
|
55 | + constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
56 | + constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
57 | + //XOOPS_UPLOAD_PATH . '/flags' |
|
58 | + ], |
|
59 | 59 | |
60 | - 'copyTestFolders' => [ |
|
61 | - // constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
62 | - //[ |
|
63 | - // constant($moduleDirNameUpper . '_PATH') . '/testdata/images', |
|
64 | - // constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/images', |
|
65 | - //] |
|
66 | - ], |
|
60 | + 'copyTestFolders' => [ |
|
61 | + // constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
62 | + //[ |
|
63 | + // constant($moduleDirNameUpper . '_PATH') . '/testdata/images', |
|
64 | + // constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/images', |
|
65 | + //] |
|
66 | + ], |
|
67 | 67 | |
68 | - 'templateFolders' => [ |
|
69 | - '/templates/', |
|
70 | - '/templates/blocks/', |
|
71 | - '/templates/admin/' |
|
68 | + 'templateFolders' => [ |
|
69 | + '/templates/', |
|
70 | + '/templates/blocks/', |
|
71 | + '/templates/admin/' |
|
72 | 72 | |
73 | - ], |
|
74 | - 'oldFiles' => [ |
|
75 | - '/class/request.php', |
|
76 | - '/class/registry.php', |
|
77 | - '/class/utilities.php', |
|
78 | - '/class/util.php', |
|
79 | - // '/include/constants.php', |
|
80 | - // '/include/functions.php', |
|
81 | - '/ajaxrating.txt', |
|
82 | - ], |
|
83 | - 'oldFolders' => [ |
|
84 | - '/images', |
|
85 | - '/css', |
|
86 | - '/js', |
|
87 | - '/tcpdf', |
|
88 | - '/images', |
|
89 | - ], |
|
73 | + ], |
|
74 | + 'oldFiles' => [ |
|
75 | + '/class/request.php', |
|
76 | + '/class/registry.php', |
|
77 | + '/class/utilities.php', |
|
78 | + '/class/util.php', |
|
79 | + // '/include/constants.php', |
|
80 | + // '/include/functions.php', |
|
81 | + '/ajaxrating.txt', |
|
82 | + ], |
|
83 | + 'oldFolders' => [ |
|
84 | + '/images', |
|
85 | + '/css', |
|
86 | + '/js', |
|
87 | + '/tcpdf', |
|
88 | + '/images', |
|
89 | + ], |
|
90 | 90 | |
91 | - 'renameTables' => [ |
|
92 | - 'bb_archive' => 'newbb_archive', |
|
93 | - 'bb_categories' => 'newbb_categories', |
|
94 | - 'bb_votedata' => 'newbb_votedata', |
|
95 | - 'bb_forums' => 'newbb_forums', |
|
96 | - 'bb_posts' => 'newbb_posts', |
|
97 | - 'bb_posts_text' => 'newbb_posts_text', |
|
98 | - 'bb_topics' => 'newbb_topics', |
|
99 | - 'bb_online' => 'newbb_online', |
|
100 | - 'bb_digest' => 'newbb_digest', |
|
101 | - 'bb_report' => 'newbb_report', |
|
102 | - 'bb_attachments' => 'newbb_attachments', |
|
103 | - 'bb_moderates' => 'newbb_moderates', |
|
104 | - 'bb_reads_forum' => 'newbb_reads_forum', |
|
105 | - 'bb_reads_topic' => 'newbb_reads_topic', |
|
106 | - 'bb_type' => 'newbb_type', |
|
107 | - 'bb_type_forum' => 'newbb_type_forum', |
|
108 | - 'bb_stats' => 'newbb_stats', |
|
109 | - 'bb_user_stats' => 'newbb_user_stats', |
|
110 | - ], |
|
91 | + 'renameTables' => [ |
|
92 | + 'bb_archive' => 'newbb_archive', |
|
93 | + 'bb_categories' => 'newbb_categories', |
|
94 | + 'bb_votedata' => 'newbb_votedata', |
|
95 | + 'bb_forums' => 'newbb_forums', |
|
96 | + 'bb_posts' => 'newbb_posts', |
|
97 | + 'bb_posts_text' => 'newbb_posts_text', |
|
98 | + 'bb_topics' => 'newbb_topics', |
|
99 | + 'bb_online' => 'newbb_online', |
|
100 | + 'bb_digest' => 'newbb_digest', |
|
101 | + 'bb_report' => 'newbb_report', |
|
102 | + 'bb_attachments' => 'newbb_attachments', |
|
103 | + 'bb_moderates' => 'newbb_moderates', |
|
104 | + 'bb_reads_forum' => 'newbb_reads_forum', |
|
105 | + 'bb_reads_topic' => 'newbb_reads_topic', |
|
106 | + 'bb_type' => 'newbb_type', |
|
107 | + 'bb_type_forum' => 'newbb_type_forum', |
|
108 | + 'bb_stats' => 'newbb_stats', |
|
109 | + 'bb_user_stats' => 'newbb_user_stats', |
|
110 | + ], |
|
111 | 111 | |
112 | - 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
|
112 | + 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
|
113 | 113 | <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>', |
114 | - ]; |
|
114 | + ]; |
|
115 | 115 | } |
@@ -35,25 +35,25 @@ discard block |
||
35 | 35 | { |
36 | 36 | $moduleDirName = basename(dirname(__DIR__)); |
37 | 37 | $moduleDirNameUpper = strtoupper($moduleDirName); |
38 | - return (object)[ |
|
39 | - 'name' => strtoupper($moduleDirName) . ' Module Configurator', |
|
38 | + return (object) [ |
|
39 | + 'name' => strtoupper($moduleDirName).' Module Configurator', |
|
40 | 40 | 'paths' => [ |
41 | 41 | 'dirname' => $moduleDirName, |
42 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
43 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
44 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
45 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
46 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
42 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
43 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
44 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
45 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
46 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
47 | 47 | ], |
48 | 48 | 'uploadFolders' => [ |
49 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
50 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
49 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
50 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs', |
|
51 | 51 | |
52 | 52 | //XOOPS_UPLOAD_PATH . '/flags' |
53 | 53 | ], |
54 | 54 | 'copyBlankFiles' => [ |
55 | - constant($moduleDirNameUpper . '_UPLOAD_PATH'), |
|
56 | - constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs', |
|
55 | + constant($moduleDirNameUpper.'_UPLOAD_PATH'), |
|
56 | + constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs', |
|
57 | 57 | //XOOPS_UPLOAD_PATH . '/flags' |
58 | 58 | ], |
59 | 59 | |
@@ -110,6 +110,6 @@ discard block |
||
110 | 110 | ], |
111 | 111 | |
112 | 112 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
113 | - <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>', |
|
113 | + <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>', |
|
114 | 114 | ]; |
115 | 115 | } |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function newbb_admin_mkdir($target, $mode = 0777) |
51 | 51 | { |
52 | - $target = str_replace('..', '', $target); |
|
52 | + $target = str_replace('..', '', $target); |
|
53 | 53 | |
54 | - // http://www.php.net/manual/en/function.mkdir.php |
|
55 | - return is_dir($target) || (newbb_admin_mkdir(dirname($target), $mode) && (!mkdir($target, $mode) && !is_dir($target))); |
|
54 | + // http://www.php.net/manual/en/function.mkdir.php |
|
55 | + return is_dir($target) || (newbb_admin_mkdir(dirname($target), $mode) && (!mkdir($target, $mode) && !is_dir($target))); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | */ |
63 | 63 | function newbb_admin_chmod($target, $mode = 0777) |
64 | 64 | { |
65 | - $target = str_replace('..', '', $target); |
|
65 | + $target = str_replace('..', '', $target); |
|
66 | 66 | |
67 | - return @chmod($target, $mode); |
|
67 | + return @chmod($target, $mode); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -72,32 +72,32 @@ discard block |
||
72 | 72 | */ |
73 | 73 | function newbb_getImageLibs() |
74 | 74 | { |
75 | - $imageLibs = []; |
|
76 | - unset($output, $status); |
|
77 | - if (1 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
|
78 | - $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/'; |
|
79 | - @exec($path . 'convert -version', $output, $status); |
|
80 | - if (empty($status) && !empty($output) && preg_match("/imagemagick[ \t]+([0-9\.]+)/i", $output[0], $matches)) { |
|
81 | - $imageLibs['imagemagick'] = $matches[0]; |
|
82 | - } |
|
83 | - |
|
84 | - unset($output, $status); |
|
85 | - } |
|
86 | - if (2 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
|
87 | - $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'] . '/'; |
|
88 | - @exec($path . 'jpegtopnm -version 2>&1', $output, $status); |
|
89 | - if (empty($status) && !empty($output) && preg_match("/netpbm[ \t]+([0-9\.]+)/i", $output[0], $matches)) { |
|
90 | - $imageLibs['netpbm'] = $matches[0]; |
|
91 | - } |
|
92 | - unset($output, $status); |
|
93 | - } |
|
94 | - |
|
95 | - if (function_exists('gd_info')) { |
|
96 | - $tmpInfo = gd_info(); |
|
97 | - $imageLibs['gd'] = $tmpInfo['GD Version']; |
|
98 | - } |
|
99 | - |
|
100 | - return $imageLibs; |
|
75 | + $imageLibs = []; |
|
76 | + unset($output, $status); |
|
77 | + if (1 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
|
78 | + $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/'; |
|
79 | + @exec($path . 'convert -version', $output, $status); |
|
80 | + if (empty($status) && !empty($output) && preg_match("/imagemagick[ \t]+([0-9\.]+)/i", $output[0], $matches)) { |
|
81 | + $imageLibs['imagemagick'] = $matches[0]; |
|
82 | + } |
|
83 | + |
|
84 | + unset($output, $status); |
|
85 | + } |
|
86 | + if (2 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
|
87 | + $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'] . '/'; |
|
88 | + @exec($path . 'jpegtopnm -version 2>&1', $output, $status); |
|
89 | + if (empty($status) && !empty($output) && preg_match("/netpbm[ \t]+([0-9\.]+)/i", $output[0], $matches)) { |
|
90 | + $imageLibs['netpbm'] = $matches[0]; |
|
91 | + } |
|
92 | + unset($output, $status); |
|
93 | + } |
|
94 | + |
|
95 | + if (function_exists('gd_info')) { |
|
96 | + $tmpInfo = gd_info(); |
|
97 | + $imageLibs['gd'] = $tmpInfo['GD Version']; |
|
98 | + } |
|
99 | + |
|
100 | + return $imageLibs; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | xoops_cp_header(); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | //XOOPS_POLL |
114 | 114 | $xoopspoll = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']); |
115 | 115 | if (is_object($xoopspoll)) { |
116 | - $isOK = $xoopspoll->getVar('isactive'); |
|
116 | + $isOK = $xoopspoll->getVar('isactive'); |
|
117 | 117 | } |
118 | 118 | // END irmtfan add a poll_module config |
119 | 119 | |
@@ -121,19 +121,19 @@ discard block |
||
121 | 121 | $postmaxsize_iniphp = return_bytes(@ini_get('post_max_size')); |
122 | 122 | $uploadlimit = _AM_NEWBB_MEMLIMITTOLARGE; |
123 | 123 | if ($postmaxsize_iniphp < $memlimit_iniphp) { |
124 | - $uploadlimit = sprintf(_AM_NEWBB_MEMLIMITOK, return_bytes($postmaxsize_iniphp, true)); |
|
124 | + $uploadlimit = sprintf(_AM_NEWBB_MEMLIMITOK, return_bytes($postmaxsize_iniphp, true)); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $adminObject->addInfoBox(_AM_NEWBB_PREFERENCES); |
128 | 128 | // START irmtfan better poll module display link and version - check if xoops poll module is available |
129 | 129 | if ($isOK) { |
130 | - $pollLink = _AM_NEWBB_AVAILABLE . ': '; |
|
131 | - $pollLink .= '<a href="' . XOOPS_URL . '/modules/' . $xoopspoll->getVar('dirname') . '/admin/index.php"'; |
|
132 | - $pollLink .= ' alt="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "'; |
|
133 | - $pollLink .= ' title="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "'; |
|
134 | - $pollLink .= '>' . '(' . $xoopspoll->getVar('name') . ')</a>'; |
|
130 | + $pollLink = _AM_NEWBB_AVAILABLE . ': '; |
|
131 | + $pollLink .= '<a href="' . XOOPS_URL . '/modules/' . $xoopspoll->getVar('dirname') . '/admin/index.php"'; |
|
132 | + $pollLink .= ' alt="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "'; |
|
133 | + $pollLink .= ' title="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "'; |
|
134 | + $pollLink .= '>' . '(' . $xoopspoll->getVar('name') . ')</a>'; |
|
135 | 135 | } else { |
136 | - $pollLink = _AM_NEWBB_NOTAVAILABLE; |
|
136 | + $pollLink = _AM_NEWBB_NOTAVAILABLE; |
|
137 | 137 | } |
138 | 138 | $adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_POLLMODULE . ': %s', $pollLink)); |
139 | 139 | // END irmtfan better poll module display link and version - check if xoops poll module is available |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | |
155 | 155 | $_ufolders = $newbb_config->uploadFolders; |
156 | 156 | foreach ($_ufolders as $wert) { |
157 | - Newbb\Utility::prepareFolder($wert); |
|
158 | - $adminObject->addConfigBoxLine($wert, 'folder'); |
|
157 | + Newbb\Utility::prepareFolder($wert); |
|
158 | + $adminObject->addConfigBoxLine($wert, 'folder'); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | |
@@ -176,24 +176,24 @@ discard block |
||
176 | 176 | */ |
177 | 177 | function return_bytes($sizeAsString, $b = false) |
178 | 178 | { |
179 | - if (false === $b) { |
|
180 | - switch (substr($sizeAsString, -1)) { |
|
181 | - case 'M': |
|
182 | - case 'm': |
|
183 | - return (int)$sizeAsString * 1048576; |
|
184 | - case 'K': |
|
185 | - case 'k': |
|
186 | - return (int)$sizeAsString * 1024; |
|
187 | - case 'G': |
|
188 | - case 'g': |
|
189 | - return (int)$sizeAsString * 1073741824; |
|
190 | - default: |
|
191 | - return $sizeAsString; |
|
192 | - } |
|
193 | - } else { |
|
194 | - $base = log($sizeAsString) / log(1024); |
|
195 | - $suffix = ['', 'KB', 'MB', 'GB', 'TB']; |
|
196 | - |
|
197 | - return round(1024 ** ($base - floor($base))) . ' ' . $suffix[(int)floor($base)]; |
|
198 | - } |
|
179 | + if (false === $b) { |
|
180 | + switch (substr($sizeAsString, -1)) { |
|
181 | + case 'M': |
|
182 | + case 'm': |
|
183 | + return (int)$sizeAsString * 1048576; |
|
184 | + case 'K': |
|
185 | + case 'k': |
|
186 | + return (int)$sizeAsString * 1024; |
|
187 | + case 'G': |
|
188 | + case 'g': |
|
189 | + return (int)$sizeAsString * 1073741824; |
|
190 | + default: |
|
191 | + return $sizeAsString; |
|
192 | + } |
|
193 | + } else { |
|
194 | + $base = log($sizeAsString) / log(1024); |
|
195 | + $suffix = ['', 'KB', 'MB', 'GB', 'TB']; |
|
196 | + |
|
197 | + return round(1024 ** ($base - floor($base))) . ' ' . $suffix[(int)floor($base)]; |
|
198 | + } |
|
199 | 199 | } |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | |
32 | 32 | use XoopsModules\Newbb; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | //require_once dirname(__DIR__) . '/class/Utility.php'; |
36 | -require_once dirname(__DIR__) . '/include/functions.stats.php'; |
|
36 | +require_once dirname(__DIR__).'/include/functions.stats.php'; |
|
37 | 37 | |
38 | -$attach_path = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/'); |
|
39 | -$thumb_path = $attach_path . 'thumbs/'; |
|
38 | +$attach_path = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'); |
|
39 | +$thumb_path = $attach_path.'thumbs/'; |
|
40 | 40 | $folder = [$attach_path, $thumb_path]; |
41 | 41 | |
42 | 42 | /** @var Xmf\Module\Admin $adminObject */ |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | $imageLibs = []; |
76 | 76 | unset($output, $status); |
77 | 77 | if (1 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
78 | - $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/'; |
|
79 | - @exec($path . 'convert -version', $output, $status); |
|
78 | + $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'].'/'; |
|
79 | + @exec($path.'convert -version', $output, $status); |
|
80 | 80 | if (empty($status) && !empty($output) && preg_match("/imagemagick[ \t]+([0-9\.]+)/i", $output[0], $matches)) { |
81 | 81 | $imageLibs['imagemagick'] = $matches[0]; |
82 | 82 | } |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | unset($output, $status); |
85 | 85 | } |
86 | 86 | if (2 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) { |
87 | - $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'] . '/'; |
|
88 | - @exec($path . 'jpegtopnm -version 2>&1', $output, $status); |
|
87 | + $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'].'/'; |
|
88 | + @exec($path.'jpegtopnm -version 2>&1', $output, $status); |
|
89 | 89 | if (empty($status) && !empty($output) && preg_match("/netpbm[ \t]+([0-9\.]+)/i", $output[0], $matches)) { |
90 | 90 | $imageLibs['netpbm'] = $matches[0]; |
91 | 91 | } |
@@ -127,30 +127,30 @@ discard block |
||
127 | 127 | $adminObject->addInfoBox(_AM_NEWBB_PREFERENCES); |
128 | 128 | // START irmtfan better poll module display link and version - check if xoops poll module is available |
129 | 129 | if ($isOK) { |
130 | - $pollLink = _AM_NEWBB_AVAILABLE . ': '; |
|
131 | - $pollLink .= '<a href="' . XOOPS_URL . '/modules/' . $xoopspoll->getVar('dirname') . '/admin/index.php"'; |
|
132 | - $pollLink .= ' alt="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "'; |
|
133 | - $pollLink .= ' title="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "'; |
|
134 | - $pollLink .= '>' . '(' . $xoopspoll->getVar('name') . ')</a>'; |
|
130 | + $pollLink = _AM_NEWBB_AVAILABLE.': '; |
|
131 | + $pollLink .= '<a href="'.XOOPS_URL.'/modules/'.$xoopspoll->getVar('dirname').'/admin/index.php"'; |
|
132 | + $pollLink .= ' alt="'.$xoopspoll->getVar('name').' '._VERSION.' ('.$xoopspoll->getInfo('version').') "'; |
|
133 | + $pollLink .= ' title="'.$xoopspoll->getVar('name').' '._VERSION.' ('.$xoopspoll->getInfo('version').') "'; |
|
134 | + $pollLink .= '>'.'('.$xoopspoll->getVar('name').')</a>'; |
|
135 | 135 | } else { |
136 | 136 | $pollLink = _AM_NEWBB_NOTAVAILABLE; |
137 | 137 | } |
138 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_POLLMODULE . ': %s', $pollLink)); |
|
138 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_POLLMODULE.': %s', $pollLink)); |
|
139 | 139 | // END irmtfan better poll module display link and version - check if xoops poll module is available |
140 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_IMAGEMAGICK . ' %s', array_key_exists('imagemagick', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['imagemagick'] : _AM_NEWBB_NOTAVAILABLE)); |
|
141 | -$adminObject->addInfoBoxLine(sprintf('NetPBM' . ': %s', array_key_exists('netpbm', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['netpbm'] : _AM_NEWBB_NOTAVAILABLE)); |
|
142 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_GDLIB . ' %s', array_key_exists('gd', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['gd'] : _AM_NEWBB_NOTAVAILABLE)); |
|
143 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_UPLOAD . ' %s', $uploadlimit)); |
|
144 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_INDEX_PDF_PAGE . '', '')); |
|
140 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_IMAGEMAGICK.' %s', array_key_exists('imagemagick', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['imagemagick'] : _AM_NEWBB_NOTAVAILABLE)); |
|
141 | +$adminObject->addInfoBoxLine(sprintf('NetPBM'.': %s', array_key_exists('netpbm', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['netpbm'] : _AM_NEWBB_NOTAVAILABLE)); |
|
142 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_GDLIB.' %s', array_key_exists('gd', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['gd'] : _AM_NEWBB_NOTAVAILABLE)); |
|
143 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_UPLOAD.' %s', $uploadlimit)); |
|
144 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_INDEX_PDF_PAGE.'', '')); |
|
145 | 145 | |
146 | 146 | $adminObject->addInfoBox(_AM_NEWBB_BOARDSUMMARY); |
147 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALTOPICS . ': %s', getTotalTopics())); |
|
148 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALPOSTS . ': %s', getTotalPosts())); |
|
149 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALVIEWS . ': %s', getTotalViews())); |
|
147 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALTOPICS.': %s', getTotalTopics())); |
|
148 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALPOSTS.': %s', getTotalPosts())); |
|
149 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALVIEWS.': %s', getTotalViews())); |
|
150 | 150 | |
151 | 151 | $adminObject->addInfoBox(_AM_NEWBB_REPORT); |
152 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PENDING . ': %s', $reportHandler->getCount(new \Criteria('report_result', 0)))); |
|
153 | -$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PROCESSED . ': %s', $reportHandler->getCount(new \Criteria('report_result', 1)))); |
|
152 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PENDING.': %s', $reportHandler->getCount(new \Criteria('report_result', 0)))); |
|
153 | +$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PROCESSED.': %s', $reportHandler->getCount(new \Criteria('report_result', 1)))); |
|
154 | 154 | |
155 | 155 | $_ufolders = $newbb_config->uploadFolders; |
156 | 156 | foreach ($_ufolders as $wert) { |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $adminObject->displayNavigation(basename(__FILE__)); |
163 | 163 | $adminObject->displayIndex(); |
164 | 164 | |
165 | -require_once __DIR__ . '/admin_footer.php'; |
|
165 | +require_once __DIR__.'/admin_footer.php'; |
|
166 | 166 | |
167 | 167 | $cacheHelper = Newbb\Utility::cleanCache(); |
168 | 168 | //$cacheHelper = new \Xmf\Module\Helper\Cache('newbb'); |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | switch (substr($sizeAsString, -1)) { |
181 | 181 | case 'M': |
182 | 182 | case 'm': |
183 | - return (int)$sizeAsString * 1048576; |
|
183 | + return (int) $sizeAsString * 1048576; |
|
184 | 184 | case 'K': |
185 | 185 | case 'k': |
186 | - return (int)$sizeAsString * 1024; |
|
186 | + return (int) $sizeAsString * 1024; |
|
187 | 187 | case 'G': |
188 | 188 | case 'g': |
189 | - return (int)$sizeAsString * 1073741824; |
|
189 | + return (int) $sizeAsString * 1073741824; |
|
190 | 190 | default: |
191 | 191 | return $sizeAsString; |
192 | 192 | } |
@@ -194,6 +194,6 @@ discard block |
||
194 | 194 | $base = log($sizeAsString) / log(1024); |
195 | 195 | $suffix = ['', 'KB', 'MB', 'GB', 'TB']; |
196 | 196 | |
197 | - return round(1024 ** ($base - floor($base))) . ' ' . $suffix[(int)floor($base)]; |
|
197 | + return round(1024 ** ($base - floor($base))).' '.$suffix[(int) floor($base)]; |
|
198 | 198 | } |
199 | 199 | } |