@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | 27 | use Xmf\Request; |
| 28 | 28 | |
| 29 | -include __DIR__ . '/header.php'; |
|
| 29 | +include __DIR__.'/header.php'; |
|
| 30 | 30 | |
| 31 | -$op = Request::getString('op', Request::getString('op', '', 'POST'), 'GET');//!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : ''); |
|
| 32 | -$blog_id = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET');//!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0); |
|
| 33 | -$blog_id = is_array($blog_id) ? array_map('intval', $blog_id) : (int)$blog_id; |
|
| 31 | +$op = Request::getString('op', Request::getString('op', '', 'POST'), 'GET'); //!empty($_POST['op']) ? $_POST['op'] : (!empty($_GET['op']) ? $_GET['op'] : ''); |
|
| 32 | +$blog_id = Request::getArray('blog', Request::getArray('blog', [], 'POST'), 'GET'); //!empty($_POST['blog']) ? $_POST['blog'] : (!empty($_GET['blog']) ? $_GET['blog'] : 0); |
|
| 33 | +$blog_id = is_array($blog_id) ? array_map('intval', $blog_id) : (int) $blog_id; |
|
| 34 | 34 | |
| 35 | 35 | if (empty($xoopsModuleConfig['newblog_submit']) && (!is_object($xoopsUser) || !$xoopsUser->isAdmin())) { |
| 36 | 36 | redirect_header('index.php', 2, _NOPERM); |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if ($op === 'save' && !$GLOBALS['xoopsSecurity']->check()) { |
| 44 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID') . ': security check failed'); |
|
| 44 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID').': security check failed'); |
|
| 45 | 45 | } |
| 46 | -include XOOPS_ROOT_PATH . '/header.php'; |
|
| 47 | -include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 46 | +include XOOPS_ROOT_PATH.'/header.php'; |
|
| 47 | +include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
| 48 | 48 | |
| 49 | 49 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
| 50 | 50 | $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | if ($blog_id) { |
| 57 | 57 | $blog_obj = $blogHandler->get($blog_id); |
| 58 | 58 | if ($xoopsUser->isAdmin()) { |
| 59 | - $blog_obj->setVar('blog_status', Request::getInt('blog_status', 0, 'POST'));// @$_POST['blog_status']); |
|
| 59 | + $blog_obj->setVar('blog_status', Request::getInt('blog_status', 0, 'POST')); // @$_POST['blog_status']); |
|
| 60 | 60 | } |
| 61 | - } else { |
|
| 61 | + }else { |
|
| 62 | 62 | if ($blog_exists = $blogHandler->getCount(new Criteria('blog_feed', $myts->addSlashes(trim(Request::getText('blog_feed', '', 'POST'))))) //$_POST['blog_feed'])))) |
| 63 | 63 | ) { |
| 64 | 64 | redirect_header('index.php', 2, planet_constant('MD_BLOGEXISTS')); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | case 2: |
| 72 | 72 | if (!is_object($xoopsUser)) { |
| 73 | 73 | $status = 0; |
| 74 | - } else { |
|
| 74 | + }else { |
|
| 75 | 75 | $status = 1; |
| 76 | 76 | } |
| 77 | 77 | break; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | default: |
| 84 | 84 | if (!is_object($xoopsUser) || !$xoopsUser->isAdmin()) { |
| 85 | 85 | $status = 0; |
| 86 | - } else { |
|
| 86 | + }else { |
|
| 87 | 87 | $status = 1; |
| 88 | 88 | } |
| 89 | 89 | break; |
@@ -92,14 +92,14 @@ discard block |
||
| 92 | 92 | $blog_obj->setVar('blog_status', $status); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $blog_obj->setVar('blog_title', Request::getString('blog_title', '', 'POST'));//$_POST['blog_title']); |
|
| 96 | - $blog_obj->setVar('blog_desc', Request::getString('blog_desc', '', 'POST'));//$_POST['blog_desc']); |
|
| 97 | - $blog_obj->setVar('blog_image', Request::getString('blog_image', '', 'POST'));//$_POST['blog_image']); |
|
| 98 | - $blog_obj->setVar('blog_feed', Request::getText('blog_feed', '', 'POST'));//$_POST['blog_feed']); |
|
| 99 | - $blog_obj->setVar('blog_link', Request::getString('blog_link', '', 'POST'));//$_POST['blog_link']); |
|
| 100 | - $blog_obj->setVar('blog_language', Request::getString('blog_language', '', 'POST'));//$_POST['blog_language']); |
|
| 101 | - $blog_obj->setVar('blog_charset', Request::getString('blog_charset', '', 'POST'));//$_POST['blog_charset']); |
|
| 102 | - $blog_obj->setVar('blog_trackback', Request::getString('blog_trackback', '', 'POST'));//$_POST['blog_trackback']); |
|
| 95 | + $blog_obj->setVar('blog_title', Request::getString('blog_title', '', 'POST')); //$_POST['blog_title']); |
|
| 96 | + $blog_obj->setVar('blog_desc', Request::getString('blog_desc', '', 'POST')); //$_POST['blog_desc']); |
|
| 97 | + $blog_obj->setVar('blog_image', Request::getString('blog_image', '', 'POST')); //$_POST['blog_image']); |
|
| 98 | + $blog_obj->setVar('blog_feed', Request::getText('blog_feed', '', 'POST')); //$_POST['blog_feed']); |
|
| 99 | + $blog_obj->setVar('blog_link', Request::getString('blog_link', '', 'POST')); //$_POST['blog_link']); |
|
| 100 | + $blog_obj->setVar('blog_language', Request::getString('blog_language', '', 'POST')); //$_POST['blog_language']); |
|
| 101 | + $blog_obj->setVar('blog_charset', Request::getString('blog_charset', '', 'POST')); //$_POST['blog_charset']); |
|
| 102 | + $blog_obj->setVar('blog_trackback', Request::getString('blog_trackback', '', 'POST')); //$_POST['blog_trackback']); |
|
| 103 | 103 | if ($blog_obj->isNew()) { |
| 104 | 104 | $blog_obj->setVar('blog_submitter', is_object($xoopsUser) ? $xoopsUser->getVar('uid') : PlanetUtility::planetGetIP(true)); |
| 105 | 105 | } |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | if (in_array(0, $_POST['categories'])) { |
| 111 | 111 | $_POST['categories'] = []; |
| 112 | 112 | } |
| 113 | - $blogHandler->setCategories($blog_id, Request::getString('andor', '', 'POST'));//$_POST['categories']); |
|
| 113 | + $blogHandler->setCategories($blog_id, Request::getString('andor', '', 'POST')); //$_POST['categories']); |
|
| 114 | 114 | } |
| 115 | 115 | $message = planet_constant('MD_DBUPDATED'); |
| 116 | - redirect_header('index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message); |
|
| 116 | + redirect_header('index.php'.URL_DELIMITER.'b'.$blog_id, 2, $message); |
|
| 117 | 117 | |
| 118 | 118 | /* edit a single blog */ |
| 119 | 119 | // no break |
@@ -122,14 +122,14 @@ discard block |
||
| 122 | 122 | if (!empty(Request::getString('fetch', '', 'POST'))) { |
| 123 | 123 | $blog_obj = $blogHandler->fetch(Request::getText('blog_feed', '', 'POST')); |
| 124 | 124 | $blog_obj->setVar('blog_id', $blog_id); |
| 125 | - } else { |
|
| 125 | + }else { |
|
| 126 | 126 | $blog_obj = $blogHandler->get($blog_id); |
| 127 | 127 | } |
| 128 | - $categories = Request::getArray('categories', [], 'POST');//isset($_POST['categories']) ? $_POST['categories'] : array(); |
|
| 128 | + $categories = Request::getArray('categories', [], 'POST'); //isset($_POST['categories']) ? $_POST['categories'] : array(); |
|
| 129 | 129 | if (in_array('-1', $categories)) { |
| 130 | 130 | $categories = []; |
| 131 | 131 | } |
| 132 | - if (empty($categories) && $blog_id > 0) { |
|
| 132 | + if (empty($categories) && $blog_id>0) { |
|
| 133 | 133 | $crit = new Criteria('bc.blog_id', $blog_id); |
| 134 | 134 | $categories = array_keys($categoryHandler->getByBlog($crit)); |
| 135 | 135 | } |
@@ -137,23 +137,23 @@ discard block |
||
| 137 | 137 | $categories = [0 => _NONE]; |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . '</legend>'; |
|
| 140 | + echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT.'</legend>'; |
|
| 141 | 141 | echo '<br>'; |
| 142 | 142 | if (empty($blog_id) && $blog_obj->getVar('blog_feed')) { |
| 143 | 143 | $criteria = new Criteria('blog_feed', $blog_obj->getVar('blog_feed')); |
| 144 | 144 | $blogs_obj = $blogHandler->getList($criteria); |
| 145 | - if (count($blogs_obj) > 0) { |
|
| 146 | - echo "<div class=\"errorMsg\">" . planet_constant('MD_BLOGEXISTS'); |
|
| 145 | + if (count($blogs_obj)>0) { |
|
| 146 | + echo "<div class=\"errorMsg\">".planet_constant('MD_BLOGEXISTS'); |
|
| 147 | 147 | foreach (array_keys($blogs_obj) as $bid) { |
| 148 | - echo "<br><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $bid . "\" target=\"_blank\">" . $blogs_obj[$bid] . '</a>'; |
|
| 148 | + echo "<br><a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$bid."\" target=\"_blank\">".$blogs_obj[$bid].'</a>'; |
|
| 149 | 149 | } |
| 150 | 150 | echo '</div>'; |
| 151 | 151 | unset($blogs_obj, $criteria); |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | - include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/form.blog.php'; |
|
| 154 | + include XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/form.blog.php'; |
|
| 155 | 155 | echo '</fieldset>'; |
| 156 | 156 | break; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | -include XOOPS_ROOT_PATH . '/footer.php'; |
|
| 159 | +include XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 29 | 29 | |
| 30 | -include __DIR__ . '/include/vars.php'; |
|
| 30 | +include __DIR__.'/include/vars.php'; |
|
| 31 | 31 | |
| 32 | -$modversion = [ |
|
| 32 | +$modversion = [ |
|
| 33 | 33 | 'name' => planet_constant('MI_NAME'), |
| 34 | 34 | 'version' => 2.10, |
| 35 | 35 | 'module_status' => 'Final', |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | 'credits' => 'XOOPS Project', |
| 40 | 40 | 'image' => 'assets/images/logoModule.png', |
| 41 | 41 | 'dirname' => $GLOBALS['moddirname'], |
| 42 | - 'help' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/readme.html' |
|
| 42 | + 'help' => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/readme.html' |
|
| 43 | 43 | ]; |
| 44 | 44 | $modversion['help'] = 'page=help'; |
| 45 | 45 | $modversion['license'] = 'GNU see LICENSE'; |
| 46 | -$modversion['license_file'] = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/gpl.txt'; |
|
| 46 | +$modversion['license_file'] = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/gpl.txt'; |
|
| 47 | 47 | $modversion['author_word'] = ''; |
| 48 | 48 | $modversion['module_team'] = ''; |
| 49 | 49 | |
@@ -62,12 +62,12 @@ discard block |
||
| 62 | 62 | // database tables |
| 63 | 63 | $modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; |
| 64 | 64 | $modversion['tables'] = [ |
| 65 | - $GLOBALS['MOD_DB_PREFIX'] . '_category', |
|
| 66 | - $GLOBALS['MOD_DB_PREFIX'] . '_article', |
|
| 67 | - $GLOBALS['MOD_DB_PREFIX'] . '_blog', |
|
| 68 | - $GLOBALS['MOD_DB_PREFIX'] . '_blogcat', |
|
| 69 | - $GLOBALS['MOD_DB_PREFIX'] . '_bookmark', |
|
| 70 | - $GLOBALS['MOD_DB_PREFIX'] . '_rate' |
|
| 65 | + $GLOBALS['MOD_DB_PREFIX'].'_category', |
|
| 66 | + $GLOBALS['MOD_DB_PREFIX'].'_article', |
|
| 67 | + $GLOBALS['MOD_DB_PREFIX'].'_blog', |
|
| 68 | + $GLOBALS['MOD_DB_PREFIX'].'_blogcat', |
|
| 69 | + $GLOBALS['MOD_DB_PREFIX'].'_bookmark', |
|
| 70 | + $GLOBALS['MOD_DB_PREFIX'].'_rate' |
|
| 71 | 71 | ]; |
| 72 | 72 | |
| 73 | 73 | // Admin things |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | /** |
| 94 | 94 | * Templates |
| 95 | 95 | */ |
| 96 | -$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'] . '_index.tpl', 'description' => '']; |
|
| 97 | -$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'] . '_article.tpl', 'description' => '']; |
|
| 98 | -$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'] . '_archive.tpl', 'description' => '']; |
|
| 99 | -$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'] . '_blogs.tpl', 'description' => '']; |
|
| 100 | -$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'] . '_search.tpl', 'description' => '']; |
|
| 96 | +$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'].'_index.tpl', 'description' => '']; |
|
| 97 | +$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'].'_article.tpl', 'description' => '']; |
|
| 98 | +$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'].'_archive.tpl', 'description' => '']; |
|
| 99 | +$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'].'_blogs.tpl', 'description' => '']; |
|
| 100 | +$modversion['templates'][] = ['file' => $GLOBALS['VAR_PREFIX'].'_search.tpl', 'description' => '']; |
|
| 101 | 101 | |
| 102 | 102 | //module css |
| 103 | 103 | $modversion['css'] = 'templates/style.css'; |
@@ -109,31 +109,31 @@ discard block |
||
| 109 | 109 | $modversion['blocks'][$i]['file'] = 'block.php'; |
| 110 | 110 | $modversion['blocks'][$i]['name'] = planet_constant('MI_ARTICLE'); |
| 111 | 111 | $modversion['blocks'][$i]['description'] = planet_constant('MI_ARTICLE_DESC'); |
| 112 | -$modversion['blocks'][$i]['show_func'] = $GLOBALS['VAR_PREFIX'] . '_article_show'; |
|
| 112 | +$modversion['blocks'][$i]['show_func'] = $GLOBALS['VAR_PREFIX'].'_article_show'; |
|
| 113 | 113 | $modversion['blocks'][$i]['options'] = 'time|10|0|0'; // type|MaxItems|TitleLength|SummaryLength |
| 114 | -$modversion['blocks'][$i]['edit_func'] = $GLOBALS['VAR_PREFIX'] . '_article_edit'; |
|
| 115 | -$modversion['blocks'][$i]['template'] = $GLOBALS['VAR_PREFIX'] . '_block_article.tpl'; |
|
| 114 | +$modversion['blocks'][$i]['edit_func'] = $GLOBALS['VAR_PREFIX'].'_article_edit'; |
|
| 115 | +$modversion['blocks'][$i]['template'] = $GLOBALS['VAR_PREFIX'].'_block_article.tpl'; |
|
| 116 | 116 | |
| 117 | 117 | ++$i; |
| 118 | 118 | $modversion['blocks'][$i]['file'] = 'block.php'; |
| 119 | 119 | $modversion['blocks'][$i]['name'] = planet_constant('MI_CATEGORY'); |
| 120 | 120 | $modversion['blocks'][$i]['description'] = planet_constant('MI_CATEGORY_DESC'); |
| 121 | -$modversion['blocks'][$i]['show_func'] = $GLOBALS['VAR_PREFIX'] . '_category_show'; |
|
| 122 | -$modversion['blocks'][$i]['template'] = $GLOBALS['VAR_PREFIX'] . '_block_category.tpl'; |
|
| 121 | +$modversion['blocks'][$i]['show_func'] = $GLOBALS['VAR_PREFIX'].'_category_show'; |
|
| 122 | +$modversion['blocks'][$i]['template'] = $GLOBALS['VAR_PREFIX'].'_block_category.tpl'; |
|
| 123 | 123 | |
| 124 | 124 | ++$i; |
| 125 | 125 | $modversion['blocks'][$i]['file'] = 'block.php'; |
| 126 | 126 | $modversion['blocks'][$i]['name'] = planet_constant('MI_BLOG'); |
| 127 | 127 | $modversion['blocks'][$i]['description'] = planet_constant('MI_BLOG_DESC'); |
| 128 | -$modversion['blocks'][$i]['show_func'] = $GLOBALS['VAR_PREFIX'] . '_blog_show'; |
|
| 128 | +$modversion['blocks'][$i]['show_func'] = $GLOBALS['VAR_PREFIX'].'_blog_show'; |
|
| 129 | 129 | $modversion['blocks'][$i]['options'] = 'feature|10|0|1'; // type|MaxItems|TitleLength|ShowDesc |
| 130 | -$modversion['blocks'][$i]['edit_func'] = $GLOBALS['VAR_PREFIX'] . '_blog_edit'; |
|
| 131 | -$modversion['blocks'][$i]['template'] = $GLOBALS['VAR_PREFIX'] . '_block_blog.tpl'; |
|
| 130 | +$modversion['blocks'][$i]['edit_func'] = $GLOBALS['VAR_PREFIX'].'_blog_edit'; |
|
| 131 | +$modversion['blocks'][$i]['template'] = $GLOBALS['VAR_PREFIX'].'_block_blog.tpl'; |
|
| 132 | 132 | |
| 133 | 133 | // Search |
| 134 | 134 | $modversion['hasSearch'] = 1; |
| 135 | 135 | $modversion['search']['file'] = 'include/search.inc.php'; |
| 136 | -$modversion['search']['func'] = $GLOBALS['VAR_PREFIX'] . '_search'; |
|
| 136 | +$modversion['search']['func'] = $GLOBALS['VAR_PREFIX'].'_search'; |
|
| 137 | 137 | |
| 138 | 138 | // Comments |
| 139 | 139 | $modversion['hasComments'] = 1; |
@@ -143,15 +143,15 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | // Comment callback functions |
| 145 | 145 | $modversion['comments']['callbackFile'] = 'include/comment.inc.php'; |
| 146 | -$modversion['comments']['callback']['approve'] = $GLOBALS['VAR_PREFIX'] . '_com_approve'; |
|
| 147 | -$modversion['comments']['callback']['update'] = $GLOBALS['VAR_PREFIX'] . '_com_update'; |
|
| 146 | +$modversion['comments']['callback']['approve'] = $GLOBALS['VAR_PREFIX'].'_com_approve'; |
|
| 147 | +$modversion['comments']['callback']['update'] = $GLOBALS['VAR_PREFIX'].'_com_update'; |
|
| 148 | 148 | |
| 149 | 149 | // Configs |
| 150 | 150 | // Config items |
| 151 | 151 | $modversion['config'][] = [ |
| 152 | 152 | 'name' => 'do_debug', |
| 153 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DODEBUG', |
|
| 154 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DODEBUG_DESC', |
|
| 153 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_DODEBUG', |
|
| 154 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_DODEBUG_DESC', |
|
| 155 | 155 | 'formtype' => 'yesno', |
| 156 | 156 | 'valuetype' => 'int', |
| 157 | 157 | 'default' => 1 |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | $modversion['config'][] = [ |
| 161 | 161 | 'name' => 'do_urw', |
| 162 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOURLREWRITE', |
|
| 163 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOURLREWRITE_DESC', |
|
| 162 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_DOURLREWRITE', |
|
| 163 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_DOURLREWRITE_DESC', |
|
| 164 | 164 | 'formtype' => 'yesno', |
| 165 | 165 | 'valuetype' => 'int', |
| 166 | 166 | 'default' => in_array(php_sapi_name(), ['apache', 'apache2handler']) |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $modversion['config'][] = [ |
| 170 | 170 | 'name' => 'theme_set', |
| 171 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_THEMESET', |
|
| 172 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_THEMESET_DESC', |
|
| 171 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_THEMESET', |
|
| 172 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_THEMESET_DESC', |
|
| 173 | 173 | 'formtype' => 'select', |
| 174 | 174 | 'valuetype' => 'text', |
| 175 | 175 | 'options' => [_NONE => '0'], |
@@ -178,23 +178,23 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | $modversion['config'][] = [ |
| 180 | 180 | 'name' => 'timeformat', |
| 181 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT', |
|
| 182 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT_DESC', |
|
| 181 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_TIMEFORMAT', |
|
| 182 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_TIMEFORMAT_DESC', |
|
| 183 | 183 | 'formtype' => 'select', |
| 184 | 184 | 'valuetype' => 'text', |
| 185 | 185 | 'options' => [ |
| 186 | 186 | _DATESTRING => 'l', |
| 187 | 187 | _MEDIUMDATESTRING => 'm', |
| 188 | 188 | _SHORTDATESTRING => 's', |
| 189 | - $GLOBALS['VAR_PREFIXU'] . '_MI_TIMEFORMAT_CUSTOM' => 'c' |
|
| 189 | + $GLOBALS['VAR_PREFIXU'].'_MI_TIMEFORMAT_CUSTOM' => 'c' |
|
| 190 | 190 | ], |
| 191 | 191 | 'default' => 'c' |
| 192 | 192 | ]; |
| 193 | 193 | |
| 194 | 194 | $modversion['config'][] = [ |
| 195 | 195 | 'name' => 'articles_perpage', |
| 196 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLESPERPAGE', |
|
| 197 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLESPERPAGE_DESC', |
|
| 196 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_ARTICLESPERPAGE', |
|
| 197 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_ARTICLESPERPAGE_DESC', |
|
| 198 | 198 | 'formtype' => 'textbox', |
| 199 | 199 | 'valuetype' => 'int', |
| 200 | 200 | 'default' => 10 |
@@ -202,8 +202,8 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | $modversion['config'][] = [ |
| 204 | 204 | 'name' => 'list_perpage', |
| 205 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_LISTPERPAGE', |
|
| 206 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_LISTPERPAGE_DESC', |
|
| 205 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_LISTPERPAGE', |
|
| 206 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_LISTPERPAGE_DESC', |
|
| 207 | 207 | 'formtype' => 'textbox', |
| 208 | 208 | 'valuetype' => 'int', |
| 209 | 209 | 'default' => 20 |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | $modversion['config'][] = [ |
| 213 | 213 | 'name' => 'blogs_perupdate', |
| 214 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_BLOGSPERUPDATE', |
|
| 215 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_BLOGSPERUPDATE_DESC', |
|
| 214 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_BLOGSPERUPDATE', |
|
| 215 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_BLOGSPERUPDATE_DESC', |
|
| 216 | 216 | 'formtype' => 'textbox', |
| 217 | 217 | 'valuetype' => 'int', |
| 218 | 218 | 'default' => 10 |
@@ -220,8 +220,8 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | $modversion['config'][] = [ |
| 222 | 222 | 'name' => 'article_expire', |
| 223 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLE_EXPIRE', |
|
| 224 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ARTICLE_EXPIRE_DESC', |
|
| 223 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_ARTICLE_EXPIRE', |
|
| 224 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_ARTICLE_EXPIRE_DESC', |
|
| 225 | 225 | 'formtype' => 'textbox', |
| 226 | 226 | 'valuetype' => 'int', |
| 227 | 227 | 'default' => 30 |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | $modversion['config'][] = [ |
| 231 | 231 | 'name' => 'display_summary', |
| 232 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DISPLAY_SUMMARY', |
|
| 233 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DISPLAY_SUMMARY_DESC', |
|
| 232 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_DISPLAY_SUMMARY', |
|
| 233 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_DISPLAY_SUMMARY_DESC', |
|
| 234 | 234 | 'formtype' => 'textbox', |
| 235 | 235 | 'valuetype' => 'int', |
| 236 | 236 | 'default' => 0 |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | $modversion['config'][] = [ |
| 240 | 240 | 'name' => 'do_sibling', |
| 241 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOSIBLING', |
|
| 242 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_DOSIBLING_DESC', |
|
| 241 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_DOSIBLING', |
|
| 242 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_DOSIBLING_DESC', |
|
| 243 | 243 | 'formtype' => 'yesno', |
| 244 | 244 | 'valuetype' => 'int', |
| 245 | 245 | 'default' => 1 |
@@ -247,8 +247,8 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | $modversion['config'][] = [ |
| 249 | 249 | 'name' => 'pings', |
| 250 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_PING', |
|
| 251 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_PING_DESC', |
|
| 250 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_PING', |
|
| 251 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_PING_DESC', |
|
| 252 | 252 | 'formtype' => 'textarea', |
| 253 | 253 | 'valuetype' => 'text', |
| 254 | 254 | 'default' => '' |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | $modversion['config'][] = [ |
| 258 | 258 | 'name' => 'trackback_option', |
| 259 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_TRACKBACK_OPTION', |
|
| 260 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_TRACKBACK_OPTION_DESC', |
|
| 259 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_TRACKBACK_OPTION', |
|
| 260 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_TRACKBACK_OPTION_DESC', |
|
| 261 | 261 | 'formtype' => 'select', |
| 262 | 262 | 'valuetype' => 'int', |
| 263 | 263 | 'default' => 0, |
@@ -266,17 +266,17 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | $modversion['config'][] = [ |
| 268 | 268 | 'name' => 'copyright', |
| 269 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_COPYRIGHT', |
|
| 270 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_COPYRIGHT_DESC', |
|
| 269 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_COPYRIGHT', |
|
| 270 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_COPYRIGHT_DESC', |
|
| 271 | 271 | 'formtype' => 'textbox', |
| 272 | 272 | 'valuetype' => 'text', |
| 273 | - 'default' => 'Copyright© %s & ' . $xoopsConfig['sitename'] |
|
| 273 | + 'default' => 'Copyright© %s & '.$xoopsConfig['sitename'] |
|
| 274 | 274 | ]; |
| 275 | 275 | |
| 276 | 276 | $modversion['config'][] = [ |
| 277 | 277 | 'name' => 'newblog_submit', |
| 278 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_NEWBLOG_SUBMIT', |
|
| 279 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_NEWBLOG_SUBMIT_DESC', |
|
| 278 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_NEWBLOG_SUBMIT', |
|
| 279 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_NEWBLOG_SUBMIT_DESC', |
|
| 280 | 280 | 'formtype' => 'select', |
| 281 | 281 | 'valuetype' => 'int', |
| 282 | 282 | 'default' => 2, |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | |
| 292 | 292 | $modversion['config'][] = [ |
| 293 | 293 | 'name' => 'anonymous_rate', |
| 294 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_ANONYMOUSRATE', |
|
| 295 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_ANONYMOUSRATE_DESC', |
|
| 294 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_ANONYMOUSRATE', |
|
| 295 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_ANONYMOUSRATE_DESC', |
|
| 296 | 296 | 'formtype' => 'yesno', |
| 297 | 297 | 'valuetype' => 'int', |
| 298 | 298 | 'default' => 0 |
@@ -300,8 +300,8 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | $modversion['config'][] = [ |
| 302 | 302 | 'name' => 'do_pseudocron', |
| 303 | - 'title' => $GLOBALS['VAR_PREFIXU'] . '_MI_PSEUDOCRON', |
|
| 304 | - 'description' => $GLOBALS['VAR_PREFIXU'] . '_MI_PSEUDOCRON_DESC', |
|
| 303 | + 'title' => $GLOBALS['VAR_PREFIXU'].'_MI_PSEUDOCRON', |
|
| 304 | + 'description' => $GLOBALS['VAR_PREFIXU'].'_MI_PSEUDOCRON_DESC', |
|
| 305 | 305 | 'formtype' => 'yesno', |
| 306 | 306 | 'valuetype' => 'int', |
| 307 | 307 | 'default' => 1 |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | $modversion['hasNotification'] = 1; |
| 313 | 313 | $modversion['notification']['lookup_file'] = 'include/notification.inc.php'; |
| 314 | -$modversion['notification']['lookup_func'] = $GLOBALS['VAR_PREFIX'] . '_notify_iteminfo'; |
|
| 314 | +$modversion['notification']['lookup_func'] = $GLOBALS['VAR_PREFIX'].'_notify_iteminfo'; |
|
| 315 | 315 | |
| 316 | 316 | $i = 0; |
| 317 | 317 | ++$i; |
@@ -20,12 +20,12 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | 22 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 23 | -require_once __DIR__ . '/common.php'; |
|
| 23 | +require_once __DIR__.'/common.php'; |
|
| 24 | 24 | |
| 25 | 25 | $moduleDirName = basename(dirname(__DIR__)); |
| 26 | 26 | $uploadFolders = [ |
| 27 | 27 | NEWBB_UPLOAD_PATH, |
| 28 | - NEWBB_UPLOAD_PATH . '/thumbs' |
|
| 28 | + NEWBB_UPLOAD_PATH.'/thumbs' |
|
| 29 | 29 | ]; |
| 30 | 30 | |
| 31 | 31 | //$copyFiles = array( |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | if (isset($GLOBALS['xoopsModuleConfig'])) { |
| 81 | 81 | $moduleConfig = $GLOBALS['xoopsModuleConfig']; |
| 82 | 82 | } |
| 83 | - } else { |
|
| 83 | + }else { |
|
| 84 | 84 | /** @var XoopsModuleHandler $moduleHandler */ |
| 85 | 85 | $moduleHandler = xoops_getHandler('module'); |
| 86 | 86 | $module = $moduleHandler->getByDirname($GLOBALS['moddirname']); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | unset($configs); |
| 95 | 95 | } |
| 96 | - if ($customConfig = @include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/plugin.php') { |
|
| 96 | + if ($customConfig = @include XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/plugin.php') { |
|
| 97 | 97 | $moduleConfig = array_merge($moduleConfig, $customConfig); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -106,11 +106,11 @@ discard block |
||
| 106 | 106 | if (!in_array(URL_DELIMITER, ['?', '/'])) { |
| 107 | 107 | die('Exit on security'); |
| 108 | 108 | } |
| 109 | - } else { |
|
| 109 | + }else { |
|
| 110 | 110 | $moduleConfig = planet_load_config(); |
| 111 | 111 | if (empty($moduleConfig['do_urw'])) { |
| 112 | 112 | define('URL_DELIMITER', '?'); |
| 113 | - } else { |
|
| 113 | + }else { |
|
| 114 | 114 | define('URL_DELIMITER', '/'); |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | if (!defined('planet_FUNCTIONS')): |
| 39 | 39 | define('planet_FUNCTIONS', 1); |
| 40 | 40 | |
| 41 | - require XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/vars.php'; |
|
| 42 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
| 43 | - require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.php'; |
|
| 41 | + require XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/vars.php'; |
|
| 42 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
| 43 | + require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.php'; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Function to display messages |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | function planetParseArguments(&$args_numeric, &$args, &$args_string) |
| 71 | 71 | { |
| 72 | - $args_abb = [ |
|
| 72 | + $args_abb = [ |
|
| 73 | 73 | 'a' => 'article', |
| 74 | 74 | 'b' => 'blog', |
| 75 | 75 | 'c' => 'category', |
@@ -84,24 +84,24 @@ discard block |
||
| 84 | 84 | if (preg_match("/[^\?]*\.php[\/|\?]([^\?]*)/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) { |
| 85 | 85 | $vars = preg_split("/[\/|&]/", $matches[1]); |
| 86 | 86 | $vars = array_map('trim', $vars); |
| 87 | - if (count($vars) > 0) { |
|
| 87 | + if (count($vars)>0) { |
|
| 88 | 88 | foreach ($vars as $var) { |
| 89 | 89 | if (is_numeric($var)) { |
| 90 | 90 | $args_numeric[] = $var; |
| 91 | 91 | } elseif (false === strpos($var, '=')) { |
| 92 | 92 | if (is_numeric(substr($var, 1))) { |
| 93 | - $args[$args_abb[strtolower($var{0})]] = (int)substr($var, 1); |
|
| 94 | - } else { |
|
| 93 | + $args[$args_abb[strtolower($var{0})]] = (int) substr($var, 1); |
|
| 94 | + }else { |
|
| 95 | 95 | $args_string[] = urldecode($var); |
| 96 | 96 | } |
| 97 | - } else { |
|
| 97 | + }else { |
|
| 98 | 98 | parse_str($var, $args); |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - return (count($args) + count($args_numeric) + count($args_string) == 0) ? null : true; |
|
| 104 | + return (count($args)+count($args_numeric)+count($args_string) == 0) ? null : true; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $pattern = [$pattern]; |
| 125 | 125 | $replacement = [$replacement]; |
| 126 | 126 | } |
| 127 | - if (is_array($pattern) && count($pattern) > 0) { |
|
| 127 | + if (is_array($pattern) && count($pattern)>0) { |
|
| 128 | 128 | $ii = 0; |
| 129 | 129 | foreach ($pattern as $pat) { |
| 130 | 130 | if (!in_array($pat, $patterns)) { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $pattern = [$pattern]; |
| 161 | 161 | $replacement = [$replacement]; |
| 162 | 162 | } |
| 163 | - if (is_array($pattern) && count($pattern) > 0) { |
|
| 163 | + if (is_array($pattern) && count($pattern)>0) { |
|
| 164 | 164 | $ii = 0; |
| 165 | 165 | foreach ($pattern as $pat) { |
| 166 | 166 | if (!in_array($pat, $patterns)) { |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | if (!is_array($userid)) { |
| 204 | 204 | $userid = [$userid]; |
| 205 | 205 | } |
| 206 | - $users =& mod_getUnameFromIds($userid, $usereal, $linked); |
|
| 206 | + $users = & mod_getUnameFromIds($userid, $usereal, $linked); |
|
| 207 | 207 | |
| 208 | 208 | return $users; |
| 209 | 209 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $myts = MyTextSanitizer::getInstance(); |
| 221 | 221 | $link_array = preg_split("/(\r\n|\r|\n)( *)/", $text); |
| 222 | 222 | $links = []; |
| 223 | - if (count($link_array) > 0) { |
|
| 223 | + if (count($link_array)>0) { |
|
| 224 | 224 | foreach ($link_array as $link) { |
| 225 | 225 | @list($url, $title) = array_map('trim', preg_split('/ /', $link, 2)); |
| 226 | 226 | if (empty($url)) { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | function planetGetTemplate($pagename) |
| 242 | 242 | { |
| 243 | - return $GLOBALS['VAR_PREFIX'] . '_' . $pagename . '.tpl'; |
|
| 243 | + return $GLOBALS['VAR_PREFIX'].'_'.$pagename.'.tpl'; |
|
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | return false; |
| 269 | 269 | } |
| 270 | 270 | @list($pat, $rep) = array_map('trim', preg_split("#[\s]+#", $pattern)); |
| 271 | - $trackback_url = preg_replace('#' . $pat . '#', $rep, $article_obj->getVar('art_link')); |
|
| 271 | + $trackback_url = preg_replace('#'.$pat.'#', $rep, $article_obj->getVar('art_link')); |
|
| 272 | 272 | |
| 273 | 273 | return planetTrackback($trackback_url, $article); |
| 274 | 274 | } |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | $title = $article->getVar('art_title'); |
| 286 | 286 | $excerpt = $article->getVar('art_content'); |
| 287 | - $blog_name = $xoopsConfig['sitename'] . '-' . $xoopsModule->getVar('name'); |
|
| 287 | + $blog_name = $xoopsConfig['sitename'].'-'.$xoopsModule->getVar('name'); |
|
| 288 | 288 | $title = xoops_utf8_encode($title); |
| 289 | 289 | $excerpt = xoops_utf8_encode($excerpt); |
| 290 | 290 | $blog_name = xoops_utf8_encode($blog_name); |
@@ -292,15 +292,15 @@ discard block |
||
| 292 | 292 | $title1 = urlencode($title); |
| 293 | 293 | $excerpt1 = urlencode($excerpt); |
| 294 | 294 | $name1 = urlencode($blog_name); |
| 295 | - $url = urlencode(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article->getVar('art_id')); |
|
| 295 | + $url = urlencode(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article->getVar('art_id')); |
|
| 296 | 296 | $query_string = "title=$title1&url=$url&blog_name=$name1&excerpt=$excerpt1&charset=$charset"; |
| 297 | 297 | $trackback_url = parse_url($trackback_url); |
| 298 | 298 | |
| 299 | - $http_request = 'POST ' . $trackback_url['path'] . ($trackback_url['query'] ? '?' . $trackback_url['query'] : '') . " HTTP/1.0\r\n"; |
|
| 300 | - $http_request .= 'Host: ' . $trackback_url['host'] . "\r\n"; |
|
| 301 | - $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . $charset . "\r\n"; |
|
| 302 | - $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n"; |
|
| 303 | - $http_request .= 'User-Agent: XOOPS Blogs/' . XOOPS_VERSION; |
|
| 299 | + $http_request = 'POST '.$trackback_url['path'].($trackback_url['query'] ? '?'.$trackback_url['query'] : '')." HTTP/1.0\r\n"; |
|
| 300 | + $http_request .= 'Host: '.$trackback_url['host']."\r\n"; |
|
| 301 | + $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.$charset."\r\n"; |
|
| 302 | + $http_request .= 'Content-Length: '.strlen($query_string)."\r\n"; |
|
| 303 | + $http_request .= 'User-Agent: XOOPS Blogs/'.XOOPS_VERSION; |
|
| 304 | 304 | $http_request .= "\r\n\r\n"; |
| 305 | 305 | $http_request .= $query_string; |
| 306 | 306 | if ('' == $trackback_url['port']) { |
@@ -309,11 +309,11 @@ discard block |
||
| 309 | 309 | $fs = @fsockopen($trackback_url['host'], $trackback_url['port'], $errno, $errstr, 4); |
| 310 | 310 | @fwrite($fs, $http_request); |
| 311 | 311 | if ($xoopsModuleConfig['do_debug']) { |
| 312 | - $debug_file = XOOPS_CACHE_PATH . '/' . $GLOBALS['moddirname'] . '_trackback.log'; |
|
| 312 | + $debug_file = XOOPS_CACHE_PATH.'/'.$GLOBALS['moddirname'].'_trackback.log'; |
|
| 313 | 313 | $fr = "\n*****\nRequest:\n\n$http_request\n\nResponse:\n\n"; |
| 314 | 314 | $fr .= "CHARSET:$charset\n"; |
| 315 | 315 | $fr .= "NAME:$blog_name\n"; |
| 316 | - $fr .= 'TITLE:' . $title . "\n"; |
|
| 316 | + $fr .= 'TITLE:'.$title."\n"; |
|
| 317 | 317 | $fr .= "EXCERPT:$excerpt\n\n"; |
| 318 | 318 | while (!@feof($fs)) { |
| 319 | 319 | $fr .= @fgets($fs, 4096); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | if ($fp = fopen($debug_file, 'a')) { |
| 324 | 324 | fwrite($fp, $fr); |
| 325 | 325 | fclose($fp); |
| 326 | - } else { |
|
| 326 | + }else { |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | @fclose($fs); |
@@ -343,19 +343,19 @@ discard block |
||
| 343 | 343 | planetGetPing($serv, $id); |
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | - require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php'; |
|
| 346 | + require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/class-IXR.php'; |
|
| 347 | 347 | |
| 348 | 348 | // using a timeout of 3 seconds should be enough to cover slow servers |
| 349 | 349 | $client = new IXR_Client($server, false); |
| 350 | 350 | $client->timeout = 3; |
| 351 | - $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION; |
|
| 351 | + $client->useragent .= ' -- XOOPS Article/'.XOOPS_VERSION; |
|
| 352 | 352 | |
| 353 | 353 | // when set to true, this outputs debug messages by itself |
| 354 | 354 | $client->debug = false; |
| 355 | 355 | |
| 356 | 356 | $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name')); |
| 357 | - $home = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/'; |
|
| 358 | - $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id; |
|
| 357 | + $home = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/'; |
|
| 358 | + $rss2_url = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/xml.php'.URL_DELIMITER.'rss2.0/'.$id; |
|
| 359 | 359 | |
| 360 | 360 | if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping |
| 361 | 361 | $client->query('weblogUpdates.ping', $blogname, $home); |
@@ -371,16 +371,16 @@ discard block |
||
| 371 | 371 | { |
| 372 | 372 | $charset = 'utf-8'; |
| 373 | 373 | $error_message = xoops_utf8_encode($error_message); |
| 374 | - header('Content-Type: text/xml; charset="' . $charset . '"'); |
|
| 374 | + header('Content-Type: text/xml; charset="'.$charset.'"'); |
|
| 375 | 375 | if ($error) { |
| 376 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 376 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
| 377 | 377 | echo "<response>\n"; |
| 378 | 378 | echo "<error>1</error>\n"; |
| 379 | 379 | echo "<message>$error_message</message>\n"; |
| 380 | 380 | echo '</response>'; |
| 381 | 381 | die(); |
| 382 | - } else { |
|
| 383 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
| 382 | + }else { |
|
| 383 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
| 384 | 384 | echo "<response>\n"; |
| 385 | 385 | echo "<error>0</error>\n"; |
| 386 | 386 | echo '</response>'; |
@@ -400,11 +400,11 @@ discard block |
||
| 400 | 400 | if (is_array($string)) { |
| 401 | 401 | $value = []; |
| 402 | 402 | foreach ($string as $key => $val) { |
| 403 | - $value[] = $key . '|' . $val; |
|
| 403 | + $value[] = $key.'|'.$val; |
|
| 404 | 404 | } |
| 405 | 405 | $string = implode(',', $value); |
| 406 | 406 | } |
| 407 | - setcookie($GLOBALS['VAR_PREFIX'] . $name, $string, (int)$expire, '/'); |
|
| 407 | + setcookie($GLOBALS['VAR_PREFIX'].$name, $string, (int) $expire, '/'); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | /** |
@@ -414,14 +414,14 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | function planetGetCookie($name, $isArray = false) |
| 416 | 416 | { |
| 417 | - $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'] . $name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'] . $name] : null; |
|
| 417 | + $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'].$name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'].$name] : null; |
|
| 418 | 418 | if ($isArray) { |
| 419 | 419 | $_value = $value ? explode(',', $value) : []; |
| 420 | 420 | $value = []; |
| 421 | - if (count($_value) > 0) { |
|
| 421 | + if (count($_value)>0) { |
|
| 422 | 422 | foreach ($_value as $string) { |
| 423 | 423 | $key = substr($string, 0, strpos($string, '|')); |
| 424 | - $val = substr($string, strpos($string, '|') + 1); |
|
| 424 | + $val = substr($string, strpos($string, '|')+1); |
|
| 425 | 425 | $value[$key] = $val; |
| 426 | 426 | } |
| 427 | 427 | } |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | */ |
| 480 | 480 | function planet_fetch_snoopy($url) |
| 481 | 481 | { |
| 482 | - require_once XOOPS_ROOT_PATH . '/class/snoopy.php'; |
|
| 482 | + require_once XOOPS_ROOT_PATH.'/class/snoopy.php'; |
|
| 483 | 483 | $snoopy = new Snoopy; |
| 484 | 484 | $data = ''; |
| 485 | 485 | if (@$snoopy->fetch($url)) { |
@@ -498,10 +498,10 @@ discard block |
||
| 498 | 498 | if (!function_exists('curl_init')) { |
| 499 | 499 | return false; |
| 500 | 500 | } |
| 501 | - $ch = curl_init(); // initialize curl handle |
|
| 501 | + $ch = curl_init(); // initialize curl handle |
|
| 502 | 502 | curl_setopt($ch, CURLOPT_URL, $url); // set url to post to |
| 503 | 503 | curl_setopt($ch, CURLOPT_FAILONERROR, 1); |
| 504 | - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects |
|
| 504 | + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects |
|
| 505 | 505 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable |
| 506 | 506 | curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s |
| 507 | 507 | $data = curl_exec($ch); // run the whole process |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | if ($index === false) { |
| 544 | 544 | return false; |
| 545 | 545 | } |
| 546 | - $index = strlen($haystack) - strlen($needle) - $index; |
|
| 546 | + $index = strlen($haystack)-strlen($needle)-$index; |
|
| 547 | 547 | |
| 548 | 548 | return $index; |
| 549 | 549 | } |
@@ -22,19 +22,19 @@ |
||
| 22 | 22 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 23 | 23 | |
| 24 | 24 | define('NEWBB_DIRNAME', basename(dirname(__DIR__))); |
| 25 | -define('NEWBB_URL', XOOPS_URL . '/modules/' . NEWBB_DIRNAME); |
|
| 26 | -define('NEWBB_PATH', XOOPS_ROOT_PATH . '/modules/' . NEWBB_DIRNAME); |
|
| 27 | -define('NEWBB_IMAGES_URL', NEWBB_URL . '/assets/images'); |
|
| 28 | -define('NEWBB_ADMIN_URL', NEWBB_URL . '/admin'); |
|
| 29 | -define('NEWBB_ADMIN_PATH', NEWBB_PATH . '/admin/index.php'); |
|
| 30 | -define('NEWBB_ROOT_PATH', $GLOBALS['xoops']->path('modules/' . NEWBB_DIRNAME)); |
|
| 31 | -define('NEWBB_AUTHOR_LOGOIMG', NEWBB_URL . '/assets/images/logo_module.png'); |
|
| 32 | -define('NEWBB_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash |
|
| 33 | -define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash |
|
| 25 | +define('NEWBB_URL', XOOPS_URL.'/modules/'.NEWBB_DIRNAME); |
|
| 26 | +define('NEWBB_PATH', XOOPS_ROOT_PATH.'/modules/'.NEWBB_DIRNAME); |
|
| 27 | +define('NEWBB_IMAGES_URL', NEWBB_URL.'/assets/images'); |
|
| 28 | +define('NEWBB_ADMIN_URL', NEWBB_URL.'/admin'); |
|
| 29 | +define('NEWBB_ADMIN_PATH', NEWBB_PATH.'/admin/index.php'); |
|
| 30 | +define('NEWBB_ROOT_PATH', $GLOBALS['xoops']->path('modules/'.NEWBB_DIRNAME)); |
|
| 31 | +define('NEWBB_AUTHOR_LOGOIMG', NEWBB_URL.'/assets/images/logo_module.png'); |
|
| 32 | +define('NEWBB_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.NEWBB_DIRNAME); // WITHOUT Trailing slash |
|
| 33 | +define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.NEWBB_DIRNAME); // WITHOUT Trailing slash |
|
| 34 | 34 | |
| 35 | 35 | // module information |
| 36 | 36 | $mod_copyright = "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
| 37 | - <img src='" . NEWBB_AUTHOR_LOGOIMG . "' alt='XOOPS Project'></a>"; |
|
| 37 | + <img src='" . NEWBB_AUTHOR_LOGOIMG."' alt='XOOPS Project'></a>"; |
|
| 38 | 38 | |
| 39 | 39 | xoops_loadLanguage('common', NEWBB_DIRNAME); |
| 40 | 40 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | 27 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 28 | 28 | |
| 29 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 29 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 30 | 30 | $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
| 31 | 31 | |
| 32 | 32 | $form = new XoopsThemeForm(_EDIT, 'formblog', xoops_getenv('PHP_SELF'), 'POST', true); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
| 77 | 77 | $button_tray->addElement($butt_save); |
| 78 | 78 | $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
| 79 | -$butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . (int)$blog_id . "\"'"); |
|
| 79 | +$butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.(int) $blog_id."\"'"); |
|
| 80 | 80 | $button_tray->addElement($butt_cancel); |
| 81 | 81 | $form->addElement($button_tray); |
| 82 | 82 | $form->display(); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 16 | 16 | |
| 17 | -if (!@require_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
|
| 17 | +if (!@require_once XOOPS_ROOT_PATH.'/Frameworks/transfer/transfer.php') { |
|
| 18 | 18 | return null; |
| 19 | 19 | } |
| 20 | 20 | |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 29 | 29 | |
| 30 | -include __DIR__ . '/vars.php'; |
|
| 30 | +include __DIR__.'/vars.php'; |
|
| 31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
| 32 | 32 | |
| 33 | 33 | PlanetUtility::planetParseFunction(' |