@@ -26,21 +26,21 @@ discard block |
||
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | 27 | use Xmf\Request; |
| 28 | 28 | |
| 29 | -include __DIR__ . '/header.php'; |
|
| 29 | +include __DIR__.'/header.php'; |
|
| 30 | 30 | |
| 31 | 31 | // trackback is done by a POST |
| 32 | 32 | $art_id = explode('/', Request::getString('REQUEST_URI', '', 'SERVER')); |
| 33 | -$article_id = (int)$art_id[count($art_id) - 1]; |
|
| 34 | -$url = Request::getString('url', '', 'POST');//$_POST['url']; |
|
| 35 | -$title = Request::getString('title', '', 'POST');//$_POST['title']; |
|
| 36 | -$excerpt = Request::getString('excerpt', '', 'POST');//$_POST['excerpt']; |
|
| 37 | -$blog_name = Request::getString('blog_name', '', 'POST');//$_POST['blog_name']; |
|
| 38 | -$charset = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']); |
|
| 33 | +$article_id = (int) $art_id[count($art_id)-1]; |
|
| 34 | +$url = Request::getString('url', '', 'POST'); //$_POST['url']; |
|
| 35 | +$title = Request::getString('title', '', 'POST'); //$_POST['title']; |
|
| 36 | +$excerpt = Request::getString('excerpt', '', 'POST'); //$_POST['excerpt']; |
|
| 37 | +$blog_name = Request::getString('blog_name', '', 'POST'); //$_POST['blog_name']; |
|
| 38 | +$charset = trim(Request::getString('charset', '', 'POST')); //trim($_POST['charset']); |
|
| 39 | 39 | |
| 40 | 40 | if (empty($xoopsModuleConfig['trackback_option'])) { |
| 41 | 41 | PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
| 42 | 42 | } |
| 43 | -if (!strlen($title . $url . $blog_name)) { |
|
| 43 | +if (!strlen($title.$url.$blog_name)) { |
|
| 44 | 44 | PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
| 49 | 49 | $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
| 50 | 50 | $criteria->add(new Criteria('tb_url', $url)); |
| 51 | - if ($trackbackHandler->getCount($criteria) > 0) { |
|
| 51 | + if ($trackbackHandler->getCount($criteria)>0) { |
|
| 52 | 52 | PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -56,17 +56,17 @@ discard block |
||
| 56 | 56 | $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
| 57 | 57 | $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
| 58 | 58 | $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
| 59 | - $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
| 59 | + $tb_status = (int) $xoopsModuleConfig['trackback_option']; |
|
| 60 | 60 | |
| 61 | 61 | $com_pid = 0; |
| 62 | 62 | $com_itemid = $article_id; |
| 63 | 63 | $com_rootid = 0; |
| 64 | 64 | $com_title = $title; |
| 65 | 65 | $com_text = $excerpt; |
| 66 | - $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
| 66 | + $com_text .= "\n\n[TRACKBACK]"._POSTEDBY.': '; |
|
| 67 | 67 | if (!empty($url)) { |
| 68 | - $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
| 69 | - } else { |
|
| 68 | + $com_text .= '[url='.$url.']'.$blog_name.'[/url]'; |
|
| 69 | + }else { |
|
| 70 | 70 | $com_text .= $blog_name; |
| 71 | 71 | } |
| 72 | 72 | $com_modid = $xoopsModule->getVar('mid'); |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | if (isset($comment_config['callbackFile'])) { |
| 123 | 123 | $callbackfile = trim($comment_config['callbackFile']); |
| 124 | 124 | if ($callbackfile != '' |
| 125 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 126 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 125 | + && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) { |
|
| 126 | + require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile; |
|
| 127 | 127 | } |
| 128 | 128 | if (!function_exists($comment_config['callback']['approve'])) { |
| 129 | 129 | $skip = true; |
| 130 | 130 | } |
| 131 | - } else { |
|
| 131 | + }else { |
|
| 132 | 132 | $skip = true; |
| 133 | 133 | } |
| 134 | 134 | } |
@@ -145,13 +145,13 @@ discard block |
||
| 145 | 145 | if (isset($comment_config['callbackFile'])) { |
| 146 | 146 | $callbackfile = trim($comment_config['callbackFile']); |
| 147 | 147 | if ($callbackfile != '' |
| 148 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 149 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 148 | + && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) { |
|
| 149 | + require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile; |
|
| 150 | 150 | } |
| 151 | 151 | if (!function_exists($comment_config['callback']['update'])) { |
| 152 | 152 | $skip = true; |
| 153 | 153 | } |
| 154 | - } else { |
|
| 154 | + }else { |
|
| 155 | 155 | $skip = true; |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -181,16 +181,16 @@ discard block |
||
| 181 | 181 | $not_module = $xoopsModule; |
| 182 | 182 | if (!isset($comment_url)) { |
| 183 | 183 | $com_config = $not_module->getInfo('comments'); |
| 184 | - $comment_url = $com_config['pageName'] . '?'; |
|
| 184 | + $comment_url = $com_config['pageName'].'?'; |
|
| 185 | 185 | $comment_url .= $com_config['itemName']; |
| 186 | 186 | } |
| 187 | - $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
| 187 | + $comment_tags['X_COMMENT_URL'] = XOOPS_URL.'/modules/'.$not_module->getVar('dirname').'/'.$comment_url.'='.$com_itemid.'&com_id='.$newcid.'&com_rootid='.$com_rootid.'&com_mode='.$com_mode.'&com_order='.$com_order.'#comment'.$newcid; |
|
| 188 | 188 | $notificationHandler = xoops_getHandler('notification'); |
| 189 | 189 | $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | PlanetUtility::planetRespondToTrackback(0); |
| 193 | - } else { |
|
| 193 | + }else { |
|
| 194 | 194 | PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
| 195 | 195 | } |
| 196 | 196 | } |
@@ -38,159 +38,159 @@ |
||
| 38 | 38 | $charset = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']); |
| 39 | 39 | |
| 40 | 40 | if (empty($xoopsModuleConfig['trackback_option'])) { |
| 41 | - PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
|
| 41 | + PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed'); |
|
| 42 | 42 | } |
| 43 | 43 | if (!strlen($title . $url . $blog_name)) { |
| 44 | - PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
|
| 44 | + PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | if (!empty($article_id) && !empty($url)) { |
| 48 | - $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
|
| 49 | - $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
| 50 | - $criteria->add(new Criteria('tb_url', $url)); |
|
| 51 | - if ($trackbackHandler->getCount($criteria) > 0) { |
|
| 52 | - PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
|
| 53 | - } |
|
| 48 | + $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']); |
|
| 49 | + $criteria = new CriteriaCompo(new Criteria('art_id', $article_id)); |
|
| 50 | + $criteria->add(new Criteria('tb_url', $url)); |
|
| 51 | + if ($trackbackHandler->getCount($criteria) > 0) { |
|
| 52 | + PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.'); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - $charset = empty($charset) ? 'utf-8' : $charset; |
|
| 56 | - $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
|
| 57 | - $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
|
| 58 | - $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
|
| 59 | - $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
| 55 | + $charset = empty($charset) ? 'utf-8' : $charset; |
|
| 56 | + $title = XoopsLocal::convert_encoding($title, _CHARSET, $charset); |
|
| 57 | + $excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset); |
|
| 58 | + $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset); |
|
| 59 | + $tb_status = (int)$xoopsModuleConfig['trackback_option']; |
|
| 60 | 60 | |
| 61 | - $com_pid = 0; |
|
| 62 | - $com_itemid = $article_id; |
|
| 63 | - $com_rootid = 0; |
|
| 64 | - $com_title = $title; |
|
| 65 | - $com_text = $excerpt; |
|
| 66 | - $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
| 67 | - if (!empty($url)) { |
|
| 68 | - $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
| 69 | - } else { |
|
| 70 | - $com_text .= $blog_name; |
|
| 71 | - } |
|
| 72 | - $com_modid = $xoopsModule->getVar('mid'); |
|
| 61 | + $com_pid = 0; |
|
| 62 | + $com_itemid = $article_id; |
|
| 63 | + $com_rootid = 0; |
|
| 64 | + $com_title = $title; |
|
| 65 | + $com_text = $excerpt; |
|
| 66 | + $com_text .= "\n\n[TRACKBACK]" . _POSTEDBY . ': '; |
|
| 67 | + if (!empty($url)) { |
|
| 68 | + $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]'; |
|
| 69 | + } else { |
|
| 70 | + $com_text .= $blog_name; |
|
| 71 | + } |
|
| 72 | + $com_modid = $xoopsModule->getVar('mid'); |
|
| 73 | 73 | |
| 74 | - $commentHandler = xoops_getHandler('comment'); |
|
| 75 | - $comment = $commentHandler->create(); |
|
| 76 | - $comment->setVar('com_created', time()); |
|
| 77 | - $comment->setVar('com_pid', $com_pid); |
|
| 78 | - $comment->setVar('com_itemid', $com_itemid); |
|
| 79 | - $comment->setVar('com_rootid', $com_rootid); |
|
| 80 | - $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR')); |
|
| 81 | - switch ($tb_status) { |
|
| 82 | - case 2: |
|
| 83 | - $comment->setVar('com_status', 2); |
|
| 84 | - $call_approvefunc = true; |
|
| 85 | - $call_updatefunc = true; |
|
| 86 | - $notify_event = 'comment'; |
|
| 87 | - break; |
|
| 88 | - case 1: |
|
| 89 | - default: |
|
| 90 | - $comment->setVar('com_status', 1); |
|
| 91 | - $notify_event = 'comment_submit'; |
|
| 92 | - break; |
|
| 93 | - } |
|
| 94 | - $comment->setVar('com_uid', 0); |
|
| 95 | - $com_title = xoops_trim($com_title); |
|
| 96 | - $com_title = empty($com_title) ? _NOTITLE : $com_title; |
|
| 97 | - $comment->setVar('com_title', $com_title); |
|
| 98 | - $comment->setVar('com_text', $com_text); |
|
| 99 | - $comment->setVar('dohtml', 0); |
|
| 100 | - $comment->setVar('dosmiley', 0); |
|
| 101 | - $comment->setVar('doxcode', 1); |
|
| 102 | - $comment->setVar('doimage', 0); |
|
| 103 | - $comment->setVar('dobr', 1); |
|
| 104 | - $comment->setVar('com_icon', ''); |
|
| 105 | - $comment->setVar('com_modified', time()); |
|
| 106 | - $comment->setVar('com_modid', $com_modid); |
|
| 107 | - if (false != $commentHandler->insert($comment)) { |
|
| 108 | - $newcid = $comment->getVar('com_id'); |
|
| 74 | + $commentHandler = xoops_getHandler('comment'); |
|
| 75 | + $comment = $commentHandler->create(); |
|
| 76 | + $comment->setVar('com_created', time()); |
|
| 77 | + $comment->setVar('com_pid', $com_pid); |
|
| 78 | + $comment->setVar('com_itemid', $com_itemid); |
|
| 79 | + $comment->setVar('com_rootid', $com_rootid); |
|
| 80 | + $comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR')); |
|
| 81 | + switch ($tb_status) { |
|
| 82 | + case 2: |
|
| 83 | + $comment->setVar('com_status', 2); |
|
| 84 | + $call_approvefunc = true; |
|
| 85 | + $call_updatefunc = true; |
|
| 86 | + $notify_event = 'comment'; |
|
| 87 | + break; |
|
| 88 | + case 1: |
|
| 89 | + default: |
|
| 90 | + $comment->setVar('com_status', 1); |
|
| 91 | + $notify_event = 'comment_submit'; |
|
| 92 | + break; |
|
| 93 | + } |
|
| 94 | + $comment->setVar('com_uid', 0); |
|
| 95 | + $com_title = xoops_trim($com_title); |
|
| 96 | + $com_title = empty($com_title) ? _NOTITLE : $com_title; |
|
| 97 | + $comment->setVar('com_title', $com_title); |
|
| 98 | + $comment->setVar('com_text', $com_text); |
|
| 99 | + $comment->setVar('dohtml', 0); |
|
| 100 | + $comment->setVar('dosmiley', 0); |
|
| 101 | + $comment->setVar('doxcode', 1); |
|
| 102 | + $comment->setVar('doimage', 0); |
|
| 103 | + $comment->setVar('dobr', 1); |
|
| 104 | + $comment->setVar('com_icon', ''); |
|
| 105 | + $comment->setVar('com_modified', time()); |
|
| 106 | + $comment->setVar('com_modid', $com_modid); |
|
| 107 | + if (false != $commentHandler->insert($comment)) { |
|
| 108 | + $newcid = $comment->getVar('com_id'); |
|
| 109 | 109 | |
| 110 | - // set own id as root id |
|
| 111 | - $com_rootid = $newcid; |
|
| 112 | - if (!$commentHandler->updateByField($comment, 'com_rootid', $com_rootid)) { |
|
| 113 | - $commentHandler->delete($comment); |
|
| 114 | - PlanetUtility::planetRespondToTrackback(1, xoops_error()); |
|
| 115 | - } |
|
| 110 | + // set own id as root id |
|
| 111 | + $com_rootid = $newcid; |
|
| 112 | + if (!$commentHandler->updateByField($comment, 'com_rootid', $com_rootid)) { |
|
| 113 | + $commentHandler->delete($comment); |
|
| 114 | + PlanetUtility::planetRespondToTrackback(1, xoops_error()); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - // call custom approve function if any |
|
| 118 | - if (false != $call_approvefunc && isset($comment_config['callback']['approve']) |
|
| 119 | - && trim($comment_config['callback']['approve']) != '') { |
|
| 120 | - $skip = false; |
|
| 121 | - if (!function_exists($comment_config['callback']['approve'])) { |
|
| 122 | - if (isset($comment_config['callbackFile'])) { |
|
| 123 | - $callbackfile = trim($comment_config['callbackFile']); |
|
| 124 | - if ($callbackfile != '' |
|
| 125 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 126 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 127 | - } |
|
| 128 | - if (!function_exists($comment_config['callback']['approve'])) { |
|
| 129 | - $skip = true; |
|
| 130 | - } |
|
| 131 | - } else { |
|
| 132 | - $skip = true; |
|
| 133 | - } |
|
| 134 | - } |
|
| 135 | - if (!$skip) { |
|
| 136 | - $comment_config['callback']['approve']($comment); |
|
| 137 | - } |
|
| 138 | - } |
|
| 117 | + // call custom approve function if any |
|
| 118 | + if (false != $call_approvefunc && isset($comment_config['callback']['approve']) |
|
| 119 | + && trim($comment_config['callback']['approve']) != '') { |
|
| 120 | + $skip = false; |
|
| 121 | + if (!function_exists($comment_config['callback']['approve'])) { |
|
| 122 | + if (isset($comment_config['callbackFile'])) { |
|
| 123 | + $callbackfile = trim($comment_config['callbackFile']); |
|
| 124 | + if ($callbackfile != '' |
|
| 125 | + && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 126 | + require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 127 | + } |
|
| 128 | + if (!function_exists($comment_config['callback']['approve'])) { |
|
| 129 | + $skip = true; |
|
| 130 | + } |
|
| 131 | + } else { |
|
| 132 | + $skip = true; |
|
| 133 | + } |
|
| 134 | + } |
|
| 135 | + if (!$skip) { |
|
| 136 | + $comment_config['callback']['approve']($comment); |
|
| 137 | + } |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - // call custom update function if any |
|
| 141 | - if (false != $call_updatefunc && isset($comment_config['callback']['update']) |
|
| 142 | - && trim($comment_config['callback']['update']) != '') { |
|
| 143 | - $skip = false; |
|
| 144 | - if (!function_exists($comment_config['callback']['update'])) { |
|
| 145 | - if (isset($comment_config['callbackFile'])) { |
|
| 146 | - $callbackfile = trim($comment_config['callbackFile']); |
|
| 147 | - if ($callbackfile != '' |
|
| 148 | - && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 149 | - require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 150 | - } |
|
| 151 | - if (!function_exists($comment_config['callback']['update'])) { |
|
| 152 | - $skip = true; |
|
| 153 | - } |
|
| 154 | - } else { |
|
| 155 | - $skip = true; |
|
| 156 | - } |
|
| 157 | - } |
|
| 158 | - if (!$skip) { |
|
| 159 | - $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid)); |
|
| 160 | - $criteria->add(new Criteria('com_itemid', $com_itemid)); |
|
| 161 | - $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE)); |
|
| 162 | - $comment_count = $commentHandler->getCount($criteria); |
|
| 163 | - $func = $comment_config['callback']['update']; |
|
| 164 | - call_user_func_array($func, [$com_itemid, $comment_count, $comment->getVar('com_id')]); |
|
| 165 | - } |
|
| 166 | - } |
|
| 140 | + // call custom update function if any |
|
| 141 | + if (false != $call_updatefunc && isset($comment_config['callback']['update']) |
|
| 142 | + && trim($comment_config['callback']['update']) != '') { |
|
| 143 | + $skip = false; |
|
| 144 | + if (!function_exists($comment_config['callback']['update'])) { |
|
| 145 | + if (isset($comment_config['callbackFile'])) { |
|
| 146 | + $callbackfile = trim($comment_config['callbackFile']); |
|
| 147 | + if ($callbackfile != '' |
|
| 148 | + && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) { |
|
| 149 | + require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile; |
|
| 150 | + } |
|
| 151 | + if (!function_exists($comment_config['callback']['update'])) { |
|
| 152 | + $skip = true; |
|
| 153 | + } |
|
| 154 | + } else { |
|
| 155 | + $skip = true; |
|
| 156 | + } |
|
| 157 | + } |
|
| 158 | + if (!$skip) { |
|
| 159 | + $criteria = new CriteriaCompo(new Criteria('com_modid', $com_modid)); |
|
| 160 | + $criteria->add(new Criteria('com_itemid', $com_itemid)); |
|
| 161 | + $criteria->add(new Criteria('com_status', XOOPS_COMMENT_ACTIVE)); |
|
| 162 | + $comment_count = $commentHandler->getCount($criteria); |
|
| 163 | + $func = $comment_config['callback']['update']; |
|
| 164 | + call_user_func_array($func, [$com_itemid, $comment_count, $comment->getVar('com_id')]); |
|
| 165 | + } |
|
| 166 | + } |
|
| 167 | 167 | |
| 168 | - // RMV-NOTIFY |
|
| 169 | - // trigger notification event if necessary |
|
| 170 | - if ($notify_event) { |
|
| 171 | - $not_modid = $com_modid; |
|
| 172 | - // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; |
|
| 173 | - $not_catinfo = notificationCommentCategoryInfo($not_modid); |
|
| 174 | - $not_category = $not_catinfo['name']; |
|
| 175 | - $not_itemid = $com_itemid; |
|
| 176 | - $not_event = $notify_event; |
|
| 177 | - // Build an ABSOLUTE URL to view the comment. Make sure we |
|
| 178 | - // point to a viewable page (i.e. not the system administration |
|
| 179 | - // module). |
|
| 180 | - $comment_tags = []; |
|
| 181 | - $not_module = $xoopsModule; |
|
| 182 | - if (!isset($comment_url)) { |
|
| 183 | - $com_config = $not_module->getInfo('comments'); |
|
| 184 | - $comment_url = $com_config['pageName'] . '?'; |
|
| 185 | - $comment_url .= $com_config['itemName']; |
|
| 186 | - } |
|
| 187 | - $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
| 188 | - $notificationHandler = xoops_getHandler('notification'); |
|
| 189 | - $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
|
| 190 | - } |
|
| 168 | + // RMV-NOTIFY |
|
| 169 | + // trigger notification event if necessary |
|
| 170 | + if ($notify_event) { |
|
| 171 | + $not_modid = $com_modid; |
|
| 172 | + // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; |
|
| 173 | + $not_catinfo = notificationCommentCategoryInfo($not_modid); |
|
| 174 | + $not_category = $not_catinfo['name']; |
|
| 175 | + $not_itemid = $com_itemid; |
|
| 176 | + $not_event = $notify_event; |
|
| 177 | + // Build an ABSOLUTE URL to view the comment. Make sure we |
|
| 178 | + // point to a viewable page (i.e. not the system administration |
|
| 179 | + // module). |
|
| 180 | + $comment_tags = []; |
|
| 181 | + $not_module = $xoopsModule; |
|
| 182 | + if (!isset($comment_url)) { |
|
| 183 | + $com_config = $not_module->getInfo('comments'); |
|
| 184 | + $comment_url = $com_config['pageName'] . '?'; |
|
| 185 | + $comment_url .= $com_config['itemName']; |
|
| 186 | + } |
|
| 187 | + $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&com_id=' . $newcid . '&com_rootid=' . $com_rootid . '&com_mode=' . $com_mode . '&com_order=' . $com_order . '#comment' . $newcid; |
|
| 188 | + $notificationHandler = xoops_getHandler('notification'); |
|
| 189 | + $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid); |
|
| 190 | + } |
|
| 191 | 191 | |
| 192 | - PlanetUtility::planetRespondToTrackback(0); |
|
| 193 | - } else { |
|
| 194 | - PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
|
| 195 | - } |
|
| 192 | + PlanetUtility::planetRespondToTrackback(0); |
|
| 193 | + } else { |
|
| 194 | + PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors())); |
|
| 195 | + } |
|
| 196 | 196 | } |
@@ -27,8 +27,8 @@ |
||
| 27 | 27 | include __DIR__ . '/header.php'; |
| 28 | 28 | $com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0; |
| 29 | 29 | if ($com_itemid > 0) { |
| 30 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 31 | - $article_obj = $articleHandler->get($com_itemid); |
|
| 32 | - $com_replytitle = $article_obj->getVar('art_title'); |
|
| 33 | - require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
| 30 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 31 | + $article_obj = $articleHandler->get($com_itemid); |
|
| 32 | + $com_replytitle = $article_obj->getVar('art_title'); |
|
| 33 | + require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
| 34 | 34 | } |
@@ -24,11 +24,11 @@ |
||
| 24 | 24 | // URL: https://xoops.org // |
| 25 | 25 | // Project: Article Project // |
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | -include __DIR__ . '/header.php'; |
|
| 28 | -$com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0; |
|
| 29 | -if ($com_itemid > 0) { |
|
| 27 | +include __DIR__.'/header.php'; |
|
| 28 | +$com_itemid = isset($_GET['com_itemid']) ? (int) $_GET['com_itemid'] : 0; |
|
| 29 | +if ($com_itemid>0) { |
|
| 30 | 30 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
| 31 | 31 | $article_obj = $articleHandler->get($com_itemid); |
| 32 | 32 | $com_replytitle = $article_obj->getVar('art_title'); |
| 33 | - require_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
| 33 | + require_once XOOPS_ROOT_PATH.'/include/comment_new.php'; |
|
| 34 | 34 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(isset($_GET['blog']) ? $_GET['blog'] : (isset($_POST['blog']) ? $_POST['blog'] : 0)); |
| 32 | 32 | |
| 33 | 33 | if (!is_object($xoopsUser) || empty($blog_id)) { |
| 34 | - redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
| 34 | + redirect_header('javascript:history.go(-1);', 1, planet_constant('MD_INVALID')); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | $bookmarkHandler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | $criteria = new CriteriaCompo(new Criteria('blog_id', $blog_id)); |
| 40 | 40 | $criteria->add(new Criteria('bm_uid', $uid)); |
| 41 | 41 | if ($count = $bookmarkHandler->getCount($criteria)) { |
| 42 | - $message = planet_constant('MD_ALREADYBOOKMARKED'); |
|
| 43 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
| 42 | + $message = planet_constant('MD_ALREADYBOOKMARKED'); |
|
| 43 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
| 44 | 44 | } |
| 45 | 45 | $bookmark_obj = $bookmarkHandler->create(); |
| 46 | 46 | $bookmark_obj->setVar('blog_id', $blog_id); |
| 47 | 47 | $bookmark_obj->setVar('bm_uid', $uid); |
| 48 | 48 | if (!$bookmark_id = $bookmarkHandler->insert($bookmark_obj, true)) { |
| 49 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
| 49 | + redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
| 50 | 50 | } |
| 51 | 51 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
| 52 | 52 | $blog_obj = $blogHandler->get($blog_id); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | 27 | use Xmf\Request; |
| 28 | 28 | |
| 29 | -include __DIR__ . '/header.php'; |
|
| 29 | +include __DIR__.'/header.php'; |
|
| 30 | 30 | |
| 31 | 31 | $blog_id = Request::getInt('blog', Request::getInt('blog', 0, 'POST'), 'GET'); //(int)(isset($_GET['blog']) ? $_GET['blog'] : (isset($_POST['blog']) ? $_POST['blog'] : 0)); |
| 32 | 32 | |
@@ -40,19 +40,19 @@ discard block |
||
| 40 | 40 | $criteria->add(new Criteria('bm_uid', $uid)); |
| 41 | 41 | if ($count = $bookmarkHandler->getCount($criteria)) { |
| 42 | 42 | $message = planet_constant('MD_ALREADYBOOKMARKED'); |
| 43 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid, 2, $message); |
|
| 43 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'u'.$uid, 2, $message); |
|
| 44 | 44 | } |
| 45 | 45 | $bookmark_obj = $bookmarkHandler->create(); |
| 46 | 46 | $bookmark_obj->setVar('blog_id', $blog_id); |
| 47 | 47 | $bookmark_obj->setVar('bm_uid', $uid); |
| 48 | 48 | if (!$bookmark_id = $bookmarkHandler->insert($bookmark_obj, true)) { |
| 49 | - redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
| 49 | + redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id, 2, planet_constant('MD_NOTSAVED')); |
|
| 50 | 50 | } |
| 51 | 51 | $blogHandler = xoops_getModuleHandler('blog', $GLOBALS['moddirname']); |
| 52 | 52 | $blog_obj = $blogHandler->get($blog_id); |
| 53 | -$marks = $blog_obj->getVar('blog_marks') + 1; |
|
| 54 | -$blog_obj->setVar('blog_marks', $blog_obj->getVar('blog_marks') + 1); |
|
| 53 | +$marks = $blog_obj->getVar('blog_marks')+1; |
|
| 54 | +$blog_obj->setVar('blog_marks', $blog_obj->getVar('blog_marks')+1); |
|
| 55 | 55 | $blogHandler->insert($blog_obj, true); |
| 56 | 56 | $message = planet_constant('MD_ACTIONDONE'); |
| 57 | -redirect_header(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . $blog_id, 2, $message); |
|
| 58 | -include __DIR__ . '/footer.php'; |
|
| 57 | +redirect_header(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.$blog_id, 2, $message); |
|
| 58 | +include __DIR__.'/footer.php'; |
|
@@ -29,21 +29,21 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | use Xmf\Request; |
| 31 | 31 | |
| 32 | -include __DIR__ . '/header.php'; |
|
| 32 | +include __DIR__.'/header.php'; |
|
| 33 | 33 | global $pdf_data; |
| 34 | 34 | if (!empty($_POST['pdf_data'])) { |
| 35 | 35 | $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
| 36 | 36 | } elseif (!empty($pdf_data)) { |
| 37 | -} else { |
|
| 37 | +}else { |
|
| 38 | 38 | error_reporting(0); |
| 39 | - include __DIR__ . '/header.php'; |
|
| 39 | + include __DIR__.'/header.php'; |
|
| 40 | 40 | error_reporting(0); |
| 41 | 41 | |
| 42 | 42 | if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
| 43 | 43 | $args['article'] = @$args_num[0]; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 46 | + $article_id = (int) (empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 47 | 47 | |
| 48 | 48 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
| 49 | 49 | $article_obj = $articleHandler->get($article_id); |
@@ -73,14 +73,14 @@ discard block |
||
| 73 | 73 | $pdf_data['date'] = $article_data['time']; |
| 74 | 74 | $pdf_data['content'] = ''; |
| 75 | 75 | if ($article_data['summary']) { |
| 76 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
| 76 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY').': '.$article_data['summary'].'<br><br>'; |
|
| 77 | 77 | } |
| 78 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
| 79 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
| 78 | + $pdf_data['content'] .= $article_data['text'].'<br>'; |
|
| 79 | + $pdf_data['url'] = XOOPS_URL.'/modules/'.$GLOBALS['artdirname'].'/view.article.php'.URL_DELIMITER.$article_obj->getVar('art_id'); |
|
| 80 | 80 | } |
| 81 | 81 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
| 82 | 82 | |
| 83 | -include XOOPS_ROOT_PATH . '/Frameworks/fpdf/init.php'; |
|
| 83 | +include XOOPS_ROOT_PATH.'/Frameworks/fpdf/init.php'; |
|
| 84 | 84 | error_reporting(0); |
| 85 | 85 | ob_end_clean(); |
| 86 | 86 | |
@@ -32,51 +32,51 @@ |
||
| 32 | 32 | include __DIR__ . '/header.php'; |
| 33 | 33 | global $pdf_data; |
| 34 | 34 | if (!empty($_POST['pdf_data'])) { |
| 35 | - $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
| 35 | + $pdf_data = unserialize(base64_decode(Request::getText('pdf_data', '', 'POST'))); |
|
| 36 | 36 | } elseif (!empty($pdf_data)) { |
| 37 | 37 | } else { |
| 38 | - error_reporting(0); |
|
| 39 | - include __DIR__ . '/header.php'; |
|
| 40 | - error_reporting(0); |
|
| 38 | + error_reporting(0); |
|
| 39 | + include __DIR__ . '/header.php'; |
|
| 40 | + error_reporting(0); |
|
| 41 | 41 | |
| 42 | - if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 43 | - $args['article'] = @$args_num[0]; |
|
| 44 | - } |
|
| 42 | + if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) { |
|
| 43 | + $args['article'] = @$args_num[0]; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 46 | + $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
| 47 | 47 | |
| 48 | - $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 49 | - $article_obj = $articleHandler->get($article_id); |
|
| 48 | + $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
|
| 49 | + $article_obj = $articleHandler->get($article_id); |
|
| 50 | 50 | |
| 51 | - $article_data = []; |
|
| 51 | + $article_data = []; |
|
| 52 | 52 | |
| 53 | - // title |
|
| 54 | - $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 53 | + // title |
|
| 54 | + $article_data['title'] = $article_obj->getVar('art_title'); |
|
| 55 | 55 | |
| 56 | - $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 56 | + $article_data['author'] = $article_obj->getVar('art_author'); |
|
| 57 | 57 | |
| 58 | - // source |
|
| 59 | - $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 58 | + // source |
|
| 59 | + $article_data['source'] = $article_obj->getVar('art_link'); |
|
| 60 | 60 | |
| 61 | - // publish time |
|
| 62 | - $article_data['time'] = $article_obj->getTime(); |
|
| 61 | + // publish time |
|
| 62 | + $article_data['time'] = $article_obj->getTime(); |
|
| 63 | 63 | |
| 64 | - // summary |
|
| 65 | - $article_data['summary'] = $article_obj->getSummary(); |
|
| 64 | + // summary |
|
| 65 | + $article_data['summary'] = $article_obj->getSummary(); |
|
| 66 | 66 | |
| 67 | - // text of page |
|
| 68 | - $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 67 | + // text of page |
|
| 68 | + $article_data['text'] = $article_obj->getVar('art_content'); |
|
| 69 | 69 | |
| 70 | - // Build the pdf_data array |
|
| 71 | - $pdf_data['title'] = $article_data['title']; |
|
| 72 | - $pdf_data['author'] = $article_data['author']; |
|
| 73 | - $pdf_data['date'] = $article_data['time']; |
|
| 74 | - $pdf_data['content'] = ''; |
|
| 75 | - if ($article_data['summary']) { |
|
| 76 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
| 77 | - } |
|
| 78 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
| 79 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
| 70 | + // Build the pdf_data array |
|
| 71 | + $pdf_data['title'] = $article_data['title']; |
|
| 72 | + $pdf_data['author'] = $article_data['author']; |
|
| 73 | + $pdf_data['date'] = $article_data['time']; |
|
| 74 | + $pdf_data['content'] = ''; |
|
| 75 | + if ($article_data['summary']) { |
|
| 76 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
| 77 | + } |
|
| 78 | + $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
| 79 | + $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER . $article_obj->getVar('art_id'); |
|
| 80 | 80 | } |
| 81 | 81 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
| 82 | 82 | |
@@ -18,6 +18,6 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | $pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32); |
| 21 | -echo "<div class='adminfooter'>\n" . " <div style='text-align: center;'>\n" . " <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n" . " </div>\n" . ' ' . _AM_MODULEADMIN_ADMIN_FOOTER . "\n" . '</div>'; |
|
| 21 | +echo "<div class='adminfooter'>\n"." <div style='text-align: center;'>\n"." <a href='https://xoops.org' rel='external'><img src='{$pathIcon32}/xoopsmicrobutton.gif' alt='XOOPS' title='XOOPS'></a>\n"." </div>\n".' '._AM_MODULEADMIN_ADMIN_FOOTER."\n".'</div>'; |
|
| 22 | 22 | |
| 23 | 23 | xoops_cp_footer(); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
| 32 | 32 | } else { |
| 33 | - $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
| 33 | + $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
|
| 34 | 34 | } |
| 35 | 35 | $adminObject = \Xmf\Module\Admin::getInstance(); |
| 36 | 36 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | $myts = MyTextSanitizer::getInstance(); |
| 47 | 47 | |
| 48 | 48 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
| 49 | - require_once $GLOBALS['xoops']->path('class/template.php'); |
|
| 50 | - $xoopsTpl = new XoopsTpl(); |
|
| 49 | + require_once $GLOBALS['xoops']->path('class/template.php'); |
|
| 50 | + $xoopsTpl = new XoopsTpl(); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | 20 | $path = dirname(dirname(dirname(__DIR__))); |
| 21 | -require_once $path . '/mainfile.php'; |
|
| 22 | -require_once $path . '/include/cp_functions.php'; |
|
| 23 | -require_once $path . '/include/cp_header.php'; |
|
| 24 | -require_once __DIR__ . '/../class/utility.php'; |
|
| 21 | +require_once $path.'/mainfile.php'; |
|
| 22 | +require_once $path.'/include/cp_functions.php'; |
|
| 23 | +require_once $path.'/include/cp_header.php'; |
|
| 24 | +require_once __DIR__.'/../class/utility.php'; |
|
| 25 | 25 | |
| 26 | 26 | //require_once __DIR__ . '/../class/utility.php'; |
| 27 | 27 | //require_once __DIR__ . '/../include/common.php'; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $moduleDirName = basename(dirname(__DIR__)); |
| 30 | 30 | |
| 31 | 31 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
| 32 | -} else { |
|
| 32 | +}else { |
|
| 33 | 33 | $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
| 34 | 34 | } |
| 35 | 35 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | $xoopsTpl = new XoopsTpl(); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 53 | +require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
| 54 | 54 | //require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php'; |
| 55 | -require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php'; |
|
| 55 | +require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php'; |
|
| 56 | 56 | |
| 57 | 57 | planet_define_url_delimiter(); |
@@ -41,18 +41,18 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
| 43 | 43 | if (!empty($xoopsModuleConfig['article_expire'])) { |
| 44 | - $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
| 45 | - if (!empty($_GET['purge'])) { |
|
| 46 | - $crit = new CriteriaCompo($criteria); |
|
| 47 | - $crit->add(new Criteria('art_comments', 0)); |
|
| 48 | - $article_expires = $articleHandler->getObjects($criteria); |
|
| 49 | - foreach ($article_expires as $id => $article_obj) { |
|
| 50 | - $articleHandler->delete($article_obj); |
|
| 51 | - } |
|
| 52 | - } |
|
| 53 | - $article_count_expire = $articleHandler->getCount($criteria); |
|
| 44 | + $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
| 45 | + if (!empty($_GET['purge'])) { |
|
| 46 | + $crit = new CriteriaCompo($criteria); |
|
| 47 | + $crit->add(new Criteria('art_comments', 0)); |
|
| 48 | + $article_expires = $articleHandler->getObjects($criteria); |
|
| 49 | + foreach ($article_expires as $id => $article_obj) { |
|
| 50 | + $articleHandler->delete($article_obj); |
|
| 51 | + } |
|
| 52 | + } |
|
| 53 | + $article_count_expire = $articleHandler->getCount($criteria); |
|
| 54 | 54 | } else { |
| 55 | - $article_count_expire = 0; |
|
| 55 | + $article_count_expire = 0; |
|
| 56 | 56 | } |
| 57 | 57 | $article_count = $articleHandler->getCount(); |
| 58 | 58 | |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | echo "<br clear=\"all\">" . planet_constant('AM_COUNT') . ': ' . $article_count; |
| 62 | 62 | echo "<br clear=\"all\">"; |
| 63 | 63 | if ($article_count_expire > 0) { |
| 64 | - echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
| 65 | - echo "<br clear=\"all\">"; |
|
| 64 | + echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
| 65 | + echo "<br clear=\"all\">"; |
|
| 66 | 66 | } |
| 67 | 67 | echo '</div>'; |
| 68 | 68 | echo "</fieldset><br clear=\"all\">"; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // URL: https://xoops.org // |
| 25 | 25 | // Project: Article Project // |
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | -require_once __DIR__ . '/admin_header.php'; |
|
| 27 | +require_once __DIR__.'/admin_header.php'; |
|
| 28 | 28 | |
| 29 | 29 | xoops_cp_header(); |
| 30 | 30 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -36,12 +36,12 @@ discard block |
||
| 36 | 36 | * This is a tricky fix for incomplete solution of module cone |
| 37 | 37 | * it is expected to have a better solution in article 1.0 |
| 38 | 38 | */ |
| 39 | -require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 39 | +require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
| 40 | 40 | //planet_adminmenu(3); |
| 41 | 41 | |
| 42 | 42 | $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
| 43 | 43 | if (!empty($xoopsModuleConfig['article_expire'])) { |
| 44 | - $criteria = new Criteria('art_time', time() - $xoopsModuleConfig['article_expire'] * 60 * 60 * 24, '<'); |
|
| 44 | + $criteria = new Criteria('art_time', time()-$xoopsModuleConfig['article_expire']*60*60*24, '<'); |
|
| 45 | 45 | if (!empty($_GET['purge'])) { |
| 46 | 46 | $crit = new CriteriaCompo($criteria); |
| 47 | 47 | $crit->add(new Criteria('art_comments', 0)); |
@@ -51,17 +51,17 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | $article_count_expire = $articleHandler->getCount($criteria); |
| 54 | -} else { |
|
| 54 | +}else { |
|
| 55 | 55 | $article_count_expire = 0; |
| 56 | 56 | } |
| 57 | 57 | $article_count = $articleHandler->getCount(); |
| 58 | 58 | |
| 59 | -echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">" . planet_constant('AM_ARTICLES') . '</legend>'; |
|
| 59 | +echo "<fieldset><legend style=\"font-weight: bold; color: #900;\">".planet_constant('AM_ARTICLES').'</legend>'; |
|
| 60 | 60 | echo "<div style=\"padding: 8px;\">"; |
| 61 | -echo "<br clear=\"all\">" . planet_constant('AM_COUNT') . ': ' . $article_count; |
|
| 61 | +echo "<br clear=\"all\">".planet_constant('AM_COUNT').': '.$article_count; |
|
| 62 | 62 | echo "<br clear=\"all\">"; |
| 63 | -if ($article_count_expire > 0) { |
|
| 64 | - echo "<br clear=\"all\"><a href=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . "/admin/admin.article.php?purge=1\" >" . planet_constant('AM_EXPIRED') . ': ' . $article_count_expire . '</a>'; |
|
| 63 | +if ($article_count_expire>0) { |
|
| 64 | + echo "<br clear=\"all\"><a href=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname']."/admin/admin.article.php?purge=1\" >".planet_constant('AM_EXPIRED').': '.$article_count_expire.'</a>'; |
|
| 65 | 65 | echo "<br clear=\"all\">"; |
| 66 | 66 | } |
| 67 | 67 | echo '</div>'; |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | echo '</text><br>'; |
| 106 | 106 | echo '<label>' . planet_constant('AM_TOTAL_BLOGS') . ':</label><text>' . $blog_count; |
| 107 | 107 | if ($blog_count_pending > 0) { |
| 108 | - echo " (<font color=\"red\">" . $blog_count_pending . '</font>)'; |
|
| 108 | + echo " (<font color=\"red\">" . $blog_count_pending . '</font>)'; |
|
| 109 | 109 | } |
| 110 | 110 | echo '</text><br>'; |
| 111 | 111 | echo '<label>' . planet_constant('AM_TOTAL_ARTICLES') . ':</label><text>' . $article_count; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // URL: https://xoops.org // |
| 25 | 25 | // Project: Article Project // |
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | -require_once __DIR__ . '/admin_header.php'; |
|
| 27 | +require_once __DIR__.'/admin_header.php'; |
|
| 28 | 28 | |
| 29 | 29 | xoops_cp_header(); |
| 30 | 30 | $adminObject = \Xmf\Module\Admin::getInstance(); |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | </style> |
| 51 | 51 | "; |
| 52 | 52 | |
| 53 | -echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant('AM_PREFERENCES') . '</legend>'; |
|
| 53 | +echo "<fieldset><legend style='font-weight: bold; color: #900;'>".planet_constant('AM_PREFERENCES').'</legend>'; |
|
| 54 | 54 | echo "<div style='padding: 8px;'>"; |
| 55 | -echo '<label>' . '<strong>PHP Version:</strong>' . ':</label><text>' . PHP_VERSION . '</text><br>'; |
|
| 55 | +echo '<label>'.'<strong>PHP Version:</strong>'.':</label><text>'.PHP_VERSION.'</text><br>'; |
|
| 56 | 56 | //echo '<label>' . '<strong>MySQL Version:</strong>' . ':</label><text>' . mysqli_get_server_info() . '</text><br>'; |
| 57 | -echo '<label>' . '<strong>XOOPS Version:</strong>' . ':</label><text>' . XOOPS_VERSION . '</text><br>'; |
|
| 58 | -echo '<label>' . '<strong>Module Version:</strong>' . ':</label><text>' . $xoopsModule->getInfo('version') . '</text><br>'; |
|
| 57 | +echo '<label>'.'<strong>XOOPS Version:</strong>'.':</label><text>'.XOOPS_VERSION.'</text><br>'; |
|
| 58 | +echo '<label>'.'<strong>Module Version:</strong>'.':</label><text>'.$xoopsModule->getInfo('version').'</text><br>'; |
|
| 59 | 59 | echo '</div>'; |
| 60 | 60 | echo "<div style='padding: 8px;'>"; |
| 61 | 61 | //echo '<label>' . planet_constant('AM_SAFEMODE') . ':</label><text>'; |
@@ -67,31 +67,31 @@ discard block |
||
| 67 | 67 | //echo '<label>' . planet_constant('AM_MAGICQUOTESGPC') . ':</label><text>'; |
| 68 | 68 | //echo ini_get('magic_quotes_gpc') ? planet_constant('AM_ON') : planet_constant('AM_OFF'); |
| 69 | 69 | //echo '</text><br>'; |
| 70 | -echo '<label>' . planet_constant('AM_MAXPOSTSIZE') . ':</label><text>' . ini_get('post_max_size'); |
|
| 70 | +echo '<label>'.planet_constant('AM_MAXPOSTSIZE').':</label><text>'.ini_get('post_max_size'); |
|
| 71 | 71 | echo '</text><br>'; |
| 72 | -echo '<label>' . planet_constant('AM_MAXINPUTTIME') . ':</label><text>' . ini_get('max_input_time'); |
|
| 72 | +echo '<label>'.planet_constant('AM_MAXINPUTTIME').':</label><text>'.ini_get('max_input_time'); |
|
| 73 | 73 | echo '</text><br>'; |
| 74 | -echo '<label>' . planet_constant('AM_OUTPUTBUFFERING') . ':</label><text>' . ini_get('output_buffering'); |
|
| 74 | +echo '<label>'.planet_constant('AM_OUTPUTBUFFERING').':</label><text>'.ini_get('output_buffering'); |
|
| 75 | 75 | echo '</text><br>'; |
| 76 | -echo '<label>' . planet_constant('AM_XML_EXTENSION') . ':</label><text>'; |
|
| 76 | +echo '<label>'.planet_constant('AM_XML_EXTENSION').':</label><text>'; |
|
| 77 | 77 | echo extension_loaded('xml') ? planet_constant('AM_ON') : planet_constant('AM_OFF'); |
| 78 | 78 | echo '</text><br>'; |
| 79 | -echo '<label>' . planet_constant('AM_MB_EXTENSION') . ':</label><text>'; |
|
| 79 | +echo '<label>'.planet_constant('AM_MB_EXTENSION').':</label><text>'; |
|
| 80 | 80 | echo extension_loaded('mbstring') ? planet_constant('AM_ON') : planet_constant('AM_OFF'); |
| 81 | 81 | echo '</text><br>'; |
| 82 | -echo '<label>' . planet_constant('AM_CURL') . ':</label><text>'; |
|
| 82 | +echo '<label>'.planet_constant('AM_CURL').':</label><text>'; |
|
| 83 | 83 | echo function_exists('curl_init') ? planet_constant('AM_ON') : planet_constant('AM_OFF'); |
| 84 | 84 | echo '</text><br>'; |
| 85 | -echo '<label>' . planet_constant('AM_FSOCKOPEN') . ':</label><text>'; |
|
| 85 | +echo '<label>'.planet_constant('AM_FSOCKOPEN').':</label><text>'; |
|
| 86 | 86 | echo function_exists('fsockopen') ? planet_constant('AM_ON') : planet_constant('AM_OFF'); |
| 87 | 87 | echo '</text><br>'; |
| 88 | -echo '<label>' . planet_constant('AM_URLFOPEN') . ':</label><text>'; |
|
| 88 | +echo '<label>'.planet_constant('AM_URLFOPEN').':</label><text>'; |
|
| 89 | 89 | echo ini_get('allow_url_fopen') ? planet_constant('AM_ON') : planet_constant('AM_OFF'); |
| 90 | 90 | echo '</text><br>'; |
| 91 | 91 | echo '</div>'; |
| 92 | 92 | echo '</fieldset>'; |
| 93 | 93 | |
| 94 | -echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant('AM_STATS') . '</legend>'; |
|
| 94 | +echo "<fieldset><legend style='font-weight: bold; color: #900;'>".planet_constant('AM_STATS').'</legend>'; |
|
| 95 | 95 | echo "<div style='padding: 8px;'>"; |
| 96 | 96 | $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
| 97 | 97 | $category_count = $categoryHandler->getCount(); |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | $article_count = $articleHandler->getCount(); |
| 102 | 102 | $criteria = new Criteria('blog_status', 0); |
| 103 | 103 | $blog_count_pending = $blogHandler->getCount($criteria); |
| 104 | -echo '<label>' . planet_constant('AM_TOTAL_CATEGORIES') . ':</label><text>' . $category_count; |
|
| 104 | +echo '<label>'.planet_constant('AM_TOTAL_CATEGORIES').':</label><text>'.$category_count; |
|
| 105 | 105 | echo '</text><br>'; |
| 106 | -echo '<label>' . planet_constant('AM_TOTAL_BLOGS') . ':</label><text>' . $blog_count; |
|
| 107 | -if ($blog_count_pending > 0) { |
|
| 108 | - echo " (<font color=\"red\">" . $blog_count_pending . '</font>)'; |
|
| 106 | +echo '<label>'.planet_constant('AM_TOTAL_BLOGS').':</label><text>'.$blog_count; |
|
| 107 | +if ($blog_count_pending>0) { |
|
| 108 | + echo " (<font color=\"red\">".$blog_count_pending.'</font>)'; |
|
| 109 | 109 | } |
| 110 | 110 | echo '</text><br>'; |
| 111 | -echo '<label>' . planet_constant('AM_TOTAL_ARTICLES') . ':</label><text>' . $article_count; |
|
| 111 | +echo '<label>'.planet_constant('AM_TOTAL_ARTICLES').':</label><text>'.$article_count; |
|
| 112 | 112 | echo '</text><br>'; |
| 113 | 113 | echo '</div>'; |
| 114 | 114 | echo '</fieldset>'; |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | // Project: Article Project // |
| 26 | 26 | // ------------------------------------------------------------------------ // |
| 27 | 27 | |
| 28 | -require_once __DIR__ . '/../../../include/cp_header.php'; |
|
| 29 | -require XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php'; |
|
| 28 | +require_once __DIR__.'/../../../include/cp_header.php'; |
|
| 29 | +require XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php'; |
|
| 30 | 30 | //require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/functions.php'; |
| 31 | -require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.admin.php'; |
|
| 32 | -require_once __DIR__ . '/../class/utility.php'; |
|
| 31 | +require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.admin.php'; |
|
| 32 | +require_once __DIR__.'/../class/utility.php'; |
|
| 33 | 33 | $moduleDirName = basename(dirname(__DIR__)); |
| 34 | 34 | // include the default language file for the admin interface |
| 35 | 35 | xoops_loadLanguage('main', $moduleDirName); |