@@ -28,5 +28,5 @@ |
||
| 28 | 28 | // URL: http://www.myweb.ne.jp/, https://xoops.org/, http://jp.xoops.org/ // |
| 29 | 29 | // Project: XOOPS Project // |
| 30 | 30 | // ------------------------------------------------------------------------- // |
| 31 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 31 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 32 | 32 | include $GLOBALS['xoops']->path('include/notification_update.php'); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | require_once $GLOBALS['xoops']->path('class/xoopsformloader.php'); |
| 29 | 29 | |
| 30 | 30 | // The forum instanciation |
| 31 | -$form_forum = new \XoopsThemeForm(_AM_NEWBB_EDITTHISFORUM . ' ' . $forumObject->getVar('forum_name'), 'form_forum', xoops_getenv('PHP_SELF')); |
|
| 31 | +$form_forum = new \XoopsThemeForm(_AM_NEWBB_EDITTHISFORUM.' '.$forumObject->getVar('forum_name'), 'form_forum', xoops_getenv('PHP_SELF')); |
|
| 32 | 32 | |
| 33 | 33 | // Forum name |
| 34 | 34 | $form_forum->addElement(new \XoopsFormText(_AM_NEWBB_FORUMNAME, 'forum_name', 50, 80, $forumObject->getVar('forum_name', 'E')), true); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $perm_checkbox = new \XoopsFormCheckBox('', 'perm_template', $forumObject->isNew()); |
| 66 | 66 | $perm_checkbox->addOption(1, _AM_NEWBB_PERM_TEMPLATEAPP); |
| 67 | 67 | $perm_tray->addElement($perm_checkbox); |
| 68 | -$perm_tray->addElement(new \XoopsFormLabel('', '<a href="admin_permissions.php?action=template" rel="external" title="">' . _AM_NEWBB_PERM_TEMPLATE . '</a>')); |
|
| 68 | +$perm_tray->addElement(new \XoopsFormLabel('', '<a href="admin_permissions.php?action=template" rel="external" title="">'._AM_NEWBB_PERM_TEMPLATE.'</a>')); |
|
| 69 | 69 | $form_forum->addElement($perm_tray); |
| 70 | 70 | |
| 71 | 71 | $form_forum->addElement(new \XoopsFormHidden('forum', $forumObject->getVar('forum_id'))); |
@@ -54,34 +54,34 @@ discard block |
||
| 54 | 54 | // remove old html template files |
| 55 | 55 | // create an array with all folders, and then run this once |
| 56 | 56 | |
| 57 | - $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/'); |
|
| 57 | + $templateDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/templates/'); |
|
| 58 | 58 | $template_list = array_diff(scandir($templateDirectory, SCANDIR_SORT_NONE), ['..', '.']); |
| 59 | 59 | foreach ($template_list as $k => $v) { |
| 60 | - $fileinfo = new \SplFileInfo($templateDirectory . $v); |
|
| 60 | + $fileinfo = new \SplFileInfo($templateDirectory.$v); |
|
| 61 | 61 | if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) { |
| 62 | - @unlink($templateDirectory . $v); |
|
| 62 | + @unlink($templateDirectory.$v); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | - $templateDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/templates/blocks'); |
|
| 65 | + $templateDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/templates/blocks'); |
|
| 66 | 66 | $template_list = array_diff(scandir($templateDirectory, SCANDIR_SORT_NONE), ['..', '.']); |
| 67 | 67 | foreach ($template_list as $k => $v) { |
| 68 | - $fileinfo = new \SplFileInfo($templateDirectory . $v); |
|
| 68 | + $fileinfo = new \SplFileInfo($templateDirectory.$v); |
|
| 69 | 69 | if ('html' === $fileinfo->getExtension() && 'index.html' !== $fileinfo->getFilename()) { |
| 70 | - @unlink($templateDirectory . $v); |
|
| 70 | + @unlink($templateDirectory.$v); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | // Load class XoopsFile |
| 74 | 74 | xoops_load('xoopsfile'); |
| 75 | 75 | //remove /images directory |
| 76 | - $imagesDirectory = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname', 'n') . '/images/'); |
|
| 76 | + $imagesDirectory = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname', 'n').'/images/'); |
|
| 77 | 77 | $folderHandler = \XoopsFile::getHandler('folder', $imagesDirectory); |
| 78 | 78 | $folderHandler->delete($imagesDirectory); |
| 79 | 79 | |
| 80 | 80 | //remove old changelogs |
| 81 | - array_map('unlink', glob(dirname(__DIR__) . '/docs/changelog-rev*.txt')); |
|
| 81 | + array_map('unlink', glob(dirname(__DIR__).'/docs/changelog-rev*.txt')); |
|
| 82 | 82 | |
| 83 | 83 | if (!empty($newbbConfig['syncOnUpdate'])) { |
| 84 | - require_once __DIR__ . '/../include/functions.recon.php'; |
|
| 84 | + require_once __DIR__.'/../include/functions.recon.php'; |
|
| 85 | 85 | newbbSynchronization(); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | function xoops_module_pre_install_newbb(\XoopsModule $module) |
| 109 | 109 | { |
| 110 | - $mod_tables =& $module->getInfo('tables'); |
|
| 110 | + $mod_tables = & $module->getInfo('tables'); |
|
| 111 | 111 | foreach ($mod_tables as $table) { |
| 112 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
| 112 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | return true; |
@@ -176,12 +176,12 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | foreach ($groups_post as $group_id) { |
| 178 | 178 | foreach ($post_items as $item) { |
| 179 | - $gpermHandler->addRight('forum_' . $item, $forum_id, $group_id, $module_id); |
|
| 179 | + $gpermHandler->addRight('forum_'.$item, $forum_id, $group_id, $module_id); |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | /* Create a test post */ |
| 184 | - require_once __DIR__ . '/functions.user.php'; |
|
| 184 | + require_once __DIR__.'/functions.user.php'; |
|
| 185 | 185 | /** @var Newbb\PostHandler $postHandler */ |
| 186 | 186 | $postHandler = Newbb\Helper::getInstance()->getHandler('Post'); |
| 187 | 187 | /** @var $forumpost */ |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | if (!empty($avatar) && 'blank.gif' !== $avatar) { |
| 68 | 68 | $categories[0]['fields'][] = [ |
| 69 | 69 | 'title' => _MD_NEWBB_AUTO_CREATE_AVATARS, |
| 70 | - 'value' => "<img src='" . XOOPS_UPLOAD_URL . '/' . $GLOBALS['xoopsUser']->getVar('user_avatar') . "' alt='" . $GLOBALS['xoopsUser']->getVar('uname') . "' />" |
|
| 70 | + 'value' => "<img src='".XOOPS_UPLOAD_URL.'/'.$GLOBALS['xoopsUser']->getVar('user_avatar')."' alt='".$GLOBALS['xoopsUser']->getVar('uname')."' />" |
|
| 71 | 71 | ]; |
| 72 | 72 | $weights[0][] = 0; |
| 73 | 73 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | ksort($categories); |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | -$message = sprintf(_MD_NEWBB_WELCOME_MESSAGE, $GLOBALS['xoopsUser']->getVar('uname')) . "\n\n"; |
|
| 105 | +$message = sprintf(_MD_NEWBB_WELCOME_MESSAGE, $GLOBALS['xoopsUser']->getVar('uname'))."\n\n"; |
|
| 106 | 106 | //$message .= _PROFILE . ": <a href='" . XOOPS_URL . '/userinfo.php?uid=' . $GLOBALS['xoopsUser']->getVar('uid') . "'><strong>" . $GLOBALS['xoopsUser']->getVar('uname') . '</strong></a> '; |
| 107 | 107 | //$message .= " | <a target='_blank' href='".XOOPS_URL . '/pmlite.php?send2=1&to_userid=' . $GLOBALS['xoopsUser']->getVar('uid') . "'>" . _MD_NEWBB_PM . "</a>\n"; |
| 108 | 108 | $message .= sprintf($GLOBALS['xoopsModuleConfig']['welcome_forum_message']); |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | if (!empty($GLOBALS['xoopsModuleConfig']['notification_enabled'])) { |
| 124 | 124 | $tags = []; |
| 125 | 125 | $tags['THREAD_NAME'] = $subject; |
| 126 | - $tags['THREAD_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?post_id=' . $post_id . '&topic_id=' . $postObject->getVar('topic_id') . '&forum=' . $forum_id; |
|
| 127 | - $tags['POST_URL'] = $tags['THREAD_URL'] . '#forumpost' . $post_id; |
|
| 128 | - require_once __DIR__ . '/notification.inc.php'; |
|
| 126 | + $tags['THREAD_URL'] = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?post_id='.$post_id.'&topic_id='.$postObject->getVar('topic_id').'&forum='.$forum_id; |
|
| 127 | + $tags['POST_URL'] = $tags['THREAD_URL'].'#forumpost'.$post_id; |
|
| 128 | + require_once __DIR__.'/notification.inc.php'; |
|
| 129 | 129 | $forum_info = newbb_notify_iteminfo('forum', $forum_id); |
| 130 | 130 | $tags['FORUM_NAME'] = $forum_info['name']; |
| 131 | 131 | $tags['FORUM_URL'] = $forum_info['url']; |
@@ -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 | xoops_load('XoopsRequest'); |
| 19 | 19 | |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | if (is_array($string)) { |
| 36 | 36 | $value = []; |
| 37 | 37 | foreach ($string as $key => $val) { |
| 38 | - $value[] = $key . '|' . $val; |
|
| 38 | + $value[] = $key.'|'.$val; |
|
| 39 | 39 | } |
| 40 | 40 | $string = implode(',', $value); |
| 41 | 41 | } |
| 42 | - $_SESSION['newbb_' . $name] = $string; |
|
| 42 | + $_SESSION['newbb_'.$name] = $string; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | function newbbGetSession($name, $isArray = false) |
| 51 | 51 | { |
| 52 | - $value = !empty($_SESSION['newbb_' . $name]) ? $_SESSION['newbb_' . $name] : false; |
|
| 52 | + $value = !empty($_SESSION['newbb_'.$name]) ? $_SESSION['newbb_'.$name] : false; |
|
| 53 | 53 | if ($isArray) { |
| 54 | 54 | $_value = $value ? explode(',', $value) : []; |
| 55 | 55 | $value = []; |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | if (is_array($string)) { |
| 78 | 78 | $value = []; |
| 79 | 79 | foreach ($string as $key => $val) { |
| 80 | - $value[] = $key . '|' . $val; |
|
| 80 | + $value[] = $key.'|'.$val; |
|
| 81 | 81 | } |
| 82 | 82 | $string = implode(',', $value); |
| 83 | 83 | } |
| 84 | - setcookie($forumCookie['prefix'] . $name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
| 84 | + setcookie($forumCookie['prefix'].$name, $string, (int)$expire, $forumCookie['path'], $forumCookie['domain'], $forumCookie['secure']); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | global $forumCookie; |
| 95 | 95 | // $value = !empty($_COOKIE[$forumCookie['prefix'] . $name]) ? $_COOKIE[$forumCookie['prefix'] . $name] : null; |
| 96 | - $value = Request::getString($forumCookie['prefix'] . $name, null, 'COOKIE'); |
|
| 96 | + $value = Request::getString($forumCookie['prefix'].$name, null, 'COOKIE'); |
|
| 97 | 97 | |
| 98 | 98 | if ($isArray) { |
| 99 | 99 | $_value = $value ? explode(',', $value) : []; |
@@ -11,16 +11,16 @@ |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 13 | 13 | |
| 14 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
| 14 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
| 15 | 15 | define('NEWBB_FUNCTIONS_LOADED', true); |
| 16 | 16 | |
| 17 | 17 | if (!defined('NEWBB_FUNCTIONS')) { |
| 18 | 18 | define('NEWBB_FUNCTIONS', 1); |
| 19 | 19 | |
| 20 | - require_once __DIR__ . '/functions.image.php'; |
|
| 21 | - require_once __DIR__ . '/functions.user.php'; |
|
| 22 | - require_once __DIR__ . '/functions.render.php'; |
|
| 23 | - require_once __DIR__ . '/functions.forum.php'; |
|
| 24 | - require_once __DIR__ . '/functions.session.php'; |
|
| 25 | - require_once __DIR__ . '/functions.stats.php'; |
|
| 20 | + require_once __DIR__.'/functions.image.php'; |
|
| 21 | + require_once __DIR__.'/functions.user.php'; |
|
| 22 | + require_once __DIR__.'/functions.render.php'; |
|
| 23 | + require_once __DIR__.'/functions.forum.php'; |
|
| 24 | + require_once __DIR__.'/functions.session.php'; |
|
| 25 | + require_once __DIR__.'/functions.stats.php'; |
|
| 26 | 26 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
| 13 | 13 | require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.ini.php'); |
| 14 | -require_once __DIR__ . '/functions.session.php'; |
|
| 14 | +require_once __DIR__.'/functions.session.php'; |
|
| 15 | 15 | |
| 16 | 16 | // NewBB cookie structure |
| 17 | 17 | /* NewBB cookie storage |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $forumCookie['path'] = '/'; |
| 34 | 34 | $forumCookie['secure'] = false; |
| 35 | 35 | $forumCookie['expire'] = time() + 3600 * 24 * 30; // one month |
| 36 | -$forumCookie['prefix'] = 'newbb_' . (is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : '0IP' . \Xmf\IPAddress::fromRequest()->asReadable()); // irmtfan IP for anons - use $GLOBALS["xoopsUser"] |
|
| 36 | +$forumCookie['prefix'] = 'newbb_'.(is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : '0IP'.\Xmf\IPAddress::fromRequest()->asReadable()); // irmtfan IP for anons - use $GLOBALS["xoopsUser"] |
|
| 37 | 37 | |
| 38 | 38 | // set LastVisitTemp cookie, which only gets the time from the LastVisit cookie if it does not exist yet |
| 39 | 39 | // otherwise, it gets the time from the LastVisitTemp cookie |
@@ -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_STATS_LOADED', true); |
| 18 | 18 | |
| 19 | 19 | if (!defined('NEWBB_FUNCTIONS_STATS')) { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | function getTotalViews() |
| 104 | 104 | { |
| 105 | - $sql = 'SELECT sum(topic_views) FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' '; |
|
| 105 | + $sql = 'SELECT sum(topic_views) FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' '; |
|
| 106 | 106 | if (!$result = $GLOBALS['xoopsDB']->query($sql)) { |
| 107 | 107 | return null; |
| 108 | 108 | } |
@@ -11,7 +11,7 @@ |
||
| 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_LANGUAGE_LOADED', true); |
| 16 | 16 | |
| 17 | 17 | if (!defined('NEWBB_FUNCTIONS_LANGUAGE')) { |