@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | use XoopsModules\Newbb; |
| 24 | 24 | |
| 25 | 25 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 26 | -require_once dirname(__DIR__) . '/preloads/autoloader.php'; |
|
| 26 | +require_once dirname(__DIR__).'/preloads/autoloader.php'; |
|
| 27 | 27 | |
| 28 | 28 | $moduleDirName = basename(dirname(__DIR__)); |
| 29 | -$moduleDirNameUpper = strtoupper($moduleDirName); //$capsDirName |
|
| 29 | +$moduleDirNameUpper = strtoupper($moduleDirName); //$capsDirName |
|
| 30 | 30 | |
| 31 | 31 | /** @var \XoopsDatabase $db */ |
| 32 | 32 | /** @var Newbb\Helper $helper */ |
@@ -49,20 +49,20 @@ discard block |
||
| 49 | 49 | //define('NEWBB_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash |
| 50 | 50 | //define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash |
| 51 | 51 | |
| 52 | -if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
|
| 53 | - define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
|
| 54 | - define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
| 55 | - define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
| 56 | - define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
|
| 57 | - define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
|
| 58 | - define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
|
| 59 | - define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
|
| 60 | - define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
|
| 61 | - define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
|
| 62 | - define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
|
| 63 | - define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
| 64 | - define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
| 65 | - define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
|
| 52 | +if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) { |
|
| 53 | + define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__))); |
|
| 54 | + define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
| 55 | + define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
| 56 | + define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/'); |
|
| 57 | + define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/'); |
|
| 58 | + define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images'); |
|
| 59 | + define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/'); |
|
| 60 | + define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/'); |
|
| 61 | + define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php'); |
|
| 62 | + define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png'); |
|
| 63 | + define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
| 64 | + define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
| 65 | + define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
@@ -133,15 +133,15 @@ discard block |
||
| 133 | 133 | //$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
| 134 | 134 | |
| 135 | 135 | $icons = [ |
| 136 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
|
| 137 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
|
| 138 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
|
| 139 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
|
| 140 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
|
| 141 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
|
| 142 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
|
| 143 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
|
| 144 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
|
| 136 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT."' align='middle'>", |
|
| 137 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>", |
|
| 138 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>", |
|
| 139 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>", |
|
| 140 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>", |
|
| 141 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>", |
|
| 142 | + 'add' => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>", |
|
| 143 | + '0' => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>", |
|
| 144 | + '1' => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>", |
|
| 145 | 145 | ]; |
| 146 | 146 | |
| 147 | 147 | $debug = false; |
@@ -154,12 +154,12 @@ discard block |
||
| 154 | 154 | $GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | -$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
|
| 157 | +$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL.'/modules/'.$moduleDirName); |
|
| 158 | 158 | // Local icons path |
| 159 | 159 | if (is_object($helper->getModule())) { |
| 160 | 160 | $pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
| 161 | 161 | $pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
| 162 | 162 | |
| 163 | - $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
| 163 | + $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16); |
|
| 164 | 164 | $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
| 165 | 165 | } |
@@ -30,16 +30,16 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | function xoops_module_pre_install_newbb(\XoopsModule $module) |
| 32 | 32 | { |
| 33 | - require_once dirname(__DIR__) . '/preloads/autoloader.php'; |
|
| 33 | + require_once dirname(__DIR__).'/preloads/autoloader.php'; |
|
| 34 | 34 | /** @var Newbb\Utility $utility */ |
| 35 | 35 | $utility = new \XoopsModules\Newbb\Utility(); |
| 36 | 36 | $xoopsSuccess = $utility::checkVerXoops($module); |
| 37 | 37 | $phpSuccess = $utility::checkVerPhp($module); |
| 38 | 38 | |
| 39 | 39 | if (false !== $xoopsSuccess && false !== $phpSuccess) { |
| 40 | - $moduleTables =& $module->getInfo('tables'); |
|
| 40 | + $moduleTables = & $module->getInfo('tables'); |
|
| 41 | 41 | foreach ($moduleTables as $table) { |
| 42 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
| 42 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | function xoops_module_install_newbb(\XoopsModule $module) |
| 57 | 57 | { |
| 58 | - require_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php'; |
|
| 59 | - require_once dirname(__DIR__) . '/include/config.php'; |
|
| 58 | + require_once dirname(dirname(dirname(__DIR__))).'/mainfile.php'; |
|
| 59 | + require_once dirname(__DIR__).'/include/config.php'; |
|
| 60 | 60 | |
| 61 | 61 | $moduleDirName = basename(dirname(__DIR__)); |
| 62 | 62 | |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | $moduleId2 = $helper->getModule()->mid(); |
| 75 | 75 | $grouppermHandler = xoops_getHandler('groupperm'); |
| 76 | 76 | // access rights ------------------------------------------ |
| 77 | - $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
| 78 | - $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
| 79 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
| 80 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
| 81 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
| 77 | + $grouppermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
| 78 | + $grouppermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
| 79 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
| 80 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
| 81 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
| 82 | 82 | |
| 83 | 83 | // --- CREATE FOLDERS --------------- |
| 84 | 84 | if (count($configurator->uploadFolders) > 0) { |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | // --- COPY blank.png FILES --------------- |
| 92 | 92 | if (count($configurator->copyBlankFiles) > 0) { |
| 93 | - $file = dirname(__DIR__) . '/assets/images/blank.png'; |
|
| 93 | + $file = dirname(__DIR__).'/assets/images/blank.png'; |
|
| 94 | 94 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
| 95 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
| 95 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
| 96 | 96 | $utility::copyFile($file, $dest); |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | //delete .html entries from the tpl table |
| 100 | - $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
| 100 | + $sql = 'DELETE FROM '.$xoopsDB->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'"; |
|
| 101 | 101 | $xoopsDB->queryF($sql); |
| 102 | 102 | |
| 103 | 103 | return true; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_RENDER_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_RENDER')) { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | if (0 !== $br) { |
| 68 | 68 | $text = $myts->nl2Br($text); |
| 69 | 69 | } |
| 70 | - $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
| 70 | + $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
| 71 | 71 | |
| 72 | 72 | return $text; |
| 73 | 73 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}' />"; |
| 100 | 100 | if (empty($asImage)) { |
| 101 | - $button = "<a href='{$link}' title='{$alt}' {$extra}>" . newbbDisplayImage($button, $alt, true) . '</a>'; |
|
| 101 | + $button = "<a href='{$link}' title='{$alt}' {$extra}>".newbbDisplayImage($button, $alt, true).'</a>'; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | return $button; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_WELCOME_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_WELCOME')) { |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | return false; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - require_once __DIR__ . '/functions.welcome.inc.php'; |
|
| 43 | + require_once __DIR__.'/functions.welcome.inc.php'; |
|
| 44 | 44 | unset($forumObject); |
| 45 | 45 | |
| 46 | 46 | return $ret; |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | // return true; |
| 36 | 36 | |
| 37 | - $moduleDirName = basename(dirname(__DIR__)); |
|
| 38 | - $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 37 | + $moduleDirName = basename(dirname(__DIR__)); |
|
| 38 | + $moduleDirNameUpper = strtoupper($moduleDirName); |
|
| 39 | 39 | /** @var \XoopsModules\Newbb\Helper $helper */ |
| 40 | 40 | $helper = \XoopsModules\Newbb\Helper::getInstance(); |
| 41 | 41 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | if ($dirInfo->isDir()) { |
| 56 | 56 | // The directory exists so delete it |
| 57 | 57 | if (false === $utility::rrmdir($old_dir)) { |
| 58 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
| 58 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
| 59 | 59 | $success = false; |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_SESSION_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_SESSION')) { |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | if (is_array($string)) { |
| 35 | 35 | $value = []; |
| 36 | 36 | foreach ($string as $key => $val) { |
| 37 | - $value[] = $key . '|' . $val; |
|
| 37 | + $value[] = $key.'|'.$val; |
|
| 38 | 38 | } |
| 39 | 39 | $string = implode(',', $value); |
| 40 | 40 | } |
| 41 | - $_SESSION['newbb_' . $name] = $string; |
|
| 41 | + $_SESSION['newbb_'.$name] = $string; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | function newbbGetSession($name, $isArray = false) |
| 50 | 50 | { |
| 51 | - $value = !empty($_SESSION['newbb_' . $name]) ? $_SESSION['newbb_' . $name] : false; |
|
| 51 | + $value = !empty($_SESSION['newbb_'.$name]) ? $_SESSION['newbb_'.$name] : false; |
|
| 52 | 52 | if ($isArray) { |
| 53 | 53 | $_value = $value ? explode(',', $value) : []; |
| 54 | 54 | $value = []; |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | if (is_array($string)) { |
| 77 | 77 | $value = []; |
| 78 | 78 | foreach ($string as $key => $val) { |
| 79 | - $value[] = $key . '|' . $val; |
|
| 79 | + $value[] = $key.'|'.$val; |
|
| 80 | 80 | } |
| 81 | 81 | $string = implode(',', $value); |
| 82 | 82 | } |
| 83 | - setcookie($forumCookie['prefix'] . $name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
| 83 | + setcookie($forumCookie['prefix'].$name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | global $forumCookie; |
| 94 | 94 | // $value = !empty($_COOKIE[$forumCookie['prefix'] . $name]) ? $_COOKIE[$forumCookie['prefix'] . $name] : null; |
| 95 | - $value = Request::getString($forumCookie['prefix'] . $name, null, 'COOKIE'); |
|
| 95 | + $value = Request::getString($forumCookie['prefix'].$name, null, 'COOKIE'); |
|
| 96 | 96 | |
| 97 | 97 | if ($isArray) { |
| 98 | 98 | $_value = $value ? explode(',', $value) : []; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 13 | 13 | |
| 14 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 14 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 15 | 15 | define('NEWBB_FUNCTIONS_TOPIC_LOADED', true); |
| 16 | 16 | |
| 17 | 17 | if (!defined('NEWBB_FUNCTIONS_TOPIC')) { |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | if (empty($prefixName)) { |
| 43 | 43 | return $topicTitle; |
| 44 | 44 | } |
| 45 | - $topicPrefix = $prefixColor ? '<em style="font-style: normal; color: ' . $prefixColor . ';">[' . $prefixName . ']</em> ' : '[' . $prefixName . '] '; |
|
| 45 | + $topicPrefix = $prefixColor ? '<em style="font-style: normal; color: '.$prefixColor.';">['.$prefixName.']</em> ' : '['.$prefixName.'] '; |
|
| 46 | 46 | |
| 47 | - return $topicPrefix . $topicTitle; |
|
| 47 | + return $topicPrefix.$topicTitle; |
|
| 48 | 48 | } |
| 49 | 49 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_FORUM_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_FORUM')) { |
@@ -40,8 +40,8 @@ discard block |
||
| 40 | 40 | $groups = $xoopsUser->getGroups(); |
| 41 | 41 | } |
| 42 | 42 | sort($groups); |
| 43 | - $groupKey = 'forumselect_' . $permission . '_' . md5(implode(',', $groups)); |
|
| 44 | - $forums = $cacheHelper->cacheRead($groupKey, function () use ($categories, $permission) { |
|
| 43 | + $groupKey = 'forumselect_'.$permission.'_'.md5(implode(',', $groups)); |
|
| 44 | + $forums = $cacheHelper->cacheRead($groupKey, function() use ($categories, $permission) { |
|
| 45 | 45 | /** @var Newbb\CategoryHandler $categoryHandler */ |
| 46 | 46 | $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category'); |
| 47 | 47 | $categories = $categoryHandler->getByPermission($permission, ['cat_id', 'cat_order', 'cat_title'], false); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ($categoryDelimiter) { |
| 62 | 62 | $box .= "<option value=0> </option>\n"; |
| 63 | 63 | } |
| 64 | - $box .= "<option value='" . (-1 * $key) . "'>[" . $categories[$key]['cat_title'] . "]</option>\n"; |
|
| 64 | + $box .= "<option value='".(-1 * $key)."'>[".$categories[$key]['cat_title']."]</option>\n"; |
|
| 65 | 65 | if (empty($forums[$key])) { |
| 66 | 66 | continue; |
| 67 | 67 | } |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | if ($see && in_array($f, $value)) { |
| 70 | 70 | continue; |
| 71 | 71 | } |
| 72 | - $box .= "<option value='{$f}' " . (in_array($f, $value) ? ' selected' : '') . '>' . $forum['prefix'] . $forum['forum_name'] . "</option>\n"; |
|
| 72 | + $box .= "<option value='{$f}' ".(in_array($f, $value) ? ' selected' : '').'>'.$forum['prefix'].$forum['forum_name']."</option>\n"; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } else { |
| 76 | - $box .= '<option value=0>' . _MD_NEWBB_NOFORUMINDB . "</option>\n"; |
|
| 76 | + $box .= '<option value=0>'._MD_NEWBB_NOFORUMINDB."</option>\n"; |
|
| 77 | 77 | } |
| 78 | 78 | unset($forums, $categories); |
| 79 | 79 | |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | function newbbMakeJumpbox($forum_id = 0) |
| 88 | 88 | { |
| 89 | - $box = '<form name="forum_jumpbox" method="get" action="' . XOOPS_URL . '/modules/newbb/viewforum.php" onsubmit="javascript: if (document.forum_jumpbox.forum.value < 1) {return false;}">'; |
|
| 89 | + $box = '<form name="forum_jumpbox" method="get" action="'.XOOPS_URL.'/modules/newbb/viewforum.php" onsubmit="javascript: if (document.forum_jumpbox.forum.value < 1) {return false;}">'; |
|
| 90 | 90 | $box .= '<select class="select" name="forum" onchange="if (this.options[this.selectedIndex].value >0) { document.forms.forum_jumpbox.submit();}">'; |
| 91 | - $box .= '<option value=0>-- ' . _MD_NEWBB_SELFORUM . ' --</option>'; |
|
| 91 | + $box .= '<option value=0>-- '._MD_NEWBB_SELFORUM.' --</option>'; |
|
| 92 | 92 | $box .= newbbForumSelectBox($forum_id); |
| 93 | - $box .= "</select> <input type='submit' class='button' value='" . _GO . "' /></form>"; |
|
| 93 | + $box .= "</select> <input type='submit' class='button' value='"._GO."' /></form>"; |
|
| 94 | 94 | unset($forums, $categories); |
| 95 | 95 | |
| 96 | 96 | return $box; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 15 | 15 | |
| 16 | -defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php'; |
|
| 16 | +defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php'; |
|
| 17 | 17 | define('NEWBB_FUNCTIONS_READ_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_READ')) { |