@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @author Taiwen Jiang <[email protected]> |
23 | 23 | */ |
24 | 24 | |
25 | -include __DIR__ . '/header.php'; |
|
25 | +include __DIR__.'/header.php'; |
|
26 | 26 | $xoops = Xoops::getInstance(); |
27 | 27 | |
28 | 28 | $op = 'main'; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $xoops->tpl()->assign('lang_youremail', XoopsLocale::C_YOUR_EMAIL); |
51 | 51 | $xoops->tpl()->assign('lang_sendpassword', XoopsLocale::SEND_PASSWORD); |
52 | 52 | $xoops->tpl()->assign('mailpasswd_token', $xoops->security()->createToken()); |
53 | - include __DIR__ . '/footer.php'; |
|
53 | + include __DIR__.'/footer.php'; |
|
54 | 54 | } |
55 | 55 | if (!empty($_GET['xoops_redirect'])) { |
56 | 56 | $redirect = trim($_GET['xoops_redirect']); |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | if (!$isExternal) { |
65 | - header('Location: ' . $redirect); |
|
65 | + header('Location: '.$redirect); |
|
66 | 66 | exit(); |
67 | 67 | } |
68 | 68 | } |
69 | - header('Location: ./userinfo.php?uid=' . $xoops->user->getVar('uid')); |
|
69 | + header('Location: ./userinfo.php?uid='.$xoops->user->getVar('uid')); |
|
70 | 70 | exit(); |
71 | 71 | } |
72 | 72 | |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | if ($xoops->isUser()) { |
84 | 84 | $xoops->getHandlerOnline()->destroy($xoops->user->getVar('uid')); |
85 | 85 | } |
86 | - $message = XoopsLocale::S_YOU_ARE_NOW_LOGGED_OUT . '<br />' . XoopsLocale::S_THANK_YOU_FOR_VISITING_OUR_SITE; |
|
87 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 1, $message); |
|
86 | + $message = XoopsLocale::S_YOU_ARE_NOW_LOGGED_OUT.'<br />'.XoopsLocale::S_THANK_YOU_FOR_VISITING_OUR_SITE; |
|
87 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 1, $message); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if ($op === 'actv') { |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | |
96 | 96 | if ($op === 'delete') { |
97 | 97 | if (!$xoops->isUser() || $xoops->getConfig('self_delete') != 1) { |
98 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 5, XoopsLocale::E_NO_ACTION_PERMISSION); |
|
98 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 5, XoopsLocale::E_NO_ACTION_PERMISSION); |
|
99 | 99 | } else { |
100 | 100 | $groups = $xoops->user->getGroups(); |
101 | 101 | if (in_array(FixedGroups::ADMIN, $groups)) { |
102 | 102 | // users in the webmasters group may not be deleted |
103 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 5, XoopsLocale::E_USER_IN_WEBMASTER_GROUP_CANNOT_BE_REMOVED); |
|
103 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 5, XoopsLocale::E_USER_IN_WEBMASTER_GROUP_CANNOT_BE_REMOVED); |
|
104 | 104 | } |
105 | 105 | $ok = !isset($_POST['ok']) ? 0 : (int)($_POST['ok']); |
106 | 106 | if ($ok != 1) { |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | echo $xoops->confirm( |
109 | 109 | array('op' => 'delete', 'ok' => 1), |
110 | 110 | 'user.php', |
111 | - XoopsLocale::Q_ARE_YOU_SURE_TO_DELETE_ACCOUNT . '<br/>' . XoopsLocale::THIS_WILL_REMOVE_ALL_YOUR_INFO |
|
111 | + XoopsLocale::Q_ARE_YOU_SURE_TO_DELETE_ACCOUNT.'<br/>'.XoopsLocale::THIS_WILL_REMOVE_ALL_YOUR_INFO |
|
112 | 112 | ); |
113 | - include __DIR__ . '/footer.php'; |
|
113 | + include __DIR__.'/footer.php'; |
|
114 | 114 | } else { |
115 | 115 | $del_uid = $xoops->user->getVar("uid"); |
116 | 116 | if (false != $xoops->getHandlerMember()->deleteUser($xoops->user)) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | $xoops->redirect('index.php', 5, XoopsLocale::S_YOUR_ACCOUNT_DELETED); |
124 | 124 | } |
125 | - $xoops->redirect(XOOPS_URL . '/', 5, XoopsLocale::E_NO_ACTION_PERMISSION); |
|
125 | + $xoops->redirect(XOOPS_URL.'/', 5, XoopsLocale::E_NO_ACTION_PERMISSION); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * @author Taiwen Jiang <[email protected]> |
24 | 24 | */ |
25 | 25 | |
26 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
26 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
27 | 27 | $xoops = Xoops::getInstance(); |
28 | 28 | |
29 | 29 | $xoops->registry()->set('profile_breadcrumbs', new ItemList()); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * @author Mage Grégory (AKA Mage) |
20 | 20 | * @version $Id$ |
21 | 21 | */ |
22 | -include __DIR__ . '/header.php'; |
|
22 | +include __DIR__.'/header.php'; |
|
23 | 23 | $xoops = Xoops::getInstance(); |
24 | 24 | $xoops->header(); |
25 | 25 | $aboutAdmin = new \Xoops\Module\Admin(); |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * @since 2.6.0 |
19 | 19 | * @author Mage Grégory (AKA Mage) |
20 | 20 | */ |
21 | -include __DIR__ . '/header.php'; |
|
21 | +include __DIR__.'/header.php'; |
|
22 | 22 | |
23 | 23 | $xoops = Xoops::getInstance(); |
24 | 24 |
@@ -19,4 +19,4 @@ |
||
19 | 19 | * @author Mage Grégory (AKA Mage) |
20 | 20 | * @version $Id$ |
21 | 21 | */ |
22 | -require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
|
22 | +require_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php'; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public static function eventCoreServiceLocateHtmlToPdf(Provider $provider) |
35 | 35 | { |
36 | 36 | if (is_a($provider, '\Xoops\Core\Service\Provider')) { |
37 | - $path = dirname(__DIR__) . '/class/HtmlToPdfProvider.php'; |
|
37 | + $path = dirname(__DIR__).'/class/HtmlToPdfProvider.php'; |
|
38 | 38 | require $path; |
39 | 39 | $object = new HtmlToPdfProvider(); |
40 | 40 | $provider->register($object); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $this->pdfKeywords = $pdfKeywords; |
345 | 345 | if (isset($this->pdfEngine)) { |
346 | 346 | $keywords = |
347 | - is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string) $this->pdfKeywords; |
|
347 | + is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string)$this->pdfKeywords; |
|
348 | 348 | $this->pdfEngine->SetKeywords($keywords); |
349 | 349 | } |
350 | 350 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | } |
436 | 436 | if (isset($this->pdfKeywords)) { |
437 | 437 | $keywords = |
438 | - is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string) $this->pdfKeywords; |
|
438 | + is_array($this->pdfKeywords) ? implode(', ', $this->pdfKeywords) : (string)$this->pdfKeywords; |
|
439 | 439 | $this->pdfEngine->SetKeywords($keywords); |
440 | 440 | } |
441 | 441 | if (!empty($this->pdfCreator)) { |
@@ -466,21 +466,21 @@ discard block |
||
466 | 466 | */ |
467 | 467 | private function decodeEntities($text) |
468 | 468 | { |
469 | - $text= html_entity_decode($text, ENT_QUOTES, "UTF-8"); |
|
470 | - $text= preg_replace_callback( |
|
469 | + $text = html_entity_decode($text, ENT_QUOTES, "UTF-8"); |
|
470 | + $text = preg_replace_callback( |
|
471 | 471 | '/&#(\d+);/m', |
472 | - function ($m) { |
|
472 | + function($m) { |
|
473 | 473 | return utf8_encode(chr($m[1])); |
474 | 474 | }, |
475 | 475 | $text |
476 | 476 | ); // decimal notation |
477 | - $text= preg_replace_callback( |
|
477 | + $text = preg_replace_callback( |
|
478 | 478 | '/&#x([a-f0-9]+);/mi', |
479 | - function ($m) { |
|
479 | + function($m) { |
|
480 | 480 | return utf8_encode(chr('0x'.$m[1])); |
481 | 481 | }, |
482 | 482 | $text |
483 | - ); //hex notation |
|
483 | + ); //hex notation |
|
484 | 484 | return $text; |
485 | 485 | } |
486 | 486 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
25 | 25 | $xoops->header(); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | -require_once dirname(__DIR__) . '/class/gtickets.php'; |
|
24 | +require_once dirname(__DIR__).'/class/gtickets.php'; |
|
25 | 25 | |
26 | 26 | $xoops = Xoops::getInstance(); |
27 | 27 | $xoops->db(); |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | |
42 | 42 | // Ticket check |
43 | 43 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
44 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
44 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
45 | 45 | } |
46 | 46 | |
47 | - $new_prefix = empty($_POST['new_prefix']) ? 'x' . substr(md5(time()), -5) : $_POST['new_prefix']; |
|
47 | + $new_prefix = empty($_POST['new_prefix']) ? 'x'.substr(md5(time()), -5) : $_POST['new_prefix']; |
|
48 | 48 | $old_prefix = $_POST['old_prefix']; |
49 | 49 | |
50 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . \XoopsBaseConfig::get('db-name') . '`'); |
|
50 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.\XoopsBaseConfig::get('db-name').'`'); |
|
51 | 51 | |
52 | 52 | if (!$db->getRowsNum($srs)) { |
53 | 53 | $xoops->tpl()->assign('error', _AM_PROTECTOR_PREFIX_ERROR_NACT); |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | while (false !== ($row_table = $db->fetchArray($srs))) { |
60 | 60 | ++$count; |
61 | 61 | $old_table = $row_table['Name']; |
62 | - if (substr($old_table, 0, strlen($old_prefix) + 1) !== $old_prefix . '_') { |
|
62 | + if (substr($old_table, 0, strlen($old_prefix) + 1) !== $old_prefix.'_') { |
|
63 | 63 | continue; |
64 | 64 | } |
65 | 65 | |
66 | - $new_table = $new_prefix . substr($old_table, strlen($old_prefix)); |
|
66 | + $new_table = $new_prefix.substr($old_table, strlen($old_prefix)); |
|
67 | 67 | |
68 | - $crs = $db->queryF('SHOW CREATE TABLE ' . $old_table); |
|
68 | + $crs = $db->queryF('SHOW CREATE TABLE '.$old_table); |
|
69 | 69 | if (!$db->getRowsNum($crs)) { |
70 | - $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_SCT, $old_table) . '<br />'; |
|
70 | + $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_SCT, $old_table).'<br />'; |
|
71 | 71 | continue; |
72 | 72 | } |
73 | 73 | $row_create = $db->fetchArray($crs); |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | |
76 | 76 | $crs = $db->queryF($create_sql); |
77 | 77 | if (!$crs) { |
78 | - $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_CT, $new_table) . '<br />'; |
|
78 | + $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_CT, $new_table).'<br />'; |
|
79 | 79 | continue; |
80 | 80 | } |
81 | 81 | |
82 | 82 | $irs = $db->queryF("INSERT INTO `$new_table` SELECT * FROM `$old_table`"); |
83 | 83 | if (!$irs) { |
84 | - $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_II, $new_table) . '<br />'; |
|
84 | + $error .= sprintf(_AM_PROTECTOR_PREFIX_ERROR_II, $new_table).'<br />'; |
|
85 | 85 | continue; |
86 | 86 | } |
87 | 87 | } |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | |
108 | 108 | // Ticket check |
109 | 109 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
110 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
110 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | $prefix = $_POST['prefix']; |
114 | 114 | |
115 | 115 | // get table list |
116 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . \XoopsBaseConfig::get('db-name') . '`'); |
|
116 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.\XoopsBaseConfig::get('db-name').'`'); |
|
117 | 117 | if (!$db->getRowsNum($srs)) { |
118 | 118 | $xoops->tpl()->assign('error', _AM_PROTECTOR_PREFIX_ERROR_NADT); |
119 | 119 | $xoops->footer(); |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | |
125 | 125 | while (false !== ($row_table = $db->fetchArray($srs))) { |
126 | 126 | $table = $row_table['Name']; |
127 | - if (substr($table, 0, strlen($prefix) + 1) !== $prefix . '_') { |
|
127 | + if (substr($table, 0, strlen($prefix) + 1) !== $prefix.'_') { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | 130 | $drs = $db->queryF("SHOW CREATE TABLE `$table`"); |
131 | - $export_string .= "\nDROP TABLE IF EXISTS `$table`;\n" . mysql_result($drs, 0, 1) . ";\n\n"; |
|
131 | + $export_string .= "\nDROP TABLE IF EXISTS `$table`;\n".mysql_result($drs, 0, 1).";\n\n"; |
|
132 | 132 | $result = mysqli_query("SELECT * FROM `$table`"); |
133 | 133 | $fields_cnt = mysql_num_fields($result); |
134 | 134 | $field_flags = array(); |
@@ -159,24 +159,24 @@ discard block |
||
159 | 159 | if (empty($row[$j]) && $row[$j] != '0') { |
160 | 160 | $values[] = '\'\''; |
161 | 161 | } else { |
162 | - $values[] = '0x' . bin2hex($row[$j]); |
|
162 | + $values[] = '0x'.bin2hex($row[$j]); |
|
163 | 163 | } |
164 | 164 | // something else -> treat as a string |
165 | 165 | } else { |
166 | - $values[] = '\'' . str_replace($search, $replace, addslashes($row[$j])) . '\''; |
|
166 | + $values[] = '\''.str_replace($search, $replace, addslashes($row[$j])).'\''; |
|
167 | 167 | } |
168 | 168 | } // end if |
169 | 169 | } // end for |
170 | 170 | |
171 | - $export_string .= "INSERT INTO `$table` VALUES (" . implode(', ', $values) . ");\n"; |
|
171 | + $export_string .= "INSERT INTO `$table` VALUES (".implode(', ', $values).");\n"; |
|
172 | 172 | unset($values); |
173 | 173 | } // end while |
174 | 174 | mysql_free_result($result); |
175 | 175 | } |
176 | 176 | |
177 | 177 | header('Content-Type: Application/octet-stream'); |
178 | - header('Content-Disposition: attachment; filename="' . $prefix . '_' . date('YmdHis') . '.sql"'); |
|
179 | - header('Content-Length: ' . strlen($export_string)); |
|
178 | + header('Content-Disposition: attachment; filename="'.$prefix.'_'.date('YmdHis').'.sql"'); |
|
179 | + header('Content-Length: '.strlen($export_string)); |
|
180 | 180 | set_time_limit(0); |
181 | 181 | echo $export_string; |
182 | 182 | exit; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | // Ticket check |
194 | 194 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
195 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
195 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | $prefix = $_POST['prefix']; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | // get table list |
216 | - $srs = $db->queryF('SHOW TABLE STATUS FROM `' . \XoopsBaseConfig::get('db-name') . '`'); |
|
216 | + $srs = $db->queryF('SHOW TABLE STATUS FROM `'.\XoopsBaseConfig::get('db-name').'`'); |
|
217 | 217 | if (!$db->getRowsNum($srs)) { |
218 | 218 | $xoops->tpl()->assign('error', _AM_PROTECTOR_PREFIX_ERROR_NADT); |
219 | 219 | $xoops->footer(); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | while (false !== ($row_table = $db->fetchArray($srs))) { |
224 | 224 | $table = $row_table['Name']; |
225 | - if (substr($table, 0, strlen($prefix) + 1) !== $prefix . '_') { |
|
225 | + if (substr($table, 0, strlen($prefix) + 1) !== $prefix.'_') { |
|
226 | 226 | continue; |
227 | 227 | } |
228 | 228 | $drs = $db->queryF("DROP TABLE `$table`"); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $admin_page = new \Xoops\Module\Admin(); |
242 | 242 | $admin_page->renderNavigation('prefix_manager.php'); |
243 | 243 | |
244 | -$xoops->tpl()->assign('prefix', sprintf(_AM_TXT_HOWTOCHANGEDB, \XoopsBaseConfig::get('var_path') . "/data/secure.php")); |
|
244 | +$xoops->tpl()->assign('prefix', sprintf(_AM_TXT_HOWTOCHANGEDB, \XoopsBaseConfig::get('var_path')."/data/secure.php")); |
|
245 | 245 | $xoops->tpl()->assign('prefix_line', sprintf(_AM_PROTECTOR_PREFIX_CHANGEDBLINE, \XoopsBaseConfig::get('db-prefix'))); |
246 | 246 | |
247 | 247 | // Display Log if exists |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | } |
253 | 253 | |
254 | 254 | // query |
255 | -$srs = $db->queryF("SHOW TABLE STATUS FROM `" . \XoopsBaseConfig::get('db-name') . '`'); |
|
255 | +$srs = $db->queryF("SHOW TABLE STATUS FROM `".\XoopsBaseConfig::get('db-name').'`'); |
|
256 | 256 | if (!$db->getRowsNum($srs)) { |
257 | 257 | $xoops->tpl()->assign('error', '_AM_PROTECTOR_PREFIX_ERROR_NACT'); |
258 | 258 | $xoops->footer(); |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | $table_count = 0; |
279 | 279 | $has_xoopscomments = false; |
280 | 280 | foreach ($tables as $table) { |
281 | - if ($table == $prefix['name'] . '_xoopscomments') { |
|
281 | + if ($table == $prefix['name'].'_xoopscomments') { |
|
282 | 282 | $has_xoopscomments = true; |
283 | 283 | } |
284 | - if (substr($table, 0, strlen($prefix['name']) + 1) === $prefix['name'] . '_') { |
|
284 | + if (substr($table, 0, strlen($prefix['name']) + 1) === $prefix['name'].'_') { |
|
285 | 285 | ++$table_count; |
286 | 286 | } |
287 | 287 | } |