@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | // $sql .= " WHERE metakey='version' LIMIT 1"; |
35 | 35 | // $query = $GLOBALS['xoopsDB']->query($sql); |
36 | 36 | // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
37 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
37 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>".constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO')."</legend>\n"; |
|
38 | 38 | $html .= "<div style='padding: 8px;'>\n"; |
39 | 39 | // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
40 | 40 | // $html .= "<br>\n"; |
41 | 41 | // $html .= "<br>\n"; |
42 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
42 | + $html .= '<div>'.constant('CO_'.$moduleDirNameUpper.'_SPHPINI')."</div>\n"; |
|
43 | 43 | $html .= "<ul>\n"; |
44 | 44 | // |
45 | - $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
46 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
45 | + $gdlib = function_exists('gd_info') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>'; |
|
46 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib; |
|
47 | 47 | if (function_exists('gd_info')) { |
48 | 48 | if (true === ($gdlib = gd_info())) { |
49 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
49 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>'; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | // |
@@ -56,18 +56,18 @@ discard block |
||
56 | 56 | // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
57 | 57 | // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
58 | 58 | // |
59 | - $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
60 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
59 | + $downloads = ini_get('file_uploads') ? '<span style="color: green;">'.constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: red;">'.constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>'; |
|
60 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads; |
|
61 | 61 | // |
62 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
63 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
62 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: blue;">'.ini_get('upload_max_filesize')."</span></b>\n"; |
|
63 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: blue;">'.ini_get('post_max_size')."</span></b>\n"; |
|
64 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: blue;">'.ini_get('memory_limit')."</span></b>\n"; |
|
65 | 65 | $html .= "</ul>\n"; |
66 | 66 | $html .= "<ul>\n"; |
67 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
67 | + $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH."</b>\n"; |
|
68 | 68 | $html .= "</ul>\n"; |
69 | 69 | $html .= "<br>\n"; |
70 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
70 | + $html .= constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC')."\n"; |
|
71 | 71 | $html .= '</div>'; |
72 | 72 | $html .= '</fieldset><br>'; |
73 | 73 |
@@ -17,60 +17,60 @@ |
||
17 | 17 | */ |
18 | 18 | trait ServerStats |
19 | 19 | { |
20 | - /** |
|
21 | - * serverStats() |
|
22 | - * |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public static function getServerStats() |
|
26 | - { |
|
27 | - //mb $wfdownloads = WfdownloadsWfdownloads::getInstance(); |
|
28 | - $moduleDirName = basename(dirname(dirname(__DIR__))); |
|
29 | - $moduleDirNameUpper = strtoupper($moduleDirName); |
|
30 | - xoops_loadLanguage('common', $moduleDirName); |
|
31 | - $html = ''; |
|
32 | - // $sql = 'SELECT metavalue'; |
|
33 | - // $sql .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta'); |
|
34 | - // $sql .= " WHERE metakey='version' LIMIT 1"; |
|
35 | - // $query = $GLOBALS['xoopsDB']->query($sql); |
|
36 | - // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
|
37 | - $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
38 | - $html .= "<div style='padding: 8px;'>\n"; |
|
39 | - // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
|
40 | - // $html .= "<br>\n"; |
|
41 | - // $html .= "<br>\n"; |
|
42 | - $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
43 | - $html .= "<ul>\n"; |
|
44 | - // |
|
45 | - $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
46 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
47 | - if (function_exists('gd_info')) { |
|
48 | - if (true === ($gdlib = gd_info())) { |
|
49 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
50 | - } |
|
51 | - } |
|
52 | - // |
|
53 | - // $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF'); |
|
54 | - // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode; |
|
55 | - // |
|
56 | - // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
|
57 | - // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
|
58 | - // |
|
59 | - $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
60 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
61 | - // |
|
62 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
63 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
64 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
65 | - $html .= "</ul>\n"; |
|
66 | - $html .= "<ul>\n"; |
|
67 | - $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
68 | - $html .= "</ul>\n"; |
|
69 | - $html .= "<br>\n"; |
|
70 | - $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
71 | - $html .= '</div>'; |
|
72 | - $html .= '</fieldset><br>'; |
|
20 | + /** |
|
21 | + * serverStats() |
|
22 | + * |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public static function getServerStats() |
|
26 | + { |
|
27 | + //mb $wfdownloads = WfdownloadsWfdownloads::getInstance(); |
|
28 | + $moduleDirName = basename(dirname(dirname(__DIR__))); |
|
29 | + $moduleDirNameUpper = strtoupper($moduleDirName); |
|
30 | + xoops_loadLanguage('common', $moduleDirName); |
|
31 | + $html = ''; |
|
32 | + // $sql = 'SELECT metavalue'; |
|
33 | + // $sql .= ' FROM ' . $GLOBALS['xoopsDB']->prefix('wfdownloads_meta'); |
|
34 | + // $sql .= " WHERE metakey='version' LIMIT 1"; |
|
35 | + // $query = $GLOBALS['xoopsDB']->query($sql); |
|
36 | + // list($meta) = $GLOBALS['xoopsDB']->fetchRow($query); |
|
37 | + $html .= "<fieldset><legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . "</legend>\n"; |
|
38 | + $html .= "<div style='padding: 8px;'>\n"; |
|
39 | + // $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>\n"; |
|
40 | + // $html .= "<br>\n"; |
|
41 | + // $html .= "<br>\n"; |
|
42 | + $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . "</div>\n"; |
|
43 | + $html .= "<ul>\n"; |
|
44 | + // |
|
45 | + $gdlib = function_exists('gd_info') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>'; |
|
46 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib; |
|
47 | + if (function_exists('gd_info')) { |
|
48 | + if (true === ($gdlib = gd_info())) { |
|
49 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>'; |
|
50 | + } |
|
51 | + } |
|
52 | + // |
|
53 | + // $safemode = ini_get('safe_mode') ? constant('CO_' . $moduleDirNameUpper . '_ON') . constant('CO_' . $moduleDirNameUpper . '_SAFEMODEPROBLEMS : constant('CO_' . $moduleDirNameUpper . '_OFF'); |
|
54 | + // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SAFEMODESTATUS . $safemode; |
|
55 | + // |
|
56 | + // $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: green;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: red;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>'; |
|
57 | + // $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals; |
|
58 | + // |
|
59 | + $downloads = ini_get('file_uploads') ? '<span style="color: green;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: red;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>'; |
|
60 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads; |
|
61 | + // |
|
62 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: blue;">' . ini_get('upload_max_filesize') . "</span></b>\n"; |
|
63 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: blue;">' . ini_get('post_max_size') . "</span></b>\n"; |
|
64 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: blue;">' . ini_get('memory_limit') . "</span></b>\n"; |
|
65 | + $html .= "</ul>\n"; |
|
66 | + $html .= "<ul>\n"; |
|
67 | + $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . "</b>\n"; |
|
68 | + $html .= "</ul>\n"; |
|
69 | + $html .= "<br>\n"; |
|
70 | + $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . "\n"; |
|
71 | + $html .= '</div>'; |
|
72 | + $html .= '</fieldset><br>'; |
|
73 | 73 | |
74 | - return $html; |
|
75 | - } |
|
74 | + return $html; |
|
75 | + } |
|
76 | 76 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @since 4.00 |
9 | 9 | * @package module::newbb |
10 | 10 | */ |
11 | -require_once __DIR__ . '/header.php'; |
|
11 | +require_once __DIR__.'/header.php'; |
|
12 | 12 | |
13 | 13 | if (!is_object($GLOBALS['xoopsUser']) || !$GLOBALS['xoopsUser']->isAdmin()) { |
14 | 14 | exit(_NOPERM); |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | exit('No need for update'); |
23 | 23 | } |
24 | 24 | |
25 | -$GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
26 | -$GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
25 | +$GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
26 | +$GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
27 | 27 | |
28 | 28 | if (!$GLOBALS['xoopsDB']->queryF(' |
29 | - CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp') . " ( |
|
29 | + CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')." ( |
|
30 | 30 | `type_id` SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, |
31 | 31 | `type_name` VARCHAR(64) NOT NULL DEFAULT '', |
32 | 32 | `type_color` VARCHAR(10) NOT NULL DEFAULT '', |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | if (!$GLOBALS['xoopsDB']->queryF(' |
42 | - CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp') . " ( |
|
42 | + CREATE TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')." ( |
|
43 | 43 | `tf_id` MEDIUMINT(4) UNSIGNED NOT NULL AUTO_INCREMENT, |
44 | 44 | `type_id` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', |
45 | 45 | `forum_id` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0', |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | KEY `type_order` (`type_order`) |
51 | 51 | ) ENGINE=MyISAM; |
52 | 52 | ")) { |
53 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
53 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
54 | 54 | exit('Can not create tmp table for `bb_type_forum_tmp`'); |
55 | 55 | } |
56 | 56 | |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | foreach ($subjectpres as $subjectpre) { |
62 | 62 | if (preg_match("/<[^#]*color=[\"'](#[^'\"\s]*)[^>]>[\[]?([^<\]]*)[\]]?/is", $subjectpre, $matches)) { |
63 | 63 | if (!$GLOBALS['xoopsDB']->queryF(' |
64 | - INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp') . ' |
|
64 | + INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp').' |
|
65 | 65 | (`type_name`, `type_color`) |
66 | 66 | VALUES |
67 | - (' . $GLOBALS['xoopsDB']->quoteString($matches[2]) . ', ' . $GLOBALS['xoopsDB']->quoteString($matches[1]) . ') |
|
67 | + (' . $GLOBALS['xoopsDB']->quoteString($matches[2]).', '.$GLOBALS['xoopsDB']->quoteString($matches[1]).') |
|
68 | 68 | ')) { |
69 | 69 | xoops_error("Can not add type of `{$matches[2]}`"); |
70 | 70 | continue; |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | } |
74 | 74 | } |
75 | 75 | if (0 === count($types)) { |
76 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
77 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
76 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
77 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
78 | 78 | exit('No type item created'); |
79 | 79 | } |
80 | 80 | |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | $type_query[] = "({$key}, {$forum_id}, {$order})"; |
88 | 88 | } |
89 | 89 | |
90 | - $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp') . ' (type_id, forum_id, type_order) ' . ' VALUES ' . implode(', ', $type_query); |
|
90 | + $sql = 'INSERT INTO '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp').' (type_id, forum_id, type_order) '.' VALUES '.implode(', ', $type_query); |
|
91 | 91 | if (false === ($result = $GLOBALS['xoopsDB']->queryF($sql))) { |
92 | 92 | xoops_error($GLOBALS['xoopsDB']->error()); |
93 | 93 | } |
94 | 94 | } |
95 | 95 | } else { |
96 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
97 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
96 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
97 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE '.$GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
98 | 98 | exit('No type item to update'); |
99 | 99 | } |
100 | 100 |
@@ -11,15 +11,15 @@ discard block |
||
11 | 11 | require_once __DIR__ . '/header.php'; |
12 | 12 | |
13 | 13 | if (!is_object($GLOBALS['xoopsUser']) || !$GLOBALS['xoopsUser']->isAdmin()) { |
14 | - exit(_NOPERM); |
|
14 | + exit(_NOPERM); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | if ($xoopsModule->getVar('version') >= 401) { |
18 | - exit('Version not valid'); |
|
18 | + exit('Version not valid'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | if (empty($GLOBALS['xoopsModuleConfig']['subject_prefix'])) { |
22 | - exit('No need for update'); |
|
22 | + exit('No need for update'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | PRIMARY KEY (`type_id`) |
36 | 36 | ) ENGINE=MyISAM; |
37 | 37 | ")) { |
38 | - exit('Can not create tmp table for `bb_type_tmp`'); |
|
38 | + exit('Can not create tmp table for `bb_type_tmp`'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | if (!$GLOBALS['xoopsDB']->queryF(' |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | KEY `type_order` (`type_order`) |
51 | 51 | ) ENGINE=MyISAM; |
52 | 52 | ")) { |
53 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
54 | - exit('Can not create tmp table for `bb_type_forum_tmp`'); |
|
53 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
54 | + exit('Can not create tmp table for `bb_type_forum_tmp`'); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | //$typeHandler = Newbb\Helper::getInstance()->getHandler('Type'); |
@@ -59,43 +59,43 @@ discard block |
||
59 | 59 | $types = []; |
60 | 60 | $order = 1; |
61 | 61 | foreach ($subjectpres as $subjectpre) { |
62 | - if (preg_match("/<[^#]*color=[\"'](#[^'\"\s]*)[^>]>[\[]?([^<\]]*)[\]]?/is", $subjectpre, $matches)) { |
|
63 | - if (!$GLOBALS['xoopsDB']->queryF(' |
|
62 | + if (preg_match("/<[^#]*color=[\"'](#[^'\"\s]*)[^>]>[\[]?([^<\]]*)[\]]?/is", $subjectpre, $matches)) { |
|
63 | + if (!$GLOBALS['xoopsDB']->queryF(' |
|
64 | 64 | INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp') . ' |
65 | 65 | (`type_name`, `type_color`) |
66 | 66 | VALUES |
67 | 67 | (' . $GLOBALS['xoopsDB']->quoteString($matches[2]) . ', ' . $GLOBALS['xoopsDB']->quoteString($matches[1]) . ') |
68 | 68 | ')) { |
69 | - xoops_error("Can not add type of `{$matches[2]}`"); |
|
70 | - continue; |
|
71 | - } |
|
72 | - $types[$GLOBALS['xoopsDB']->getInsertId()] = $order++; |
|
73 | - } |
|
69 | + xoops_error("Can not add type of `{$matches[2]}`"); |
|
70 | + continue; |
|
71 | + } |
|
72 | + $types[$GLOBALS['xoopsDB']->getInsertId()] = $order++; |
|
73 | + } |
|
74 | 74 | } |
75 | 75 | if (0 === count($types)) { |
76 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
77 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
78 | - exit('No type item created'); |
|
76 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
77 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
78 | + exit('No type item created'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | ///** @var Newbb\ForumHandler $forumHandler */ |
82 | 82 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
83 | 83 | if ($forums_type = $forumHandler->getIds(new \Criteria('allow_subject_prefix', 1))) { |
84 | - foreach ($forums_type as $forum_id) { |
|
85 | - $type_query = []; |
|
86 | - foreach ($types as $key => $order) { |
|
87 | - $type_query[] = "({$key}, {$forum_id}, {$order})"; |
|
88 | - } |
|
84 | + foreach ($forums_type as $forum_id) { |
|
85 | + $type_query = []; |
|
86 | + foreach ($types as $key => $order) { |
|
87 | + $type_query[] = "({$key}, {$forum_id}, {$order})"; |
|
88 | + } |
|
89 | 89 | |
90 | - $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp') . ' (type_id, forum_id, type_order) ' . ' VALUES ' . implode(', ', $type_query); |
|
91 | - if (false === ($result = $GLOBALS['xoopsDB']->queryF($sql))) { |
|
92 | - xoops_error($GLOBALS['xoopsDB']->error()); |
|
93 | - } |
|
94 | - } |
|
90 | + $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp') . ' (type_id, forum_id, type_order) ' . ' VALUES ' . implode(', ', $type_query); |
|
91 | + if (false === ($result = $GLOBALS['xoopsDB']->queryF($sql))) { |
|
92 | + xoops_error($GLOBALS['xoopsDB']->error()); |
|
93 | + } |
|
94 | + } |
|
95 | 95 | } else { |
96 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
97 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
98 | - exit('No type item to update'); |
|
96 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_tmp')); |
|
97 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE ' . $GLOBALS['xoopsDB']->prefix('newbb_type_forum_tmp')); |
|
98 | + exit('No type item to update'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | die('update succeeded'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | * |
41 | 41 | */ |
42 | 42 | |
43 | -require_once __DIR__ . '/header.php'; |
|
43 | +require_once __DIR__.'/header.php'; |
|
44 | 44 | |
45 | 45 | error_reporting(0); |
46 | 46 | $xoopsLogger->activated = false; |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | $topic_id = $post->getVar('topic_id'); |
66 | 66 | $post_data = $postHandler->getPostForPrint($post); |
67 | 67 | $isPost = 1; |
68 | - $post_data['url'] = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post_id; |
|
68 | + $post_data['url'] = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$post_id; |
|
69 | 69 | if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) { |
70 | - $post_data['url'] = seo_urls('<a href="' . $post_data['url'] . '"></a>'); |
|
70 | + $post_data['url'] = seo_urls('<a href="'.$post_data['url'].'"></a>'); |
|
71 | 71 | $post_data['url'] = str_replace('<a href="', '', $post_data['url']); |
72 | 72 | $post_data['url'] = str_replace('"></a>', '', $post_data['url']); |
73 | 73 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | echo "</head><body style='background-color:#ffffff; color:#000000;' onload='window.print()'> |
114 | 114 | <div style='width: 750px; border: 1px solid #000; padding: 20px;'> |
115 | 115 | <div style='text-align: center; display: block; margin: 0 0 6px 0;'> |
116 | - <img src='" . XOOPS_URL . "/modules/newbb/assets/images/xoopsbb_slogo.png' border='0' alt='' /> |
|
116 | + <img src='" . XOOPS_URL."/modules/newbb/assets/images/xoopsbb_slogo.png' border='0' alt='' /> |
|
117 | 117 | <br><br> "; |
118 | 118 | |
119 | 119 | $postsArray = $topicHandler->getAllPosts($topicObject); |
@@ -122,25 +122,25 @@ discard block |
||
122 | 122 | continue; |
123 | 123 | } |
124 | 124 | $post_data = $postHandler->getPostForPrint($post); |
125 | - echo "<h2 style='margin: 0;'>" . $post_data['subject'] . "</h2> |
|
126 | - <div align='center'>" . _POSTEDBY . ' ' . $post_data['author'] . ' ' . _ON . ' ' . formatTimestamp($post_data['date']) . "</div> |
|
125 | + echo "<h2 style='margin: 0;'>".$post_data['subject']."</h2> |
|
126 | + <div align='center'>" . _POSTEDBY.' '.$post_data['author'].' '._ON.' '.formatTimestamp($post_data['date'])."</div> |
|
127 | 127 | <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div> |
128 | - <div>" . $post_data['text'] . "</div> |
|
128 | + <div>" . $post_data['text']."</div> |
|
129 | 129 | <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div><br>"; |
130 | 130 | } |
131 | - echo '<p>' . _MD_NEWBB_COMEFROM . ' ' . XOOPS_URL . '/newbb/viewtopic.php?forum=' . $forum_id . '&topic_id=' . $topic_id . '</p>'; |
|
131 | + echo '<p>'._MD_NEWBB_COMEFROM.' '.XOOPS_URL.'/newbb/viewtopic.php?forum='.$forum_id.'&topic_id='.$topic_id.'</p>'; |
|
132 | 132 | echo '</div></div>'; |
133 | 133 | echo '</body></html>'; |
134 | 134 | } else { |
135 | 135 | echo "</head><body style='background-color:#ffffff; color:#000000;' onload='window.print()'> |
136 | 136 | <div style='width: 750px; border: 1px solid #000; padding: 20px;'> |
137 | 137 | <div style='text-align: center; display: block; margin: 0 0 6px 0;'> |
138 | - <h2 style='margin: 0;'>" . $post_data['subject'] . "</h2></div> |
|
139 | - <div align='center'>" . _POSTEDBY . ' ' . $post_data['author'] . ' ' . _ON . ' ' . formatTimestamp($post_data['date']) . "</div> |
|
138 | + <h2 style='margin: 0;'>" . $post_data['subject']."</h2></div> |
|
139 | + <div align='center'>" . _POSTEDBY.' '.$post_data['author'].' '._ON.' '.formatTimestamp($post_data['date'])."</div> |
|
140 | 140 | <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div> |
141 | - <div>" . $post_data['text'] . "</div> |
|
141 | + <div>" . $post_data['text']."</div> |
|
142 | 142 | <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div> |
143 | - <p>" . _MD_NEWBB_COMEFROM . ' ' . $post_data['url'] . '</p> |
|
143 | + <p>" . _MD_NEWBB_COMEFROM.' '.$post_data['url'].'</p> |
|
144 | 144 | </div> |
145 | 145 | <br><br></body></html>'; |
146 | 146 | } |
@@ -46,93 +46,93 @@ |
||
46 | 46 | $xoopsLogger->activated = false; |
47 | 47 | |
48 | 48 | if (!Request::getString('post_data', '', 'POST')) { |
49 | - $forum = Request::getInt('forum', 0, 'GET'); |
|
50 | - $topic_id = Request::getInt('topic_id', 0, 'GET'); |
|
51 | - $post_id = Request::getInt('post_id', 0, 'GET'); |
|
49 | + $forum = Request::getInt('forum', 0, 'GET'); |
|
50 | + $topic_id = Request::getInt('topic_id', 0, 'GET'); |
|
51 | + $post_id = Request::getInt('post_id', 0, 'GET'); |
|
52 | 52 | |
53 | - if (0 === $post_id && 0 === $topic_id) { |
|
54 | - exit(_MD_NEWBB_ERRORTOPIC); |
|
55 | - } |
|
53 | + if (0 === $post_id && 0 === $topic_id) { |
|
54 | + exit(_MD_NEWBB_ERRORTOPIC); |
|
55 | + } |
|
56 | 56 | |
57 | - if (0 !== $post_id) { |
|
58 | - // /** @var Newbb\PostHandler $postHandler */ |
|
59 | - // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
60 | - /** @var Newbb\Post $post */ |
|
61 | - $post = $postHandler->get($post_id); |
|
62 | - if (!$approved = $post->getVar('approved')) { |
|
63 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
64 | - } |
|
65 | - $topic_id = $post->getVar('topic_id'); |
|
66 | - $post_data = $postHandler->getPostForPrint($post); |
|
67 | - $isPost = 1; |
|
68 | - $post_data['url'] = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post_id; |
|
69 | - if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) { |
|
70 | - $post_data['url'] = seo_urls('<a href="' . $post_data['url'] . '"></a>'); |
|
71 | - $post_data['url'] = str_replace('<a href="', '', $post_data['url']); |
|
72 | - $post_data['url'] = str_replace('"></a>', '', $post_data['url']); |
|
73 | - } |
|
74 | - } |
|
57 | + if (0 !== $post_id) { |
|
58 | + // /** @var Newbb\PostHandler $postHandler */ |
|
59 | + // $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
|
60 | + /** @var Newbb\Post $post */ |
|
61 | + $post = $postHandler->get($post_id); |
|
62 | + if (!$approved = $post->getVar('approved')) { |
|
63 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
64 | + } |
|
65 | + $topic_id = $post->getVar('topic_id'); |
|
66 | + $post_data = $postHandler->getPostForPrint($post); |
|
67 | + $isPost = 1; |
|
68 | + $post_data['url'] = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post_id; |
|
69 | + if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) { |
|
70 | + $post_data['url'] = seo_urls('<a href="' . $post_data['url'] . '"></a>'); |
|
71 | + $post_data['url'] = str_replace('<a href="', '', $post_data['url']); |
|
72 | + $post_data['url'] = str_replace('"></a>', '', $post_data['url']); |
|
73 | + } |
|
74 | + } |
|
75 | 75 | |
76 | - // /** @var Newbb\TopicHandler $topicHandler */ |
|
77 | - // $topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
|
78 | - $topicObject = $topicHandler->get($topic_id); |
|
79 | - $topic_id = $topicObject->getVar('topic_id'); |
|
80 | - $forum = $topicObject->getVar('forum_id'); |
|
81 | - if (!$approved = $topicObject->getVar('approved')) { |
|
82 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
83 | - } |
|
76 | + // /** @var Newbb\TopicHandler $topicHandler */ |
|
77 | + // $topicHandler = Newbb\Helper::getInstance()->getHandler('Topic'); |
|
78 | + $topicObject = $topicHandler->get($topic_id); |
|
79 | + $topic_id = $topicObject->getVar('topic_id'); |
|
80 | + $forum = $topicObject->getVar('forum_id'); |
|
81 | + if (!$approved = $topicObject->getVar('approved')) { |
|
82 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
83 | + } |
|
84 | 84 | |
85 | - $isAdmin = newbbIsAdmin($forumObject); |
|
86 | - if (!$isAdmin && $topicObject->getVar('approved') < 0) { |
|
87 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
88 | - } |
|
85 | + $isAdmin = newbbIsAdmin($forumObject); |
|
86 | + if (!$isAdmin && $topicObject->getVar('approved') < 0) { |
|
87 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
88 | + } |
|
89 | 89 | |
90 | - // /** @var Newbb\ForumHandler $forumHandler */ |
|
91 | - // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
|
92 | - $forum = $topicObject->getVar('forum_id'); |
|
93 | - $forumObject = $forumHandler->get($forum); |
|
94 | - if (!$forumHandler->getPermission($forumObject)) { |
|
95 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
96 | - } |
|
90 | + // /** @var Newbb\ForumHandler $forumHandler */ |
|
91 | + // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
|
92 | + $forum = $topicObject->getVar('forum_id'); |
|
93 | + $forumObject = $forumHandler->get($forum); |
|
94 | + if (!$forumHandler->getPermission($forumObject)) { |
|
95 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
96 | + } |
|
97 | 97 | |
98 | - if (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view')) { |
|
99 | - exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
100 | - } |
|
101 | - // irmtfan add print permission |
|
102 | - if (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'print')) { |
|
103 | - exit(_MD_NEWBB_NORIGHTTOPRINT); |
|
104 | - } |
|
98 | + if (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view')) { |
|
99 | + exit(_MD_NEWBB_NORIGHTTOVIEW); |
|
100 | + } |
|
101 | + // irmtfan add print permission |
|
102 | + if (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'print')) { |
|
103 | + exit(_MD_NEWBB_NORIGHTTOPRINT); |
|
104 | + } |
|
105 | 105 | } else { |
106 | - $post_data = unserialize(base64_decode(Request::getString('post_data', '', 'POST'))); |
|
107 | - $isPost = 1; |
|
106 | + $post_data = unserialize(base64_decode(Request::getString('post_data', '', 'POST'))); |
|
107 | + $isPost = 1; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | xoops_header(false); |
111 | 111 | |
112 | 112 | if (empty($isPost)) { |
113 | - echo "</head><body style='background-color:#ffffff; color:#000000;' onload='window.print()'> |
|
113 | + echo "</head><body style='background-color:#ffffff; color:#000000;' onload='window.print()'> |
|
114 | 114 | <div style='width: 750px; border: 1px solid #000; padding: 20px;'> |
115 | 115 | <div style='text-align: center; display: block; margin: 0 0 6px 0;'> |
116 | 116 | <img src='" . XOOPS_URL . "/modules/newbb/assets/images/xoopsbb_slogo.png' border='0' alt='' /> |
117 | 117 | <br><br> "; |
118 | 118 | |
119 | - $postsArray = $topicHandler->getAllPosts($topicObject); |
|
120 | - foreach ($postsArray as $post) { |
|
121 | - if (!$post->getVar('approved')) { |
|
122 | - continue; |
|
123 | - } |
|
124 | - $post_data = $postHandler->getPostForPrint($post); |
|
125 | - echo "<h2 style='margin: 0;'>" . $post_data['subject'] . "</h2> |
|
119 | + $postsArray = $topicHandler->getAllPosts($topicObject); |
|
120 | + foreach ($postsArray as $post) { |
|
121 | + if (!$post->getVar('approved')) { |
|
122 | + continue; |
|
123 | + } |
|
124 | + $post_data = $postHandler->getPostForPrint($post); |
|
125 | + echo "<h2 style='margin: 0;'>" . $post_data['subject'] . "</h2> |
|
126 | 126 | <div align='center'>" . _POSTEDBY . ' ' . $post_data['author'] . ' ' . _ON . ' ' . formatTimestamp($post_data['date']) . "</div> |
127 | 127 | <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div> |
128 | 128 | <div>" . $post_data['text'] . "</div> |
129 | 129 | <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div><br>"; |
130 | - } |
|
131 | - echo '<p>' . _MD_NEWBB_COMEFROM . ' ' . XOOPS_URL . '/newbb/viewtopic.php?forum=' . $forum_id . '&topic_id=' . $topic_id . '</p>'; |
|
132 | - echo '</div></div>'; |
|
133 | - echo '</body></html>'; |
|
130 | + } |
|
131 | + echo '<p>' . _MD_NEWBB_COMEFROM . ' ' . XOOPS_URL . '/newbb/viewtopic.php?forum=' . $forum_id . '&topic_id=' . $topic_id . '</p>'; |
|
132 | + echo '</div></div>'; |
|
133 | + echo '</body></html>'; |
|
134 | 134 | } else { |
135 | - echo "</head><body style='background-color:#ffffff; color:#000000;' onload='window.print()'> |
|
135 | + echo "</head><body style='background-color:#ffffff; color:#000000;' onload='window.print()'> |
|
136 | 136 | <div style='width: 750px; border: 1px solid #000; padding: 20px;'> |
137 | 137 | <div style='text-align: center; display: block; margin: 0 0 6px 0;'> |
138 | 138 | <h2 style='margin: 0;'>" . $post_data['subject'] . "</h2></div> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | define('XOOPS_XMLRPC', 1); |
17 | 17 | } |
18 | 18 | ob_start(); |
19 | -require_once __DIR__ . '/header.php'; |
|
19 | +require_once __DIR__.'/header.php'; |
|
20 | 20 | if (0 == $GLOBALS['xoopsModuleConfig']['email_digest']) { |
21 | 21 | echo '<br>Not set'; |
22 | 22 | |
@@ -25,6 +25,6 @@ discard block |
||
25 | 25 | /** @var Newbb\DigestHandler $digestHandler */ |
26 | 26 | $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
27 | 27 | $msg = $digestHandler->process(); |
28 | -$msg .= ob_get_contents(); |
|
28 | +$msg .= ob_get_contents(); |
|
29 | 29 | ob_end_clean(); |
30 | -echo '<br>' . $msg; |
|
30 | +echo '<br>'.$msg; |
@@ -13,14 +13,14 @@ |
||
13 | 13 | |
14 | 14 | // Why the skip-DB-security check defined only for XMLRPC? We also need it!!! ~_* |
15 | 15 | if (!defined('XOOPS_XMLRPC')) { |
16 | - define('XOOPS_XMLRPC', 1); |
|
16 | + define('XOOPS_XMLRPC', 1); |
|
17 | 17 | } |
18 | 18 | ob_start(); |
19 | 19 | require_once __DIR__ . '/header.php'; |
20 | 20 | if (0 == $GLOBALS['xoopsModuleConfig']['email_digest']) { |
21 | - echo '<br>Not set'; |
|
21 | + echo '<br>Not set'; |
|
22 | 22 | |
23 | - return false; |
|
23 | + return false; |
|
24 | 24 | } |
25 | 25 | /** @var Newbb\DigestHandler $digestHandler */ |
26 | 26 | $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | |
36 | 36 | $op = $op = Request::getCmd('op', Request::getCmd('op', '', 'POST'), 'GET'); //!empty($_GET['op'])? $_GET['op'] : (!empty($_POST['op'])?$_POST['op']:""); |
37 | 37 | |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | case 'delvotes': |
40 | 40 | $rid = Request::getInt('rid', 0, 'GET'); |
41 | 41 | $topic_id = Request::getInt('topic_id', 0, 'GET'); |
42 | - $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . " WHERE ratingid = $rid"); |
|
42 | + $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata')." WHERE ratingid = $rid"); |
|
43 | 43 | $GLOBALS['xoopsDB']->query($sql); |
44 | 44 | |
45 | - $query = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' '; |
|
45 | + $query = 'SELECT rating FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' WHERE topic_id = '.$topic_id.' '; |
|
46 | 46 | $voteresult = $GLOBALS['xoopsDB']->query($query); |
47 | 47 | $votesDB = $GLOBALS['xoopsDB']->getRowsNum($voteresult); |
48 | 48 | $totalrating = 0; |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | $useravgrating = '0'; |
64 | 64 | $uservotes = '0'; |
65 | 65 | |
66 | - $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' ORDER BY ratingtimestamp DESC'; |
|
66 | + $sql = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' ORDER BY ratingtimestamp DESC'; |
|
67 | 67 | $results = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
68 | 68 | $votes = $GLOBALS['xoopsDB']->getRowsNum($results); |
69 | 69 | |
70 | - $sql = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' '; |
|
70 | + $sql = 'SELECT rating FROM '.$GLOBALS['xoopsDB']->prefix('newbb_votedata').' '; |
|
71 | 71 | $result2 = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
72 | 72 | $uservotes = $GLOBALS['xoopsDB']->getRowsNum($result2); |
73 | 73 | $useravgrating = 0; |
@@ -86,28 +86,28 @@ discard block |
||
86 | 86 | $adminObject->displayNavigation(basename(__FILE__)); |
87 | 87 | |
88 | 88 | echo "<div style='padding: 8px;'>\n |
89 | - <div><strong>" . _AM_NEWBB_VOTE_USERAVG . ": </strong>$useravgrating</div>\n |
|
90 | - <div><strong>" . _AM_NEWBB_VOTE_TOTALRATE . ": </strong>$uservotes</div>\n |
|
89 | + <div><strong>" . _AM_NEWBB_VOTE_USERAVG.": </strong>$useravgrating</div>\n |
|
90 | + <div><strong>"._AM_NEWBB_VOTE_TOTALRATE.": </strong>$uservotes</div>\n |
|
91 | 91 | <div style='padding: 8px;'>\n |
92 | - <ul><li> " . _AM_NEWBB_VOTE_DELETEDSC . "</li></ul> |
|
92 | + <ul><li> "._AM_NEWBB_VOTE_DELETEDSC."</li></ul> |
|
93 | 93 | <div>\n |
94 | 94 | <br>\n |
95 | 95 | <table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'> |
96 | 96 | <table width='100%' cellspacing='1' cellpadding='2' class='outer'>\n |
97 | 97 | <tr>\n |
98 | - <th align='center'>" . _AM_NEWBB_VOTE_ID . "</th>\n |
|
99 | - <th align='center'>" . _AM_NEWBB_VOTE_USER . "</th>\n |
|
100 | - <th align='center'>" . _AM_NEWBB_VOTE_IP . "</th>\n |
|
101 | - <th align='center'>" . _AM_NEWBB_VOTE_FILETITLE . "</th>\n |
|
102 | - <th align='center'>" . _AM_NEWBB_VOTE_RATING . "</th>\n |
|
103 | - <th align='center'>" . _AM_NEWBB_VOTE_DATE . "</th>\n |
|
104 | - <th align='center'>" . _AM_NEWBB_ACTION . "</th></tr>\n"; |
|
98 | + <th align='center'>" . _AM_NEWBB_VOTE_ID."</th>\n |
|
99 | + <th align='center'>" . _AM_NEWBB_VOTE_USER."</th>\n |
|
100 | + <th align='center'>" . _AM_NEWBB_VOTE_IP."</th>\n |
|
101 | + <th align='center'>" . _AM_NEWBB_VOTE_FILETITLE."</th>\n |
|
102 | + <th align='center'>" . _AM_NEWBB_VOTE_RATING."</th>\n |
|
103 | + <th align='center'>" . _AM_NEWBB_VOTE_DATE."</th>\n |
|
104 | + <th align='center'>" . _AM_NEWBB_ACTION."</th></tr>\n"; |
|
105 | 105 | |
106 | 106 | if (0 == $votes) { |
107 | - echo "<tr><td align='center' colspan='7' class='head'>" . _AM_NEWBB_VOTE_NOVOTES . '</td></tr>'; |
|
107 | + echo "<tr><td align='center' colspan='7' class='head'>"._AM_NEWBB_VOTE_NOVOTES.'</td></tr>'; |
|
108 | 108 | } |
109 | 109 | while (false !== (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $GLOBALS['xoopsDB']->fetchRow($results))) { |
110 | - $sql = 'SELECT topic_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE topic_id=' . $topic_id . ' '; |
|
110 | + $sql = 'SELECT topic_title FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' WHERE topic_id='.$topic_id.' '; |
|
111 | 111 | $down_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql)); |
112 | 112 | |
113 | 113 | $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | <td class='head' align='center'>$ratingid</td>\n |
118 | 118 | <td class='even' align='center'>$ratinguname</td>\n |
119 | 119 | <td class='even' align='center' >$ratinghostname</td>\n |
120 | - <td class='even' align='left'><a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $topic_id . "' target='topic'>" . $myts->htmlSpecialChars($down_array['topic_title']) . "</a></td>\n |
|
120 | + <td class='even' align='left'><a href='".XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$topic_id."' target='topic'>".$myts->htmlSpecialChars($down_array['topic_title'])."</a></td>\n |
|
121 | 121 | <td class='even' align='center'>$rating</td>\n |
122 | 122 | <td class='even' align='center'>$formatted_date</td>\n |
123 | - <td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id=$topic_id&rid=$ratingid'>" . newbbDisplayImage('p_delete', _DELETE) . "</a></strong></td>\n |
|
123 | + <td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id=$topic_id&rid=$ratingid'>".newbbDisplayImage('p_delete', _DELETE)."</a></strong></td>\n |
|
124 | 124 | </tr>\n"; |
125 | 125 | } |
126 | 126 | echo '</table>'; |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
130 | 130 | $page = ($votes > 10) ? _AM_NEWBB_INDEX_PAGE : ''; |
131 | 131 | $pagenav = new \XoopsPageNav($page, 20, $start, 'start'); |
132 | - echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; |
|
132 | + echo '<div align="right" style="padding: 8px;">'.$page.''.$pagenav->renderImageNav(4).'</div>'; |
|
133 | 133 | echo '<fieldset>'; |
134 | - echo '<legend> ' . _MI_NEWBB_ADMENU_VOTE . ' </legend>'; |
|
134 | + echo '<legend> '._MI_NEWBB_ADMENU_VOTE.' </legend>'; |
|
135 | 135 | echo _AM_NEWBB_HELP_VOTE_TAB; |
136 | 136 | echo '</fieldset>'; |
137 | 137 | break; |
138 | 138 | } |
139 | -require_once __DIR__ . '/admin_footer.php'; |
|
139 | +require_once __DIR__.'/admin_footer.php'; |
@@ -36,56 +36,56 @@ discard block |
||
36 | 36 | $op = $op = Request::getCmd('op', Request::getCmd('op', '', 'POST'), 'GET'); //!empty($_GET['op'])? $_GET['op'] : (!empty($_POST['op'])?$_POST['op']:""); |
37 | 37 | |
38 | 38 | switch ($op) { |
39 | - case 'delvotes': |
|
40 | - $rid = Request::getInt('rid', 0, 'GET'); |
|
41 | - $topic_id = Request::getInt('topic_id', 0, 'GET'); |
|
42 | - $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . " WHERE ratingid = $rid"); |
|
43 | - $GLOBALS['xoopsDB']->query($sql); |
|
39 | + case 'delvotes': |
|
40 | + $rid = Request::getInt('rid', 0, 'GET'); |
|
41 | + $topic_id = Request::getInt('topic_id', 0, 'GET'); |
|
42 | + $sql = $GLOBALS['xoopsDB']->queryF('DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . " WHERE ratingid = $rid"); |
|
43 | + $GLOBALS['xoopsDB']->query($sql); |
|
44 | 44 | |
45 | - $query = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' '; |
|
46 | - $voteresult = $GLOBALS['xoopsDB']->query($query); |
|
47 | - $votesDB = $GLOBALS['xoopsDB']->getRowsNum($voteresult); |
|
48 | - $totalrating = 0; |
|
49 | - while (false !== (list($rating) = $GLOBALS['xoopsDB']->fetchRow($voteresult))) { |
|
50 | - $totalrating += $rating; |
|
51 | - } |
|
52 | - $finalrating = $totalrating / $votesDB; |
|
53 | - $finalrating = number_format($finalrating, 4); |
|
54 | - $sql = sprintf('UPDATE `%s` SET rating = %u, votes = %u WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $finalrating, $votesDB, $topic_id); |
|
55 | - $GLOBALS['xoopsDB']->queryF($sql); |
|
45 | + $query = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' WHERE topic_id = ' . $topic_id . ' '; |
|
46 | + $voteresult = $GLOBALS['xoopsDB']->query($query); |
|
47 | + $votesDB = $GLOBALS['xoopsDB']->getRowsNum($voteresult); |
|
48 | + $totalrating = 0; |
|
49 | + while (false !== (list($rating) = $GLOBALS['xoopsDB']->fetchRow($voteresult))) { |
|
50 | + $totalrating += $rating; |
|
51 | + } |
|
52 | + $finalrating = $totalrating / $votesDB; |
|
53 | + $finalrating = number_format($finalrating, 4); |
|
54 | + $sql = sprintf('UPDATE `%s` SET rating = %u, votes = %u WHERE topic_id = %u', $GLOBALS['xoopsDB']->prefix('newbb_topics'), $finalrating, $votesDB, $topic_id); |
|
55 | + $GLOBALS['xoopsDB']->queryF($sql); |
|
56 | 56 | |
57 | - redirect_header('admin_votedata.php', 1, _AM_NEWBB_VOTEDELETED); |
|
58 | - break; |
|
57 | + redirect_header('admin_votedata.php', 1, _AM_NEWBB_VOTEDELETED); |
|
58 | + break; |
|
59 | 59 | |
60 | - case 'main': |
|
61 | - default: |
|
62 | - $start = Request::getInt('start', 0, 'POST'); |
|
63 | - $useravgrating = '0'; |
|
64 | - $uservotes = '0'; |
|
60 | + case 'main': |
|
61 | + default: |
|
62 | + $start = Request::getInt('start', 0, 'POST'); |
|
63 | + $useravgrating = '0'; |
|
64 | + $uservotes = '0'; |
|
65 | 65 | |
66 | - $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' ORDER BY ratingtimestamp DESC'; |
|
67 | - $results = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
68 | - $votes = $GLOBALS['xoopsDB']->getRowsNum($results); |
|
66 | + $sql = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' ORDER BY ratingtimestamp DESC'; |
|
67 | + $results = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
68 | + $votes = $GLOBALS['xoopsDB']->getRowsNum($results); |
|
69 | 69 | |
70 | - $sql = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' '; |
|
71 | - $result2 = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
72 | - $uservotes = $GLOBALS['xoopsDB']->getRowsNum($result2); |
|
73 | - $useravgrating = 0; |
|
70 | + $sql = 'SELECT rating FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_votedata') . ' '; |
|
71 | + $result2 = $GLOBALS['xoopsDB']->query($sql, 20, $start); |
|
72 | + $uservotes = $GLOBALS['xoopsDB']->getRowsNum($result2); |
|
73 | + $useravgrating = 0; |
|
74 | 74 | |
75 | - while (false !== (list($rating2) = $GLOBALS['xoopsDB']->fetchRow($result2))) { |
|
76 | - // $useravgrating = $useravgrating + $rating2; |
|
77 | - $useravgrating += $rating2; |
|
78 | - } |
|
79 | - if ($useravgrating > 0) { |
|
80 | - // $useravgrating = $useravgrating / $uservotes; |
|
81 | - $useravgrating /= $uservotes; |
|
82 | - $useravgrating = number_format($useravgrating, 2); |
|
83 | - } |
|
75 | + while (false !== (list($rating2) = $GLOBALS['xoopsDB']->fetchRow($result2))) { |
|
76 | + // $useravgrating = $useravgrating + $rating2; |
|
77 | + $useravgrating += $rating2; |
|
78 | + } |
|
79 | + if ($useravgrating > 0) { |
|
80 | + // $useravgrating = $useravgrating / $uservotes; |
|
81 | + $useravgrating /= $uservotes; |
|
82 | + $useravgrating = number_format($useravgrating, 2); |
|
83 | + } |
|
84 | 84 | |
85 | - xoops_cp_header(); |
|
86 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
85 | + xoops_cp_header(); |
|
86 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
87 | 87 | |
88 | - echo "<div style='padding: 8px;'>\n |
|
88 | + echo "<div style='padding: 8px;'>\n |
|
89 | 89 | <div><strong>" . _AM_NEWBB_VOTE_USERAVG . ": </strong>$useravgrating</div>\n |
90 | 90 | <div><strong>" . _AM_NEWBB_VOTE_TOTALRATE . ": </strong>$uservotes</div>\n |
91 | 91 | <div style='padding: 8px;'>\n |
@@ -103,16 +103,16 @@ discard block |
||
103 | 103 | <th align='center'>" . _AM_NEWBB_VOTE_DATE . "</th>\n |
104 | 104 | <th align='center'>" . _AM_NEWBB_ACTION . "</th></tr>\n"; |
105 | 105 | |
106 | - if (0 == $votes) { |
|
107 | - echo "<tr><td align='center' colspan='7' class='head'>" . _AM_NEWBB_VOTE_NOVOTES . '</td></tr>'; |
|
108 | - } |
|
109 | - while (false !== (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $GLOBALS['xoopsDB']->fetchRow($results))) { |
|
110 | - $sql = 'SELECT topic_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE topic_id=' . $topic_id . ' '; |
|
111 | - $down_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql)); |
|
106 | + if (0 == $votes) { |
|
107 | + echo "<tr><td align='center' colspan='7' class='head'>" . _AM_NEWBB_VOTE_NOVOTES . '</td></tr>'; |
|
108 | + } |
|
109 | + while (false !== (list($ratingid, $topic_id, $ratinguser, $rating, $ratinghostname, $ratingtimestamp) = $GLOBALS['xoopsDB']->fetchRow($results))) { |
|
110 | + $sql = 'SELECT topic_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE topic_id=' . $topic_id . ' '; |
|
111 | + $down_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql)); |
|
112 | 112 | |
113 | - $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); |
|
114 | - $ratinguname = newbbGetUnameFromId($ratinguser, $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
115 | - echo " |
|
113 | + $formatted_date = formatTimestamp($ratingtimestamp, _DATESTRING); |
|
114 | + $ratinguname = newbbGetUnameFromId($ratinguser, $GLOBALS['xoopsModuleConfig']['show_realname']); |
|
115 | + echo " |
|
116 | 116 | <tr>\n |
117 | 117 | <td class='head' align='center'>$ratingid</td>\n |
118 | 118 | <td class='even' align='center'>$ratinguname</td>\n |
@@ -122,18 +122,18 @@ discard block |
||
122 | 122 | <td class='even' align='center'>$formatted_date</td>\n |
123 | 123 | <td class='even' align='center'><strong><a href='admin_votedata.php?op=delvotes&topic_id=$topic_id&rid=$ratingid'>" . newbbDisplayImage('p_delete', _DELETE) . "</a></strong></td>\n |
124 | 124 | </tr>\n"; |
125 | - } |
|
126 | - echo '</table>'; |
|
127 | - echo '</td></tr></table>'; |
|
128 | - //Include page navigation |
|
129 | - require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
|
130 | - $page = ($votes > 10) ? _AM_NEWBB_INDEX_PAGE : ''; |
|
131 | - $pagenav = new \XoopsPageNav($page, 20, $start, 'start'); |
|
132 | - echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; |
|
133 | - echo '<fieldset>'; |
|
134 | - echo '<legend> ' . _MI_NEWBB_ADMENU_VOTE . ' </legend>'; |
|
135 | - echo _AM_NEWBB_HELP_VOTE_TAB; |
|
136 | - echo '</fieldset>'; |
|
137 | - break; |
|
125 | + } |
|
126 | + echo '</table>'; |
|
127 | + echo '</td></tr></table>'; |
|
128 | + //Include page navigation |
|
129 | + require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
|
130 | + $page = ($votes > 10) ? _AM_NEWBB_INDEX_PAGE : ''; |
|
131 | + $pagenav = new \XoopsPageNav($page, 20, $start, 'start'); |
|
132 | + echo '<div align="right" style="padding: 8px;">' . $page . '' . $pagenav->renderImageNav(4) . '</div>'; |
|
133 | + echo '<fieldset>'; |
|
134 | + echo '<legend> ' . _MI_NEWBB_ADMENU_VOTE . ' </legend>'; |
|
135 | + echo _AM_NEWBB_HELP_VOTE_TAB; |
|
136 | + echo '</fieldset>'; |
|
137 | + break; |
|
138 | 138 | } |
139 | 139 | require_once __DIR__ . '/admin_footer.php'; |
@@ -29,11 +29,11 @@ |
||
29 | 29 | // Project: XOOPS Project // |
30 | 30 | // ------------------------------------------------------------------------- // |
31 | 31 | |
32 | -require_once __DIR__ . '/admin_header.php'; |
|
32 | +require_once __DIR__.'/admin_header.php'; |
|
33 | 33 | xoops_cp_header(); |
34 | 34 | |
35 | 35 | $adminObject->displayNavigation(basename(__FILE__)); |
36 | 36 | \Xmf\Module\Admin::setPaypal('PBQZ7D6LT6UBC'); |
37 | 37 | $adminObject->displayAbout(false); |
38 | 38 | |
39 | -require_once __DIR__ . '/admin_footer.php'; |
|
39 | +require_once __DIR__.'/admin_footer.php'; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | require_once $GLOBALS['xoops']->path('class/pagenav.php'); |
36 | 36 | |
37 | 37 | $op = Request::getCmd('op', Request::getCmd('op', 'default', 'POST'), 'GET'); // !empty($_GET['op'])? $_GET['op'] : (!empty($_POST['op'])?$_POST['op']:"default"); |
@@ -87,16 +87,16 @@ discard block |
||
87 | 87 | |
88 | 88 | //if (!$newXoopsModuleGui) loadModuleAdminMenu(7,_AM_NEWBB_DIGESTADMIN); |
89 | 89 | // else $adminObject->displayNavigation(basename(__FILE__)); |
90 | - echo '<ul><li>' . _AM_NEWBB_DIGEST_HELP_1 . '</li>'; |
|
91 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_2 . '</li>'; |
|
92 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_3 . '</li>'; |
|
93 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_4 . '</li></ul>'; |
|
94 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
95 | - echo '<form action="' . xoops_getenv('PHP_SELF') . '" method="post">'; |
|
90 | + echo '<ul><li>'._AM_NEWBB_DIGEST_HELP_1.'</li>'; |
|
91 | + echo '<li>'._AM_NEWBB_DIGEST_HELP_2.'</li>'; |
|
92 | + echo '<li>'._AM_NEWBB_DIGEST_HELP_3.'</li>'; |
|
93 | + echo '<li>'._AM_NEWBB_DIGEST_HELP_4.'</li></ul>'; |
|
94 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
95 | + echo '<form action="'.xoops_getenv('PHP_SELF').'" method="post">'; |
|
96 | 96 | echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
97 | 97 | echo "<tr align='center'>"; |
98 | - echo "<th class='bg3' width='2%'>" . _DELETE . '</th>'; |
|
99 | - echo "<th class='bg3'>" . _AM_NEWBB_DIGESTCONTENT . '</th>'; |
|
98 | + echo "<th class='bg3' width='2%'>"._DELETE.'</th>'; |
|
99 | + echo "<th class='bg3'>"._AM_NEWBB_DIGESTCONTENT.'</th>'; |
|
100 | 100 | echo '</tr>'; |
101 | 101 | |
102 | 102 | $digests = []; |
@@ -105,22 +105,22 @@ discard block |
||
105 | 105 | $digests = $digestHandler->getAllDigests($start, $limit); |
106 | 106 | foreach ($digests as $digest) { |
107 | 107 | echo "<tr class='odd' align='left'>"; |
108 | - echo "<td align='center' ><input type='checkbox' name='digest_id[" . $digest['digest_id'] . "]' value='1' /></td>"; |
|
109 | - echo '<td><strong>#' . $digest['digest_id'] . ' @ ' . formatTimestamp($digest['digest_time']) . '</strong><br>' . str_replace("\n", '<br>', $digest['digest_content']) . '</td>'; |
|
108 | + echo "<td align='center' ><input type='checkbox' name='digest_id[".$digest['digest_id']."]' value='1' /></td>"; |
|
109 | + echo '<td><strong>#'.$digest['digest_id'].' @ '.formatTimestamp($digest['digest_time']).'</strong><br>'.str_replace("\n", '<br>', $digest['digest_content']).'</td>'; |
|
110 | 110 | echo '</tr>'; |
111 | 111 | echo "<tr colspan='2'><td height='2'></td></tr>"; |
112 | 112 | } |
113 | 113 | $submit = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
114 | - echo "<tr><td colspan='2' align='center'>" . $submit->render() . '</td></tr>'; |
|
114 | + echo "<tr><td colspan='2' align='center'>".$submit->render().'</td></tr>'; |
|
115 | 115 | $hidden = new \XoopsFormHidden('op', 'delete'); |
116 | 116 | echo $hidden->render(); |
117 | 117 | $hidden = new \XoopsFormHidden('item', $item); |
118 | - echo $hidden->render() . '</form>'; |
|
118 | + echo $hidden->render().'</form>'; |
|
119 | 119 | |
120 | 120 | echo '</table>'; |
121 | 121 | echo '</td></tr></table>'; |
122 | 122 | echo '<fieldset>'; |
123 | - echo '<legend> ' . _AM_NEWBB_PREFERENCES . ' - ' . _MI_NEWBB_ADMENU_DIGEST . ' </legend>'; |
|
123 | + echo '<legend> '._AM_NEWBB_PREFERENCES.' - '._MI_NEWBB_ADMENU_DIGEST.' </legend>'; |
|
124 | 124 | echo _AM_NEWBB_DIGEST_HELP_AUTO_DIGEST; |
125 | 125 | echo '</fieldset>'; |
126 | 126 | $nav = new \XoopsPageNav($digestHandler->getDigestCount(), $limit, $start, 'start'); |
@@ -128,4 +128,4 @@ discard block |
||
128 | 128 | |
129 | 129 | break; |
130 | 130 | } |
131 | -require_once __DIR__ . '/admin_footer.php'; |
|
131 | +require_once __DIR__.'/admin_footer.php'; |
@@ -42,90 +42,90 @@ |
||
42 | 42 | |
43 | 43 | xoops_cp_header(); |
44 | 44 | switch ($op) { |
45 | - case 'delete': |
|
46 | - $digest_ids = Request::getArray('digest_id', [], 'POST'); |
|
47 | - // /** @var Newbb\DigestHandler $digestHandler */ |
|
48 | - // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
49 | - foreach ($digest_ids as $did => $value) { |
|
50 | - $digest = $digestHandler->get($did); |
|
51 | - $digestHandler->delete($digest); |
|
52 | - } |
|
53 | - redirect_header('admin_digest.php', 1); |
|
54 | - break; |
|
45 | + case 'delete': |
|
46 | + $digest_ids = Request::getArray('digest_id', [], 'POST'); |
|
47 | + // /** @var Newbb\DigestHandler $digestHandler */ |
|
48 | + // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
49 | + foreach ($digest_ids as $did => $value) { |
|
50 | + $digest = $digestHandler->get($did); |
|
51 | + $digestHandler->delete($digest); |
|
52 | + } |
|
53 | + redirect_header('admin_digest.php', 1); |
|
54 | + break; |
|
55 | 55 | |
56 | - case 'digest': |
|
57 | - xoops_confirm(['op' => 'digestconfirmed'], 'admin_digest.php', _AM_NEWBB_DIGEST_CONFIRM); |
|
58 | - break; |
|
59 | - case 'digestconfirmed': |
|
60 | - $message = ''; |
|
61 | - if ('POST' === Request::getMethod()) { |
|
62 | - // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
56 | + case 'digest': |
|
57 | + xoops_confirm(['op' => 'digestconfirmed'], 'admin_digest.php', _AM_NEWBB_DIGEST_CONFIRM); |
|
58 | + break; |
|
59 | + case 'digestconfirmed': |
|
60 | + $message = ''; |
|
61 | + if ('POST' === Request::getMethod()) { |
|
62 | + // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
63 | 63 | |
64 | - switch ($digestHandler->process(true)) { |
|
65 | - case 0: |
|
66 | - $message = _AM_NEWBB_DIGEST_SENT; |
|
67 | - break; |
|
68 | - case 4: |
|
69 | - $message = _AM_NEWBB_DIGEST_NOT_SENT; |
|
70 | - break; |
|
71 | - default: |
|
72 | - $message = _AM_NEWBB_DIGEST_FAILED; |
|
73 | - break; |
|
74 | - } |
|
75 | - } |
|
76 | - redirect_header('admin_digest.php', 1, $message); |
|
77 | - break; |
|
64 | + switch ($digestHandler->process(true)) { |
|
65 | + case 0: |
|
66 | + $message = _AM_NEWBB_DIGEST_SENT; |
|
67 | + break; |
|
68 | + case 4: |
|
69 | + $message = _AM_NEWBB_DIGEST_NOT_SENT; |
|
70 | + break; |
|
71 | + default: |
|
72 | + $message = _AM_NEWBB_DIGEST_FAILED; |
|
73 | + break; |
|
74 | + } |
|
75 | + } |
|
76 | + redirect_header('admin_digest.php', 1, $message); |
|
77 | + break; |
|
78 | 78 | |
79 | - default: |
|
80 | - require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
79 | + default: |
|
80 | + require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
81 | 81 | |
82 | - $limit = 5; |
|
83 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
82 | + $limit = 5; |
|
83 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
84 | 84 | |
85 | - $adminObject->addItemButton(_AM_NEWBB_DIGEST, 'admin_digest.php?op=digest', $icon = 'add'); |
|
86 | - $adminObject->displayButton('left'); |
|
85 | + $adminObject->addItemButton(_AM_NEWBB_DIGEST, 'admin_digest.php?op=digest', $icon = 'add'); |
|
86 | + $adminObject->displayButton('left'); |
|
87 | 87 | |
88 | - //if (!$newXoopsModuleGui) loadModuleAdminMenu(7,_AM_NEWBB_DIGESTADMIN); |
|
89 | - // else $adminObject->displayNavigation(basename(__FILE__)); |
|
90 | - echo '<ul><li>' . _AM_NEWBB_DIGEST_HELP_1 . '</li>'; |
|
91 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_2 . '</li>'; |
|
92 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_3 . '</li>'; |
|
93 | - echo '<li>' . _AM_NEWBB_DIGEST_HELP_4 . '</li></ul>'; |
|
94 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
95 | - echo '<form action="' . xoops_getenv('PHP_SELF') . '" method="post">'; |
|
96 | - echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
|
97 | - echo "<tr align='center'>"; |
|
98 | - echo "<th class='bg3' width='2%'>" . _DELETE . '</th>'; |
|
99 | - echo "<th class='bg3'>" . _AM_NEWBB_DIGESTCONTENT . '</th>'; |
|
100 | - echo '</tr>'; |
|
88 | + //if (!$newXoopsModuleGui) loadModuleAdminMenu(7,_AM_NEWBB_DIGESTADMIN); |
|
89 | + // else $adminObject->displayNavigation(basename(__FILE__)); |
|
90 | + echo '<ul><li>' . _AM_NEWBB_DIGEST_HELP_1 . '</li>'; |
|
91 | + echo '<li>' . _AM_NEWBB_DIGEST_HELP_2 . '</li>'; |
|
92 | + echo '<li>' . _AM_NEWBB_DIGEST_HELP_3 . '</li>'; |
|
93 | + echo '<li>' . _AM_NEWBB_DIGEST_HELP_4 . '</li></ul>'; |
|
94 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
95 | + echo '<form action="' . xoops_getenv('PHP_SELF') . '" method="post">'; |
|
96 | + echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>"; |
|
97 | + echo "<tr align='center'>"; |
|
98 | + echo "<th class='bg3' width='2%'>" . _DELETE . '</th>'; |
|
99 | + echo "<th class='bg3'>" . _AM_NEWBB_DIGESTCONTENT . '</th>'; |
|
100 | + echo '</tr>'; |
|
101 | 101 | |
102 | - $digests = []; |
|
103 | - // /** @var Newbb\DigestHandler $digestHandler */ |
|
104 | - // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
105 | - $digests = $digestHandler->getAllDigests($start, $limit); |
|
106 | - foreach ($digests as $digest) { |
|
107 | - echo "<tr class='odd' align='left'>"; |
|
108 | - echo "<td align='center' ><input type='checkbox' name='digest_id[" . $digest['digest_id'] . "]' value='1' /></td>"; |
|
109 | - echo '<td><strong>#' . $digest['digest_id'] . ' @ ' . formatTimestamp($digest['digest_time']) . '</strong><br>' . str_replace("\n", '<br>', $digest['digest_content']) . '</td>'; |
|
110 | - echo '</tr>'; |
|
111 | - echo "<tr colspan='2'><td height='2'></td></tr>"; |
|
112 | - } |
|
113 | - $submit = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
114 | - echo "<tr><td colspan='2' align='center'>" . $submit->render() . '</td></tr>'; |
|
115 | - $hidden = new \XoopsFormHidden('op', 'delete'); |
|
116 | - echo $hidden->render(); |
|
117 | - $hidden = new \XoopsFormHidden('item', $item); |
|
118 | - echo $hidden->render() . '</form>'; |
|
102 | + $digests = []; |
|
103 | + // /** @var Newbb\DigestHandler $digestHandler */ |
|
104 | + // $digestHandler = Newbb\Helper::getInstance()->getHandler('Digest'); |
|
105 | + $digests = $digestHandler->getAllDigests($start, $limit); |
|
106 | + foreach ($digests as $digest) { |
|
107 | + echo "<tr class='odd' align='left'>"; |
|
108 | + echo "<td align='center' ><input type='checkbox' name='digest_id[" . $digest['digest_id'] . "]' value='1' /></td>"; |
|
109 | + echo '<td><strong>#' . $digest['digest_id'] . ' @ ' . formatTimestamp($digest['digest_time']) . '</strong><br>' . str_replace("\n", '<br>', $digest['digest_content']) . '</td>'; |
|
110 | + echo '</tr>'; |
|
111 | + echo "<tr colspan='2'><td height='2'></td></tr>"; |
|
112 | + } |
|
113 | + $submit = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
|
114 | + echo "<tr><td colspan='2' align='center'>" . $submit->render() . '</td></tr>'; |
|
115 | + $hidden = new \XoopsFormHidden('op', 'delete'); |
|
116 | + echo $hidden->render(); |
|
117 | + $hidden = new \XoopsFormHidden('item', $item); |
|
118 | + echo $hidden->render() . '</form>'; |
|
119 | 119 | |
120 | - echo '</table>'; |
|
121 | - echo '</td></tr></table>'; |
|
122 | - echo '<fieldset>'; |
|
123 | - echo '<legend> ' . _AM_NEWBB_PREFERENCES . ' - ' . _MI_NEWBB_ADMENU_DIGEST . ' </legend>'; |
|
124 | - echo _AM_NEWBB_DIGEST_HELP_AUTO_DIGEST; |
|
125 | - echo '</fieldset>'; |
|
126 | - $nav = new \XoopsPageNav($digestHandler->getDigestCount(), $limit, $start, 'start'); |
|
127 | - echo $nav->renderNav(4); |
|
120 | + echo '</table>'; |
|
121 | + echo '</td></tr></table>'; |
|
122 | + echo '<fieldset>'; |
|
123 | + echo '<legend> ' . _AM_NEWBB_PREFERENCES . ' - ' . _MI_NEWBB_ADMENU_DIGEST . ' </legend>'; |
|
124 | + echo _AM_NEWBB_DIGEST_HELP_AUTO_DIGEST; |
|
125 | + echo '</fieldset>'; |
|
126 | + $nav = new \XoopsPageNav($digestHandler->getDigestCount(), $limit, $start, 'start'); |
|
127 | + echo $nav->renderNav(4); |
|
128 | 128 | |
129 | - break; |
|
129 | + break; |
|
130 | 130 | } |
131 | 131 | require_once __DIR__ . '/admin_footer.php'; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | |
36 | 36 | $cat_orders = Request::getArray('cat_orders', null, 'POST'); |
37 | 37 | $orders = Request::getArray('orders', null, 'POST'); |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | if (Request::getString('submit', '', 'POST')) { |
42 | 42 | $catOrdersCount = count($cat_orders); |
43 | 43 | for ($i = 0; $i < $catOrdersCount; ++$i) { |
44 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_categories') . ' set cat_order = ' . $cat_orders[$i] . " WHERE cat_id=$cat[$i]"; |
|
44 | + $sql = 'update '.$GLOBALS['xoopsDB']->prefix('newbb_categories').' set cat_order = '.$cat_orders[$i]." WHERE cat_id=$cat[$i]"; |
|
45 | 45 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
46 | 46 | redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
47 | 47 | } |
48 | 48 | } |
49 | 49 | $ordersCount = count($orders); |
50 | 50 | for ($i = 0; $i < $ordersCount; ++$i) { |
51 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' set forum_order = ' . $orders[$i] . ' WHERE forum_id=' . $forum[$i]; |
|
51 | + $sql = 'update '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' set forum_order = '.$orders[$i].' WHERE forum_id='.$forum[$i]; |
|
52 | 52 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
53 | 53 | redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
54 | 54 | } |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | |
66 | 66 | $adminObject->displayNavigation(basename(__FILE__)); |
67 | 67 | |
68 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
68 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
69 | 69 | $tform = new \XoopsThemeForm(_AM_NEWBB_SETFORUMORDER, '', ''); |
70 | 70 | $tform->display(); |
71 | 71 | echo "<form name='reorder' method='post'>"; |
72 | 72 | echo "<table border='0' width='100%' cellpadding='2' cellspacing='1' class='outer'>"; |
73 | 73 | echo '<tr>'; |
74 | - echo "<td class='head' align='left' width='60%'><strong>" . _AM_NEWBB_REORDERTITLE . '</strong></td>'; |
|
75 | - echo "<td class='head' align='center'><strong>" . _AM_NEWBB_REORDERWEIGHT . '</strong></td>'; |
|
74 | + echo "<td class='head' align='left' width='60%'><strong>"._AM_NEWBB_REORDERTITLE.'</strong></td>'; |
|
75 | + echo "<td class='head' align='center'><strong>"._AM_NEWBB_REORDERWEIGHT.'</strong></td>'; |
|
76 | 76 | echo '</tr>'; |
77 | 77 | |
78 | 78 | // /** @var Newbb\ForumHandler $forumHandler */ |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
86 | 86 | foreach (array_keys($categories) as $c) { |
87 | 87 | echo '<tr>'; |
88 | - echo "<td align='left' nowrap='nowrap' class='head' >" . $categories[$c]->getVar('cat_title') . '</td>'; |
|
88 | + echo "<td align='left' nowrap='nowrap' class='head' >".$categories[$c]->getVar('cat_title').'</td>'; |
|
89 | 89 | echo "<td align='right' class='head'>"; |
90 | - echo "<input type='text' name='cat_orders[]' value='" . $categories[$c]->getVar('cat_order') . "' size='5' maxlength='5' />"; |
|
91 | - echo "<input type='hidden' name='cat[]' value='" . $c . "' />"; |
|
90 | + echo "<input type='text' name='cat_orders[]' value='".$categories[$c]->getVar('cat_order')."' size='5' maxlength='5' />"; |
|
91 | + echo "<input type='hidden' name='cat[]' value='".$c."' />"; |
|
92 | 92 | echo '</td>'; |
93 | 93 | echo '</tr>'; |
94 | 94 | |
@@ -99,24 +99,24 @@ discard block |
||
99 | 99 | foreach ($forums[$c] as $key => $forum) { |
100 | 100 | echo '<tr>'; |
101 | 101 | $class = ((++$i) % 2) ? 'odd' : 'even'; |
102 | - echo "<td align='left' nowrap='nowrap' class='" . $class . "'>" . $forum['prefix'] . $forum['forum_name'] . '</td>'; |
|
103 | - echo "<td align='left' class='" . $class . "'>"; |
|
104 | - echo $forum['prefix'] . "<input type='text' name='orders[]' value='" . $forum['forum_order'] . "' size='5' maxlength='5' />"; |
|
105 | - echo "<input type='hidden' name='forum[]' value='" . $key . "' />"; |
|
102 | + echo "<td align='left' nowrap='nowrap' class='".$class."'>".$forum['prefix'].$forum['forum_name'].'</td>'; |
|
103 | + echo "<td align='left' class='".$class."'>"; |
|
104 | + echo $forum['prefix']."<input type='text' name='orders[]' value='".$forum['forum_order']."' size='5' maxlength='5' />"; |
|
105 | + echo "<input type='hidden' name='forum[]' value='".$key."' />"; |
|
106 | 106 | echo '</td>'; |
107 | 107 | echo '</tr>'; |
108 | 108 | } |
109 | 109 | } |
110 | 110 | echo "<tr><td class='even' align='center' colspan='6'>"; |
111 | 111 | |
112 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
112 | + echo "<input type='submit' name='submit' value='"._SUBMIT."' />"; |
|
113 | 113 | echo '</td></tr>'; |
114 | 114 | echo '</table>'; |
115 | 115 | echo '</form>'; |
116 | 116 | echo '</td></tr></table>'; |
117 | 117 | echo '<fieldset>'; |
118 | - echo '<legend> ' . _MI_NEWBB_ADMENU_ORDER . ' </legend>'; |
|
118 | + echo '<legend> '._MI_NEWBB_ADMENU_ORDER.' </legend>'; |
|
119 | 119 | echo _AM_NEWBB_HELP_ORDER_TAB; |
120 | 120 | echo '</fieldset>'; |
121 | 121 | } |
122 | -require_once __DIR__ . '/admin_footer.php'; |
|
122 | +require_once __DIR__.'/admin_footer.php'; |
@@ -39,84 +39,84 @@ |
||
39 | 39 | $forum = Request::getArray('forum', null, 'POST'); |
40 | 40 | |
41 | 41 | if (Request::getString('submit', '', 'POST')) { |
42 | - $catOrdersCount = count($cat_orders); |
|
43 | - for ($i = 0; $i < $catOrdersCount; ++$i) { |
|
44 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_categories') . ' set cat_order = ' . $cat_orders[$i] . " WHERE cat_id=$cat[$i]"; |
|
45 | - if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
46 | - redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
47 | - } |
|
48 | - } |
|
49 | - $ordersCount = count($orders); |
|
50 | - for ($i = 0; $i < $ordersCount; ++$i) { |
|
51 | - $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' set forum_order = ' . $orders[$i] . ' WHERE forum_id=' . $forum[$i]; |
|
52 | - if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
53 | - redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
54 | - } |
|
55 | - } |
|
56 | - redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_BOARDREORDER); |
|
42 | + $catOrdersCount = count($cat_orders); |
|
43 | + for ($i = 0; $i < $catOrdersCount; ++$i) { |
|
44 | + $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_categories') . ' set cat_order = ' . $cat_orders[$i] . " WHERE cat_id=$cat[$i]"; |
|
45 | + if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
46 | + redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
47 | + } |
|
48 | + } |
|
49 | + $ordersCount = count($orders); |
|
50 | + for ($i = 0; $i < $ordersCount; ++$i) { |
|
51 | + $sql = 'update ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' set forum_order = ' . $orders[$i] . ' WHERE forum_id=' . $forum[$i]; |
|
52 | + if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
|
53 | + redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_FORUM_ERROR); |
|
54 | + } |
|
55 | + } |
|
56 | + redirect_header('admin_forum_reorder.php', 1, _AM_NEWBB_BOARDREORDER); |
|
57 | 57 | } else { |
58 | - require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
59 | - $orders = []; |
|
60 | - $cat_orders = []; |
|
61 | - $forum = []; |
|
62 | - $cat = []; |
|
58 | + require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
|
59 | + $orders = []; |
|
60 | + $cat_orders = []; |
|
61 | + $forum = []; |
|
62 | + $cat = []; |
|
63 | 63 | |
64 | - xoops_cp_header(); |
|
64 | + xoops_cp_header(); |
|
65 | 65 | |
66 | - $adminObject->displayNavigation(basename(__FILE__)); |
|
66 | + $adminObject->displayNavigation(basename(__FILE__)); |
|
67 | 67 | |
68 | - echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
69 | - $tform = new \XoopsThemeForm(_AM_NEWBB_SETFORUMORDER, '', ''); |
|
70 | - $tform->display(); |
|
71 | - echo "<form name='reorder' method='post'>"; |
|
72 | - echo "<table border='0' width='100%' cellpadding='2' cellspacing='1' class='outer'>"; |
|
73 | - echo '<tr>'; |
|
74 | - echo "<td class='head' align='left' width='60%'><strong>" . _AM_NEWBB_REORDERTITLE . '</strong></td>'; |
|
75 | - echo "<td class='head' align='center'><strong>" . _AM_NEWBB_REORDERWEIGHT . '</strong></td>'; |
|
76 | - echo '</tr>'; |
|
68 | + echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
69 | + $tform = new \XoopsThemeForm(_AM_NEWBB_SETFORUMORDER, '', ''); |
|
70 | + $tform->display(); |
|
71 | + echo "<form name='reorder' method='post'>"; |
|
72 | + echo "<table border='0' width='100%' cellpadding='2' cellspacing='1' class='outer'>"; |
|
73 | + echo '<tr>'; |
|
74 | + echo "<td class='head' align='left' width='60%'><strong>" . _AM_NEWBB_REORDERTITLE . '</strong></td>'; |
|
75 | + echo "<td class='head' align='center'><strong>" . _AM_NEWBB_REORDERWEIGHT . '</strong></td>'; |
|
76 | + echo '</tr>'; |
|
77 | 77 | |
78 | - // /** @var Newbb\ForumHandler $forumHandler */ |
|
79 | - // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
|
80 | - // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
81 | - // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
82 | - $criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1)); |
|
83 | - $criteriaCategory->setSort('cat_order'); |
|
84 | - $categories = $categoryHandler->getAll($criteriaCategory, ['cat_id', 'cat_order', 'cat_title']); |
|
85 | - $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
|
86 | - foreach (array_keys($categories) as $c) { |
|
87 | - echo '<tr>'; |
|
88 | - echo "<td align='left' nowrap='nowrap' class='head' >" . $categories[$c]->getVar('cat_title') . '</td>'; |
|
89 | - echo "<td align='right' class='head'>"; |
|
90 | - echo "<input type='text' name='cat_orders[]' value='" . $categories[$c]->getVar('cat_order') . "' size='5' maxlength='5' />"; |
|
91 | - echo "<input type='hidden' name='cat[]' value='" . $c . "' />"; |
|
92 | - echo '</td>'; |
|
93 | - echo '</tr>'; |
|
78 | + // /** @var Newbb\ForumHandler $forumHandler */ |
|
79 | + // $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
|
80 | + // /** @var Newbb\CategoryHandler $categoryHandler */ |
|
81 | + // $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
|
82 | + $criteriaCategory = new \CriteriaCompo(new \Criteria('1', 1)); |
|
83 | + $criteriaCategory->setSort('cat_order'); |
|
84 | + $categories = $categoryHandler->getAll($criteriaCategory, ['cat_id', 'cat_order', 'cat_title']); |
|
85 | + $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
|
86 | + foreach (array_keys($categories) as $c) { |
|
87 | + echo '<tr>'; |
|
88 | + echo "<td align='left' nowrap='nowrap' class='head' >" . $categories[$c]->getVar('cat_title') . '</td>'; |
|
89 | + echo "<td align='right' class='head'>"; |
|
90 | + echo "<input type='text' name='cat_orders[]' value='" . $categories[$c]->getVar('cat_order') . "' size='5' maxlength='5' />"; |
|
91 | + echo "<input type='hidden' name='cat[]' value='" . $c . "' />"; |
|
92 | + echo '</td>'; |
|
93 | + echo '</tr>'; |
|
94 | 94 | |
95 | - if (!isset($forums[$c])) { |
|
96 | - continue; |
|
97 | - } |
|
98 | - $i = 0; |
|
99 | - foreach ($forums[$c] as $key => $forum) { |
|
100 | - echo '<tr>'; |
|
101 | - $class = ((++$i) % 2) ? 'odd' : 'even'; |
|
102 | - echo "<td align='left' nowrap='nowrap' class='" . $class . "'>" . $forum['prefix'] . $forum['forum_name'] . '</td>'; |
|
103 | - echo "<td align='left' class='" . $class . "'>"; |
|
104 | - echo $forum['prefix'] . "<input type='text' name='orders[]' value='" . $forum['forum_order'] . "' size='5' maxlength='5' />"; |
|
105 | - echo "<input type='hidden' name='forum[]' value='" . $key . "' />"; |
|
106 | - echo '</td>'; |
|
107 | - echo '</tr>'; |
|
108 | - } |
|
109 | - } |
|
110 | - echo "<tr><td class='even' align='center' colspan='6'>"; |
|
95 | + if (!isset($forums[$c])) { |
|
96 | + continue; |
|
97 | + } |
|
98 | + $i = 0; |
|
99 | + foreach ($forums[$c] as $key => $forum) { |
|
100 | + echo '<tr>'; |
|
101 | + $class = ((++$i) % 2) ? 'odd' : 'even'; |
|
102 | + echo "<td align='left' nowrap='nowrap' class='" . $class . "'>" . $forum['prefix'] . $forum['forum_name'] . '</td>'; |
|
103 | + echo "<td align='left' class='" . $class . "'>"; |
|
104 | + echo $forum['prefix'] . "<input type='text' name='orders[]' value='" . $forum['forum_order'] . "' size='5' maxlength='5' />"; |
|
105 | + echo "<input type='hidden' name='forum[]' value='" . $key . "' />"; |
|
106 | + echo '</td>'; |
|
107 | + echo '</tr>'; |
|
108 | + } |
|
109 | + } |
|
110 | + echo "<tr><td class='even' align='center' colspan='6'>"; |
|
111 | 111 | |
112 | - echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
113 | - echo '</td></tr>'; |
|
114 | - echo '</table>'; |
|
115 | - echo '</form>'; |
|
116 | - echo '</td></tr></table>'; |
|
117 | - echo '<fieldset>'; |
|
118 | - echo '<legend> ' . _MI_NEWBB_ADMENU_ORDER . ' </legend>'; |
|
119 | - echo _AM_NEWBB_HELP_ORDER_TAB; |
|
120 | - echo '</fieldset>'; |
|
112 | + echo "<input type='submit' name='submit' value='" . _SUBMIT . "' />"; |
|
113 | + echo '</td></tr>'; |
|
114 | + echo '</table>'; |
|
115 | + echo '</form>'; |
|
116 | + echo '</td></tr></table>'; |
|
117 | + echo '<fieldset>'; |
|
118 | + echo '<legend> ' . _MI_NEWBB_ADMENU_ORDER . ' </legend>'; |
|
119 | + echo _AM_NEWBB_HELP_ORDER_TAB; |
|
120 | + echo '</fieldset>'; |
|
121 | 121 | } |
122 | 122 | require_once __DIR__ . '/admin_footer.php'; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | use Xmf\Request; |
33 | 33 | |
34 | -require_once __DIR__ . '/admin_header.php'; |
|
34 | +require_once __DIR__.'/admin_header.php'; |
|
35 | 35 | xoops_cp_header(); |
36 | 36 | require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
37 | 37 | $adminObject->displayNavigation(basename(__FILE__)); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | ///** @var Newbb\ForumHandler $forumHandler */ |
41 | 41 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
42 | 42 | if (Request::getString('submit', '', 'POST')) { |
43 | - $fgroups = Request::getArray('group', '', 'POST');// !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | - $fforum = Request::getInt('forenid', 0, 'POST');// (int)($_POST['forenid']); |
|
43 | + $fgroups = Request::getArray('group', '', 'POST'); // !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | + $fforum = Request::getInt('forenid', 0, 'POST'); // (int)($_POST['forenid']); |
|
45 | 45 | $fuser = []; |
46 | 46 | if (0 !== $fforum) { |
47 | 47 | if ('' !== $fgroups) { |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | } |
57 | 57 | } |
58 | 58 | if (-1 == $fforum) { // alle Foren |
59 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "'"; |
|
59 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_forums')." SET forum_moderator='".serialize($fuser)."'"; |
|
60 | 60 | } else { |
61 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "' WHERE forum_id =" . $fforum; |
|
61 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_forums')." SET forum_moderator='".serialize($fuser)."' WHERE forum_id =".$fforum; |
|
62 | 62 | } |
63 | 63 | if (is_array($fuser) && $GLOBALS['xoopsDB']->queryF($sql)) { |
64 | 64 | $mess = _AM_NEWBB_GROUPMOD_ADDMOD; |
65 | 65 | } else { |
66 | - $mess = _AM_NEWBB_GROUPMOD_ERRMOD . '<br><small>( ' . $sql . ' )</small>'; |
|
66 | + $mess = _AM_NEWBB_GROUPMOD_ERRMOD.'<br><small>( '.$sql.' )</small>'; |
|
67 | 67 | } |
68 | 68 | redirect_header('admin_groupmod.php', 1, $mess); |
69 | 69 | // echo '<div class="confirmMsg">' . $mess . '</div><br><br>'; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | echo _AM_NEWBB_GROUPMOD_TITLEDESC; |
74 | -echo "<br><br><table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>"; |
|
74 | +echo "<br><br><table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>"; |
|
75 | 75 | echo "<form name='reorder' method='post'>"; |
76 | 76 | ///** @var Newbb\CategoryHandler $categoryHandler */ |
77 | 77 | //$categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | $categories = $categoryHandler->getAll($criteriaCategory, ['cat_id', 'cat_order', 'cat_title']); |
81 | 81 | $forums = $forumHandler->getTree(array_keys($categories), 0, 'all', ' '); |
82 | 82 | echo '<select name="forenid">'; |
83 | -echo '<option value="-1">-- ' . _AM_NEWBB_GROUPMOD_ALLFORUMS . ' --</option>'; |
|
83 | +echo '<option value="-1">-- '._AM_NEWBB_GROUPMOD_ALLFORUMS.' --</option>'; |
|
84 | 84 | foreach (array_keys($categories) as $c) { |
85 | 85 | if (!isset($forums[$c])) { |
86 | 86 | continue; |
87 | 87 | } |
88 | 88 | $i = 0; |
89 | 89 | foreach ($forums[$c] as $key => $forum) { |
90 | - echo '<option value="' . $forum['forum_id'] . '"> ' . $categories[$c]->getVar('cat_title') . '::' . $forum['forum_name'] . '</option>'; |
|
90 | + echo '<option value="'.$forum['forum_id'].'"> '.$categories[$c]->getVar('cat_title').'::'.$forum['forum_name'].'</option>'; |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | echo '</select>'; |
@@ -95,14 +95,14 @@ discard block |
||
95 | 95 | |
96 | 96 | $groups = $memberHandler->getGroups(); |
97 | 97 | foreach ($groups as $value) { |
98 | - echo '<input type="checkbox" name="group[]" value="' . $value->getVar('groupid') . '" /> ' . $value->getVar('name') . '<br>'; |
|
98 | + echo '<input type="checkbox" name="group[]" value="'.$value->getVar('groupid').'" /> '.$value->getVar('name').'<br>'; |
|
99 | 99 | } |
100 | 100 | echo "</td><tr><tr><td class='odd' style='text-align:center;'>"; |
101 | -echo '<input type="submit" value="' . _SUBMIT . '" name="submit" />'; |
|
101 | +echo '<input type="submit" value="'._SUBMIT.'" name="submit" />'; |
|
102 | 102 | echo '</td></tr></table>'; |
103 | 103 | echo '</form>'; |
104 | 104 | echo '<fieldset>'; |
105 | -echo '<legend> ' . _MI_NEWBB_ADMENU_GROUPMOD . ' </legend>'; |
|
105 | +echo '<legend> '._MI_NEWBB_ADMENU_GROUPMOD.' </legend>'; |
|
106 | 106 | echo _AM_NEWBB_HELP_GROUPMOD_TAB; |
107 | 107 | echo '</fieldset>'; |
108 | -require_once __DIR__ . '/admin_footer.php'; |
|
108 | +require_once __DIR__.'/admin_footer.php'; |
@@ -40,34 +40,34 @@ discard block |
||
40 | 40 | ///** @var Newbb\ForumHandler $forumHandler */ |
41 | 41 | //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum'); |
42 | 42 | if (Request::getString('submit', '', 'POST')) { |
43 | - $fgroups = Request::getArray('group', '', 'POST');// !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | - $fforum = Request::getInt('forenid', 0, 'POST');// (int)($_POST['forenid']); |
|
45 | - $fuser = []; |
|
46 | - if (0 !== $fforum) { |
|
47 | - if ('' !== $fgroups) { |
|
48 | - $gg = []; |
|
49 | - foreach ($fgroups as $k) { |
|
50 | - $gg = $memberHandler->getUsersByGroup($k, false); |
|
51 | - foreach ($gg as $f) { |
|
52 | - if (!in_array($f, $fuser)) { |
|
53 | - $fuser[] = $f; |
|
54 | - } |
|
55 | - } |
|
56 | - } |
|
57 | - } |
|
58 | - if (-1 == $fforum) { // alle Foren |
|
59 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "'"; |
|
60 | - } else { |
|
61 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "' WHERE forum_id =" . $fforum; |
|
62 | - } |
|
63 | - if (is_array($fuser) && $GLOBALS['xoopsDB']->queryF($sql)) { |
|
64 | - $mess = _AM_NEWBB_GROUPMOD_ADDMOD; |
|
65 | - } else { |
|
66 | - $mess = _AM_NEWBB_GROUPMOD_ERRMOD . '<br><small>( ' . $sql . ' )</small>'; |
|
67 | - } |
|
68 | - redirect_header('admin_groupmod.php', 1, $mess); |
|
69 | - // echo '<div class="confirmMsg">' . $mess . '</div><br><br>'; |
|
70 | - } |
|
43 | + $fgroups = Request::getArray('group', '', 'POST');// !empty($_POST['group']) ? $_POST['group'] : ''; |
|
44 | + $fforum = Request::getInt('forenid', 0, 'POST');// (int)($_POST['forenid']); |
|
45 | + $fuser = []; |
|
46 | + if (0 !== $fforum) { |
|
47 | + if ('' !== $fgroups) { |
|
48 | + $gg = []; |
|
49 | + foreach ($fgroups as $k) { |
|
50 | + $gg = $memberHandler->getUsersByGroup($k, false); |
|
51 | + foreach ($gg as $f) { |
|
52 | + if (!in_array($f, $fuser)) { |
|
53 | + $fuser[] = $f; |
|
54 | + } |
|
55 | + } |
|
56 | + } |
|
57 | + } |
|
58 | + if (-1 == $fforum) { // alle Foren |
|
59 | + $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "'"; |
|
60 | + } else { |
|
61 | + $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . " SET forum_moderator='" . serialize($fuser) . "' WHERE forum_id =" . $fforum; |
|
62 | + } |
|
63 | + if (is_array($fuser) && $GLOBALS['xoopsDB']->queryF($sql)) { |
|
64 | + $mess = _AM_NEWBB_GROUPMOD_ADDMOD; |
|
65 | + } else { |
|
66 | + $mess = _AM_NEWBB_GROUPMOD_ERRMOD . '<br><small>( ' . $sql . ' )</small>'; |
|
67 | + } |
|
68 | + redirect_header('admin_groupmod.php', 1, $mess); |
|
69 | + // echo '<div class="confirmMsg">' . $mess . '</div><br><br>'; |
|
70 | + } |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | echo _AM_NEWBB_GROUPMOD_TITLEDESC; |
@@ -82,20 +82,20 @@ discard block |
||
82 | 82 | echo '<select name="forenid">'; |
83 | 83 | echo '<option value="-1">-- ' . _AM_NEWBB_GROUPMOD_ALLFORUMS . ' --</option>'; |
84 | 84 | foreach (array_keys($categories) as $c) { |
85 | - if (!isset($forums[$c])) { |
|
86 | - continue; |
|
87 | - } |
|
88 | - $i = 0; |
|
89 | - foreach ($forums[$c] as $key => $forum) { |
|
90 | - echo '<option value="' . $forum['forum_id'] . '"> ' . $categories[$c]->getVar('cat_title') . '::' . $forum['forum_name'] . '</option>'; |
|
91 | - } |
|
85 | + if (!isset($forums[$c])) { |
|
86 | + continue; |
|
87 | + } |
|
88 | + $i = 0; |
|
89 | + foreach ($forums[$c] as $key => $forum) { |
|
90 | + echo '<option value="' . $forum['forum_id'] . '"> ' . $categories[$c]->getVar('cat_title') . '::' . $forum['forum_name'] . '</option>'; |
|
91 | + } |
|
92 | 92 | } |
93 | 93 | echo '</select>'; |
94 | 94 | echo "</td><tr><tr><td class='even'>"; |
95 | 95 | |
96 | 96 | $groups = $memberHandler->getGroups(); |
97 | 97 | foreach ($groups as $value) { |
98 | - echo '<input type="checkbox" name="group[]" value="' . $value->getVar('groupid') . '" /> ' . $value->getVar('name') . '<br>'; |
|
98 | + echo '<input type="checkbox" name="group[]" value="' . $value->getVar('groupid') . '" /> ' . $value->getVar('name') . '<br>'; |
|
99 | 99 | } |
100 | 100 | echo "</td><tr><tr><td class='odd' style='text-align:center;'>"; |
101 | 101 | echo '<input type="submit" value="' . _SUBMIT . '" name="submit" />'; |