@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -43,28 +43,28 @@ |
||
43 | 43 | $categories_option = $categoryHandler->getList(); |
44 | 44 | natsort($categories_option); |
45 | 45 | if (count($categories_option)) { |
46 | - $cat_option_tray = new XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
47 | - $options = array(0 => _NONE); |
|
48 | - foreach ($categories_option as $id => $title) { |
|
49 | - $options[$id] = $title; |
|
50 | - } |
|
51 | - $cat_select = new XoopsFormSelect('', 'categories', $categories, 3, true); |
|
52 | - $cat_select->addOptionArray($options); |
|
53 | - $cat_option_tray->addElement($cat_select); |
|
54 | - $form->addElement($cat_option_tray); |
|
46 | + $cat_option_tray = new XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
47 | + $options = array(0 => _NONE); |
|
48 | + foreach ($categories_option as $id => $title) { |
|
49 | + $options[$id] = $title; |
|
50 | + } |
|
51 | + $cat_select = new XoopsFormSelect('', 'categories', $categories, 3, true); |
|
52 | + $cat_select->addOptionArray($options); |
|
53 | + $cat_option_tray->addElement($cat_select); |
|
54 | + $form->addElement($cat_option_tray); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /* For admin only */ |
58 | 58 | if (is_object($xoopsUser) && $xoopsUser->isAdmin()) { |
59 | - $status_option_tray = new XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
60 | - $status_select = new XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
61 | - $status_select->addOptionArray(array( |
|
62 | - '0' => planet_constant('MD_PENDING'), |
|
63 | - '1' => planet_constant('MD_ACTIVE'), |
|
64 | - '2' => planet_constant('MD_FEATURED') |
|
65 | - )); |
|
66 | - $status_option_tray->addElement($status_select); |
|
67 | - $form->addElement($status_option_tray); |
|
59 | + $status_option_tray = new XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
60 | + $status_select = new XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
61 | + $status_select->addOptionArray(array( |
|
62 | + '0' => planet_constant('MD_PENDING'), |
|
63 | + '1' => planet_constant('MD_ACTIVE'), |
|
64 | + '2' => planet_constant('MD_FEATURED') |
|
65 | + )); |
|
66 | + $status_option_tray->addElement($status_select); |
|
67 | + $form->addElement($status_option_tray); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $form->addElement(new XoopsFormHidden('blog', $blog_id)); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
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(); |
@@ -24,8 +24,8 @@ |
||
24 | 24 | |
25 | 25 | $moduleDirName = basename(dirname(__DIR__)); |
26 | 26 | $uploadFolders = array( |
27 | - NEWBB_UPLOAD_PATH, |
|
28 | - NEWBB_UPLOAD_PATH . '/thumbs' |
|
27 | + NEWBB_UPLOAD_PATH, |
|
28 | + NEWBB_UPLOAD_PATH . '/thumbs' |
|
29 | 29 | ); |
30 | 30 | |
31 | 31 | //$copyFiles = array( |
@@ -20,12 +20,12 @@ |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
23 | -require_once __DIR__ . '/common.php'; |
|
23 | +require_once __DIR__.'/common.php'; |
|
24 | 24 | |
25 | 25 | $moduleDirName = basename(dirname(__DIR__)); |
26 | 26 | $uploadFolders = array( |
27 | 27 | NEWBB_UPLOAD_PATH, |
28 | - NEWBB_UPLOAD_PATH . '/thumbs' |
|
28 | + NEWBB_UPLOAD_PATH.'/thumbs' |
|
29 | 29 | ); |
30 | 30 | |
31 | 31 | //$copyFiles = array( |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
21 | 21 | |
22 | -include __DIR__ . '/vars.php'; |
|
22 | +include __DIR__.'/vars.php'; |
|
23 | 23 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
24 | 24 | |
25 | 25 | PlanetUtility::planetParseFunction(' |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -22,19 +22,19 @@ |
||
22 | 22 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
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 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -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, array($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, array($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 = array(); |
|
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 = array(); |
|
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 | } |
@@ -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 | } |
@@ -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 | } |