@@ -178,8 +178,8 @@ |
||
178 | 178 | define('_AM_NEWBB_CAN_ATTACH', 'Can use attachment'); |
179 | 179 | define('_AM_NEWBB_CAN_NOAPPROVE', 'Can post directly'); |
180 | 180 | define('_AM_NEWBB_CAN_TYPE', 'Can use topic type'); |
181 | -define('_AM_NEWBB_CAN_HTML', 'Can use and disable/enable HTML in posts');//irmtfan revised |
|
182 | -define('_AM_NEWBB_CAN_SIGNATURE', 'Can use and disable/enable signature. Default is set in profile module.');//irmtfan revised |
|
181 | +define('_AM_NEWBB_CAN_HTML', 'Can use and disable/enable HTML in posts'); //irmtfan revised |
|
182 | +define('_AM_NEWBB_CAN_SIGNATURE', 'Can use and disable/enable signature. Default is set in profile module.'); //irmtfan revised |
|
183 | 183 | define('_AM_NEWBB_ACTION', 'Action'); |
184 | 184 | define('_AM_NEWBB_PERM_TEMPLATE', 'Set default permission template'); |
185 | 185 | define('_AM_NEWBB_PERM_TEMPLATE_DESC', 'Edit the following permission template so that it can be applied to a forum or a couple of forums'); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | define('_AM_NEWBB_DIGEST_HELP_4', 'After creating and sending, do not delete the created messages. Otherwise they will be generated again.'); |
77 | 77 | define( |
78 | 78 | '_AM_NEWBB_DIGEST_HELP_AUTO_DIGEST', |
79 | - 'To configure the automatic creation and distribution of Digest topics, you need to create a cron task on your server.<br>For example: * NIX systems: <strong>0 6 * * * wget --post-data \'foo=bar\' https://example.com/modules/newbb/digest.php</strong><br>In this example, the script will run every day at 6.00 and check if there are any new Digest topics. If they are not found, mailing will not be done.<br>If for any reason you do not have the opportunity to create a task, then it is possible to create and make the dispatch on this page manually by clicking on the button above.<br>Please note that it is not recommended to delete created mailings, otherwise they will be created and sent again.' |
|
79 | + 'To configure the automatic creation and distribution of Digest topics, you need to create a cron task on your server.<br>For example: * NIX systems: <strong>0 6 * * * wget --post-data \'foo=bar\' https://example.com/modules/newbb/digest.php</strong><br>In this example, the script will run every day at 6.00 and check if there are any new Digest topics. If they are not found, mailing will not be done.<br>If for any reason you do not have the opportunity to create a task, then it is possible to create and make the dispatch on this page manually by clicking on the button above.<br>Please note that it is not recommended to delete created mailings, otherwise they will be created and sent again.' |
|
80 | 80 | ); |
81 | 81 | //define('_AM_NEWBB_DIGEST_PAST', '<span style="color:red;">Should be sent out %d minutes ago</span>'); |
82 | 82 | //define('_AM_NEWBB_DIGEST_NEXT', 'Need to send out in %d minutes'); |
@@ -325,30 +325,30 @@ discard block |
||
325 | 325 | // Help tab |
326 | 326 | define( |
327 | 327 | '_AM_NEWBB_HELP_CATEGORY_TAB', |
328 | - 'To create a category, use the button above and fill in all the fields on the form.<br>By default, category images are located: /modules/newbb/assets/images/category/<br>Sponsor link should be written in the following format: https://xoops.org/modules/newbb/ newBB Support. First the link, then the sponsor\'s name or other text.' |
|
328 | + 'To create a category, use the button above and fill in all the fields on the form.<br>By default, category images are located: /modules/newbb/assets/images/category/<br>Sponsor link should be written in the following format: https://xoops.org/modules/newbb/ newBB Support. First the link, then the sponsor\'s name or other text.' |
|
329 | 329 | ); |
330 | 330 | define( |
331 | 331 | '_AM_NEWBB_HELP_FORUM_TAB', |
332 | - 'To create and manage the forums use the buttons with the right<br>To create the forum, use the \'Create forum\' button. Then fill in all the fields of the form. You can also create a subforum.<br>To move the forum between categories, use the \'Move\' button. Follow the further instructions.<br>To merge forums, use the \'Merge\' button. Follow the further instructions.<br>If you have an access rights template, then you can apply it to the forum you are creating.' |
|
332 | + 'To create and manage the forums use the buttons with the right<br>To create the forum, use the \'Create forum\' button. Then fill in all the fields of the form. You can also create a subforum.<br>To move the forum between categories, use the \'Move\' button. Follow the further instructions.<br>To merge forums, use the \'Merge\' button. Follow the further instructions.<br>If you have an access rights template, then you can apply it to the forum you are creating.' |
|
333 | 333 | ); |
334 | 334 | define( |
335 | 335 | '_AM_NEWBB_HELP_PERMISSION_TAB', |
336 | - '<strong>When setting permissions, be careful.</strong><br>After you install and apply the settings, you will automatically go to the next permissions tab.<br>Also here it is possible to create a default access rights template and apply it either to one forum or to all forums.' |
|
336 | + '<strong>When setting permissions, be careful.</strong><br>After you install and apply the settings, you will automatically go to the next permissions tab.<br>Also here it is possible to create a default access rights template and apply it either to one forum or to all forums.' |
|
337 | 337 | ); |
338 | 338 | define('_AM_NEWBB_HELP_ORDER_TAB', 'Allows you to set the order of categories and forums relative to each other.<br>The order (Weight) is set to 0 - top, 99 (and further) - bottom.'); |
339 | 339 | define('_AM_NEWBB_HELP_PRUNE_TAB', 'Allows you to clear forums from empty themes, obsolete themes, etc.<br>Also you can not delete topics that you want to clear, but transfer them to a specially created category \'Archive\' or any other.'); |
340 | 340 | define( |
341 | 341 | '_AM_NEWBB_HELP_REPORT_TAB', |
342 | - 'Allows you to process reports that users send to you if they believe that the message on the forum does not comply with forum rules or ethical rules.<br>You can review the report and take action in relation to the message, the author, etc.<br>When a user sends a message, moderators and administrators are notified by e-mail.' |
|
342 | + 'Allows you to process reports that users send to you if they believe that the message on the forum does not comply with forum rules or ethical rules.<br>You can review the report and take action in relation to the message, the author, etc.<br>When a user sends a message, moderators and administrators are notified by e-mail.' |
|
343 | 343 | ); |
344 | 344 | define('_AM_NEWBB_HELP_VOTE_TAB', 'If you have the voting function enabled, here you can see the results of the voting.<br>This vote is not associated with other XOOPS modules.'); |
345 | 345 | define( |
346 | 346 | '_AM_NEWBB_HELP_TYPE_TAB', |
347 | - 'Allows you to create tags for highlighting themes. For example:<br><strong style="color:blue;">[Important]</strong> <strong>Topic Title</strong><br><strong style="color:red;">[ATTENTION]</strong> <strong>Topic Title</strong><br>You can set theme types when creating a theme on the user side.' |
|
347 | + 'Allows you to create tags for highlighting themes. For example:<br><strong style="color:blue;">[Important]</strong> <strong>Topic Title</strong><br><strong style="color:red;">[ATTENTION]</strong> <strong>Topic Title</strong><br>You can set theme types when creating a theme on the user side.' |
|
348 | 348 | ); |
349 | 349 | define( |
350 | 350 | '_AM_NEWBB_HELP_GROUPMOD_TAB', |
351 | - 'Allows you to install users of certain groups as moderators for the entire module, and for individual categories and forums.<br>It is recommended to create separate groups of moderators, for more convenient management of moderators.<br>You can also assign specific users to moderators when creating a forum.' |
|
351 | + 'Allows you to install users of certain groups as moderators for the entire module, and for individual categories and forums.<br>It is recommended to create separate groups of moderators, for more convenient management of moderators.<br>You can also assign specific users to moderators when creating a forum.' |
|
352 | 352 | ); |
353 | 353 | define('_AM_NEWBB_HELP_SYNC_TAB', 'If you notice a problem with the message dates, the appearance of blank messages, etc. Here you can synchronize and correct forum data and topics'); |
354 | 354 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | define('_MD_NEWBB_NEWPOSTS', 'New posts'); |
36 | 36 | define('_MD_NEWBB_NONEWPOSTS', 'No new posts'); |
37 | 37 | define('_MD_NEWBB_PRIVATEFORUM', 'Inactive Forum'); |
38 | -define('_MD_NEWBB_BY', 'by');// Posted by |
|
38 | +define('_MD_NEWBB_BY', 'by'); // Posted by |
|
39 | 39 | define('_MD_NEWBB_TOSTART', 'To start viewing messages, select the forum that you want to visit from the list below.'); |
40 | 40 | define('_MD_NEWBB_TOTALTOPICSC', 'Total Topics: '); |
41 | 41 | define('_MD_NEWBB_TOTALPOSTSC', 'Total Posts: '); |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | define('_MD_NEWBB_TIMEISUP', 'You\'ve reached the time limit for editing your post.'); |
275 | 275 | define('_MD_NEWBB_TIMEISUPDEL', 'You\'ve reached the time limit for deleting your post.'); |
276 | 276 | //reply.php |
277 | -define('_MD_NEWBB_ON', 'on');//Posted on |
|
278 | -define('_MD_NEWBB_USERWROTE', '%s wrote:');// %s is username |
|
277 | +define('_MD_NEWBB_ON', 'on'); //Posted on |
|
278 | +define('_MD_NEWBB_USERWROTE', '%s wrote:'); // %s is username |
|
279 | 279 | define('_MD_NEWBB_RE', 'Re'); |
280 | 280 | //post.php |
281 | 281 | define('_MD_NEWBB_EDITNOTALLOWED', 'You\'re not allowed to edit this post!'); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | define('_MD_NEWBB_THANKSSUBMIT', 'Thanks for your submission!'); |
285 | 285 | define('_MD_NEWBB_REPLYPOSTED', 'A reply to your topic has been posted.'); |
286 | 286 | define('_MD_NEWBB_HELLO', 'Hello %s,'); |
287 | -define('_MD_NEWBB_URRECEIVING', 'You are receiving this email because a message you posted on %s forums has been replied to.');// %s is your site name |
|
287 | +define('_MD_NEWBB_URRECEIVING', 'You are receiving this email because a message you posted on %s forums has been replied to.'); // %s is your site name |
|
288 | 288 | define('_MD_NEWBB_CLICKBELOW', 'Click on the link below to view the thread:'); |
289 | 289 | define('_MD_NEWBB_WAITFORAPPROVAL', 'Thank you. Your post will be approved before publication.'); |
290 | 290 | define('_MD_NEWBB_POSTING_LIMITED', 'Why not take a break and come back in %d sec'); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | define('_MD_NEWBB_CANTVOTEOWN', 'You cannot vote on the topic you submitted.<br>All votes are logged and reviewed.'); |
379 | 379 | define('_MD_NEWBB_VOTEONCE', 'Please do not vote for the same topic more than once.'); |
380 | 380 | define('_MD_NEWBB_VOTEAPPRE', 'Your vote is appreciated.'); |
381 | -define('_MD_NEWBB_THANKYOU', 'Thank you for taking the time to vote here at %s');// %s is your site name |
|
381 | +define('_MD_NEWBB_THANKYOU', 'Thank you for taking the time to vote here at %s'); // %s is your site name |
|
382 | 382 | define('_MD_NEWBB_VOTES', 'Votes'); |
383 | 383 | define('_MD_NEWBB_NOVOTERATE', 'You did not rate this Topic'); |
384 | 384 | // polls.php |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use XoopsModules\Newbb; |
5 | 5 | |
6 | -define('REAL_MODULE_NAME', 'modules/newbb'); //this is the Real Module directory |
|
7 | -define('SEO_MODULE_NAME', 'modules/newbb'); //this is SEO Name for rewrite Hack |
|
6 | +define('REAL_MODULE_NAME', 'modules/newbb'); //this is the Real Module directory |
|
7 | +define('SEO_MODULE_NAME', 'modules/newbb'); //this is SEO Name for rewrite Hack |
|
8 | 8 | |
9 | 9 | //ob_start('seo_urls'); |
10 | 10 | |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | $search = [ |
21 | 21 | |
22 | 22 | // Search URLs of modules' directry. |
23 | - '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})' . $XPS_URL . '\/' . $module_name . '\/(index.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
24 | - '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})' . $XPS_URL . '\/' . $module_name . '\/(viewpost.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
25 | - '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})' . $XPS_URL . '\/' . $module_name . '\/(rss.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
26 | - '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})' . $XPS_URL . '\/' . $module_name . '\/(viewforum.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
27 | - '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})' . $XPS_URL . '\/' . $module_name . '\/(viewtopic.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
28 | - '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})' . $XPS_URL . '\/' . $module_name . '\/(newtopic.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
29 | - '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})' . $XPS_URL . '\/' . $module_name . '\/(.*)([^>\'\"]*)([\'\"]{1})([^>]*)>/i' |
|
23 | + '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})'.$XPS_URL.'\/'.$module_name.'\/(index.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
24 | + '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})'.$XPS_URL.'\/'.$module_name.'\/(viewpost.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
25 | + '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})'.$XPS_URL.'\/'.$module_name.'\/(rss.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
26 | + '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})'.$XPS_URL.'\/'.$module_name.'\/(viewforum.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
27 | + '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})'.$XPS_URL.'\/'.$module_name.'\/(viewtopic.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
28 | + '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})'.$XPS_URL.'\/'.$module_name.'\/(newtopic.php)([^>\'\"]*)([\'\"]{1})([^>]*)>/i', |
|
29 | + '/<(a|meta)([^>]*)(href|url)=([\'\"]{0,1})'.$XPS_URL.'\/'.$module_name.'\/(.*)([^>\'\"]*)([\'\"]{1})([^>]*)>/i' |
|
30 | 30 | ]; |
31 | 31 | |
32 | 32 | $s = preg_replace_callback($search, 'replace_links', $s); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if (!empty($matches[6])) { |
48 | 48 | // replacing cat=x |
49 | 49 | if (preg_match('/cat=(\d+)/', $matches[6], $mvars)) { |
50 | - $add_to_url = 'c-' . $mvars[1] . '/' . forum_seo_cat($mvars[1]) . ''; |
|
50 | + $add_to_url = 'c-'.$mvars[1].'/'.forum_seo_cat($mvars[1]).''; |
|
51 | 51 | $req_string = preg_replace('/cat=\d+/', '', $matches[6]); |
52 | 52 | } else { |
53 | 53 | return $matches['0']; |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | if (!empty($matches[6])) { |
61 | 61 | // replacing status=x |
62 | 62 | if (preg_match('/status=([a-z]+)/', $matches[6], $mvars)) { |
63 | - $add_to_url = 'viewpost.php' . $matches[6]; |
|
63 | + $add_to_url = 'viewpost.php'.$matches[6]; |
|
64 | 64 | $req_string = preg_replace('/status=([a-z])+/', '', $matches[6]); |
65 | 65 | } else { |
66 | 66 | return $matches['0']; |
67 | 67 | } |
68 | 68 | } else { |
69 | - $add_to_url = 'viewpost.php' . $matches[6]; |
|
69 | + $add_to_url = 'viewpost.php'.$matches[6]; |
|
70 | 70 | } |
71 | 71 | break; |
72 | 72 | case 'rss.php': |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | if (preg_match('/c=(\d+)/', $matches[6], $mvars)) { |
78 | 78 | $add_to_url = 'rc-'; |
79 | 79 | if ($mvars[1] > 0) { |
80 | - $add_to_url .= $mvars[1] . '/' . forum_seo_cat($mvars[1]) . ''; |
|
80 | + $add_to_url .= $mvars[1].'/'.forum_seo_cat($mvars[1]).''; |
|
81 | 81 | } else { |
82 | - $add_to_url .= $mvars[1] . '/rss.html'; |
|
82 | + $add_to_url .= $mvars[1].'/rss.html'; |
|
83 | 83 | } |
84 | 84 | $req_string = preg_replace('/c=\d+/', '', $matches[6]); |
85 | 85 | } elseif (preg_match('/f=(\d+)/', $matches[6], $mvars)) { |
86 | 86 | $add_to_url = 'rf-'; |
87 | 87 | if ($mvars[1] > 0) { |
88 | - $add_to_url .= $mvars[1] . '/' . forum_seo_forum($mvars[1]) . ''; |
|
88 | + $add_to_url .= $mvars[1].'/'.forum_seo_forum($mvars[1]).''; |
|
89 | 89 | } else { |
90 | - $add_to_url .= $mvars[1] . '/rss.html'; |
|
90 | + $add_to_url .= $mvars[1].'/rss.html'; |
|
91 | 91 | } |
92 | 92 | $req_string = preg_replace('/f=\d+/', '', $matches[6]); |
93 | 93 | } else { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if (!empty($matches[6])) { |
103 | 103 | // replacing forum=x |
104 | 104 | if (preg_match('/forum=(\d+)/', $matches[6], $mvars)) { |
105 | - $add_to_url = 'f-' . $mvars[1] . '/' . forum_seo_forum($mvars[1]) . ''; |
|
105 | + $add_to_url = 'f-'.$mvars[1].'/'.forum_seo_forum($mvars[1]).''; |
|
106 | 106 | $req_string = preg_replace('/forum=\d+/', '', $matches[6]); |
107 | 107 | } else { |
108 | 108 | return $matches['0']; |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | if (!empty($matches[6])) { |
116 | 116 | // replacing topic_id=x |
117 | 117 | if (preg_match('/topic_id=(\d+)/', $matches[6], $mvars)) { |
118 | - $add_to_url = 't-' . $mvars[1] . '/' . forum_seo_topic($mvars[1]) . ''; |
|
118 | + $add_to_url = 't-'.$mvars[1].'/'.forum_seo_topic($mvars[1]).''; |
|
119 | 119 | $req_string = preg_replace('/topic_id=\d+/', '', $matches[6]); |
120 | 120 | } //replacing post_id=x |
121 | 121 | elseif (preg_match('/post_id=(\d+)/', $matches[6], $mvars)) { |
122 | - $add_to_url = 'p-' . $mvars[1] . '/' . forum_seo_post($mvars[1]) . ''; |
|
122 | + $add_to_url = 'p-'.$mvars[1].'/'.forum_seo_post($mvars[1]).''; |
|
123 | 123 | $req_string = preg_replace('/post_id=\d+/', '', $matches[6]); |
124 | 124 | } else { |
125 | 125 | return $matches['0']; |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | if (!empty($matches[6])) { |
133 | 133 | // replacing topic_id=x |
134 | 134 | if (preg_match('/topic_id=(\d+)/', $matches[6], $mvars)) { |
135 | - $add_to_url = 'pr-' . $mvars[1] . '/' . forum_seo_topic($mvars[1]) . ''; |
|
135 | + $add_to_url = 'pr-'.$mvars[1].'/'.forum_seo_topic($mvars[1]).''; |
|
136 | 136 | $req_string = preg_replace('/topic_id=\d+/', '', $matches[6]); |
137 | 137 | } //replacing post_id=x |
138 | 138 | elseif (preg_match('/post_id=(\d+)/', $matches[6], $mvars)) { |
139 | - $add_to_url = 'pr-' . $mvars[1] . '/' . forum_seo_post($mvars[1]) . ''; |
|
139 | + $add_to_url = 'pr-'.$mvars[1].'/'.forum_seo_post($mvars[1]).''; |
|
140 | 140 | $req_string = preg_replace('/post_id=\d+/', '', $matches[6]); |
141 | 141 | } else { |
142 | 142 | return $matches['0']; |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | if (!empty($matches[6])) { |
150 | 150 | // replacing topic_id=x |
151 | 151 | if (preg_match('/topic_id=(\d+)/', $matches[6], $mvars)) { |
152 | - $add_to_url = 'pdf-' . $mvars[1] . '/' . forum_seo_topic($mvars[1]) . ''; |
|
152 | + $add_to_url = 'pdf-'.$mvars[1].'/'.forum_seo_topic($mvars[1]).''; |
|
153 | 153 | $req_string = preg_replace('/topic_id=\d+/', '', $matches[6]); |
154 | 154 | } //replacing post_id=x |
155 | 155 | elseif (preg_match('/post_id=(\d+)/', $matches[6], $mvars)) { |
156 | - $add_to_url = 'pdf-' . $mvars[1] . '/' . forum_seo_post($mvars[1]) . ''; |
|
156 | + $add_to_url = 'pdf-'.$mvars[1].'/'.forum_seo_post($mvars[1]).''; |
|
157 | 157 | $req_string = preg_replace('/post_id=\d+/', '', $matches[6]); |
158 | 158 | } else { |
159 | 159 | return $matches['0']; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | if ('?' === $req_string) { |
170 | 170 | $req_string = ''; |
171 | 171 | } |
172 | - $ret = '<' . $matches[1] . $matches[2] . $matches[3] . '=' . $matches[4] . XOOPS_URL . '/' . SEO_MODULE_NAME . '/' . $add_to_url . $req_string . $matches[7] . $matches[8] . '>'; |
|
172 | + $ret = '<'.$matches[1].$matches[2].$matches[3].'='.$matches[4].XOOPS_URL.'/'.SEO_MODULE_NAME.'/'.$add_to_url.$req_string.$matches[7].$matches[8].'>'; |
|
173 | 173 | |
174 | 174 | //$ret = '<'.$matches[1].$matches[2].$matches[3].'='.$matches[4].XOOPS_URL.'/'.REAL_MODULE_NAME.'/'.$add_to_url.$req_string.$matches[7].$matches[8].'>'; |
175 | 175 | return $ret; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | return $ret; |
191 | 191 | } |
192 | 192 | } |
193 | - $query = 'SELECT cat_id, cat_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_categories'); |
|
193 | + $query = 'SELECT cat_id, cat_title FROM '.$GLOBALS['xoopsDB']->prefix('newbb_categories'); |
|
194 | 194 | $result = $GLOBALS['xoopsDB']->query($query); |
195 | 195 | $_ret = []; |
196 | 196 | while (false !== ($res = $GLOBALS['xoopsDB']->fetchArray($result))) { |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | return $ret; |
219 | 219 | } |
220 | 220 | } |
221 | - $query = 'SELECT forum_id, forum_name FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_forums'); |
|
221 | + $query = 'SELECT forum_id, forum_name FROM '.$GLOBALS['xoopsDB']->prefix('newbb_forums'); |
|
222 | 222 | $result = $GLOBALS['xoopsDB']->query($query); |
223 | 223 | $_ret = []; |
224 | 224 | while (false !== ($res = $GLOBALS['xoopsDB']->fetchArray($result))) { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | function forum_seo_topic($_cat_id) |
239 | 239 | { |
240 | - $query = 'SELECT topic_title FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' WHERE topic_id = ' . $_cat_id; |
|
240 | + $query = 'SELECT topic_title FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' WHERE topic_id = '.$_cat_id; |
|
241 | 241 | $result = $GLOBALS['xoopsDB']->query($query); |
242 | 242 | $res = $GLOBALS['xoopsDB']->fetchArray($result); |
243 | 243 | $ret = forum_seo_title($res['topic_title']); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | */ |
259 | 259 | function forum_seo_post($_cat_id) |
260 | 260 | { |
261 | - $query = 'SELECT subject FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' WHERE post_id = ' . $_cat_id; |
|
261 | + $query = 'SELECT subject FROM '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' WHERE post_id = '.$_cat_id; |
|
262 | 262 | $result = $GLOBALS['xoopsDB']->query($query); |
263 | 263 | $res = $GLOBALS['xoopsDB']->fetchArray($result); |
264 | 264 | $ret = forum_seo_title($res['subject']); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | '', |
350 | 350 | '' |
351 | 351 | ]; |
352 | - $title = preg_replace($pattern, $rep_pat, $title); |
|
352 | + $title = preg_replace($pattern, $rep_pat, $title); |
|
353 | 353 | |
354 | 354 | // Transformation des caractères accentués |
355 | 355 | // è é ê ë ç à â ä î ï ù ü û ô ö |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | 'ae', |
406 | 406 | 'ss' |
407 | 407 | ]; |
408 | - $title = preg_replace($pattern, $rep_pat, $title); |
|
408 | + $title = preg_replace($pattern, $rep_pat, $title); |
|
409 | 409 | |
410 | 410 | /*$string = str_replace(' ', '-', $title); |
411 | 411 | $string = iconv('utf-8', 'ascii//translit', $string); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $xsitemapHelper = \Xmf\Module\Helper::getHelper($moduleDirName); |
39 | 39 | |
40 | 40 | /** @var Newbb\Utility $utilityClass */ |
41 | - $utilityClass = ucfirst($moduleDirName) . 'Utility'; |
|
41 | + $utilityClass = ucfirst($moduleDirName).'Utility'; |
|
42 | 42 | if (!class_exists($utilityClass)) { |
43 | 43 | xoops_load('utility', $moduleDirName); |
44 | 44 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if ($dirInfo->isDir()) { |
57 | 57 | // The directory exists so delete it |
58 | 58 | if (false === $utilityClass::rrmdir($old_dir)) { |
59 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
59 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
60 | 60 | $success = false; |
61 | 61 | } |
62 | 62 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
15 | 15 | |
16 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
16 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
17 | 17 | define('NEWBB_FUNCTIONS_RENDER_LOADED', true); |
18 | 18 | |
19 | 19 | if (!defined('NEWBB_FUNCTIONS_RENDER')) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | if (0 !== $br) { |
68 | 68 | $text = $myts->nl2Br($text); |
69 | 69 | } |
70 | - $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
70 | + $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
71 | 71 | |
72 | 72 | return $text; |
73 | 73 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}' />"; |
100 | 100 | if (empty($asImage)) { |
101 | - $button = "<a href='{$link}' title='{$alt}' {$extra}>" . newbbDisplayImage($button, $alt, true) . '</a>'; |
|
101 | + $button = "<a href='{$link}' title='{$alt}' {$extra}>".newbbDisplayImage($button, $alt, true).'</a>'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | return $button; |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | if (!empty($forums_allowed)) { |
27 | 27 | $crit_top = new \CriteriaCompo(new \Criteria('parent_forum', 0)); |
28 | 28 | //$crit_top->add(new \Criteria("cat_id", "(".implode(", ", array_keys($categories)).")", "IN")); |
29 | - $crit_top->add(new \Criteria('forum_id', '(' . implode(', ', $forums_allowed) . ')', 'IN')); |
|
29 | + $crit_top->add(new \Criteria('forum_id', '('.implode(', ', $forums_allowed).')', 'IN')); |
|
30 | 30 | $forums_top_id = $forumHandler->getIds($crit_top); |
31 | 31 | } |
32 | 32 | |
33 | 33 | $forums_sub_id = []; |
34 | 34 | if ((bool)$forums_top_id && $sitemap_configs['show_subcategoris']) { |
35 | - $crit_sub = new \CriteriaCompo(new \Criteria('parent_forum', '(' . implode(', ', $forums_top_id) . ')', 'IN')); |
|
36 | - $crit_sub->add(new \Criteria('forum_id', '(' . implode(', ', $forums_allowed) . ')', 'IN')); |
|
35 | + $crit_sub = new \CriteriaCompo(new \Criteria('parent_forum', '('.implode(', ', $forums_top_id).')', 'IN')); |
|
36 | + $crit_sub->add(new \Criteria('forum_id', '('.implode(', ', $forums_allowed).')', 'IN')); |
|
37 | 37 | $forums_sub_id = $forumHandler->getIds($crit_sub); |
38 | 38 | } |
39 | 39 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $forums_available = array_merge($forums_top_id, $forums_sub_id); |
42 | 42 | $forums_array = []; |
43 | 43 | if ((bool)$forums_available) { |
44 | - $crit_forum = new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN'); |
|
44 | + $crit_forum = new \Criteria('forum_id', '('.implode(', ', $forums_available).')', 'IN'); |
|
45 | 45 | $crit_forum->setSort('cat_id ASC, parent_forum ASC, forum_order'); |
46 | 46 | $crit_forum->setOrder('ASC'); |
47 | 47 | $forums_array = $forumHandler->getAll($crit_forum, ['forum_name', 'parent_forum', 'cat_id'], false); |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | if ((bool)$forum['parent_forum']) { |
53 | 53 | $forums[$forum['parent_forum']]['fchild'][$forumid] = [ |
54 | 54 | 'id' => $forumid, |
55 | - 'url' => 'viewforum.php?forum=' . $forumid, |
|
55 | + 'url' => 'viewforum.php?forum='.$forumid, |
|
56 | 56 | 'title' => $forum['forum_name'] |
57 | 57 | ]; |
58 | 58 | } else { |
59 | 59 | $forums[$forumid] = [ |
60 | 60 | 'id' => $forumid, |
61 | 61 | 'cid' => $forum['cat_id'], |
62 | - 'url' => 'viewforum.php?forum=' . $forumid, |
|
62 | + 'url' => 'viewforum.php?forum='.$forumid, |
|
63 | 63 | 'title' => $forum['forum_name'] |
64 | 64 | ]; |
65 | 65 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $i = $cat_id; |
77 | 77 | $sitemap['parent'][$i]['id'] = $cat_id; |
78 | 78 | $sitemap['parent'][$i]['title'] = $category['cat_title']; |
79 | - $sitemap['parent'][$i]['url'] = XOOPS_URL . '/modules/newbb/index.php?cat=' . $cat_id; |
|
79 | + $sitemap['parent'][$i]['url'] = XOOPS_URL.'/modules/newbb/index.php?cat='.$cat_id; |
|
80 | 80 | } |
81 | 81 | foreach ($forums as $id => $forum) { |
82 | 82 | $cid = $forum['cid']; |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | */ |
31 | 31 | function xoops_module_pre_install_newbb(\XoopsModule $module) |
32 | 32 | { |
33 | - include __DIR__ . '/../preloads/autoloader.php'; |
|
33 | + include __DIR__.'/../preloads/autoloader.php'; |
|
34 | 34 | /** @var Newbb\Utility $utility */ |
35 | 35 | $utility = new \XoopsModules\Newbb\Utility(); |
36 | 36 | $xoopsSuccess = $utility::checkVerXoops($module); |
37 | 37 | $phpSuccess = $utility::checkVerPhp($module); |
38 | 38 | |
39 | 39 | if (false !== $xoopsSuccess && false !== $phpSuccess) { |
40 | - $moduleTables =& $module->getInfo('tables'); |
|
40 | + $moduleTables = & $module->getInfo('tables'); |
|
41 | 41 | foreach ($moduleTables as $table) { |
42 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
42 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | */ |
56 | 56 | function xoops_module_install_newbb(\XoopsModule $module) |
57 | 57 | { |
58 | - require_once __DIR__ . '/../../../mainfile.php'; |
|
59 | - require_once __DIR__ . '/../include/config.php'; |
|
58 | + require_once __DIR__.'/../../../mainfile.php'; |
|
59 | + require_once __DIR__.'/../include/config.php'; |
|
60 | 60 | |
61 | 61 | $moduleDirName = basename(dirname(__DIR__)); |
62 | 62 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | $moduleId2 = $helper->getModule()->mid(); |
74 | 74 | $gpermHandler = xoops_getHandler('groupperm'); |
75 | 75 | // access rights ------------------------------------------ |
76 | - $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | - $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
76 | + $gpermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | + $gpermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | + $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | + $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | + $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
81 | 81 | |
82 | 82 | // --- CREATE FOLDERS --------------- |
83 | 83 | if (count($configurator->uploadFolders) > 0) { |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | |
90 | 90 | // --- COPY blank.png FILES --------------- |
91 | 91 | if (count($configurator->copyBlankFiles) > 0) { |
92 | - $file = __DIR__ . '/../assets/images/blank.png'; |
|
92 | + $file = __DIR__.'/../assets/images/blank.png'; |
|
93 | 93 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
94 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
94 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
95 | 95 | $utilityClass::copyFile($file, $dest); |
96 | 96 | } |
97 | 97 | } |
98 | 98 | //delete .html entries from the tpl table |
99 | - $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
99 | + $sql = 'DELETE FROM '.$xoopsDB->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'"; |
|
100 | 100 | $xoopsDB->queryF($sql); |
101 | 101 | |
102 | 102 | return true; |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | use XoopsModules\Newbb; |
24 | 24 | |
25 | 25 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
26 | -include __DIR__ . '/../preloads/autoloader.php'; |
|
26 | +include __DIR__.'/../preloads/autoloader.php'; |
|
27 | 27 | |
28 | 28 | $moduleDirName = basename(dirname(__DIR__)); |
29 | -$moduleDirNameUpper = strtoupper($moduleDirName); //$capsDirName |
|
29 | +$moduleDirNameUpper = strtoupper($moduleDirName); //$capsDirName |
|
30 | 30 | |
31 | 31 | /** @var \XoopsDatabase $db */ |
32 | 32 | /** @var Newbb\Helper $helper */ |
@@ -49,20 +49,20 @@ discard block |
||
49 | 49 | //define('NEWBB_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash |
50 | 50 | //define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash |
51 | 51 | |
52 | -if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
|
53 | - define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
|
54 | - define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
55 | - define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
56 | - define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
|
57 | - define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
|
58 | - define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
|
59 | - define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
|
60 | - define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
|
61 | - define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
|
62 | - define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
|
63 | - define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
64 | - define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
65 | - define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
|
52 | +if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) { |
|
53 | + define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__))); |
|
54 | + define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
55 | + define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
56 | + define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/'); |
|
57 | + define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/'); |
|
58 | + define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images'); |
|
59 | + define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/'); |
|
60 | + define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/'); |
|
61 | + define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php'); |
|
62 | + define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png'); |
|
63 | + define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
64 | + define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
65 | + define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | |
@@ -133,15 +133,15 @@ discard block |
||
133 | 133 | //$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
134 | 134 | |
135 | 135 | $icons = [ |
136 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
|
137 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
|
138 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
|
139 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
|
140 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
|
141 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
|
142 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
|
143 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
|
144 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
|
136 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT."' align='middle'>", |
|
137 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>", |
|
138 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>", |
|
139 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>", |
|
140 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>", |
|
141 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>", |
|
142 | + 'add' => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>", |
|
143 | + '0' => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>", |
|
144 | + '1' => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>", |
|
145 | 145 | ]; |
146 | 146 | |
147 | 147 | $debug = false; |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | $GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
155 | 155 | } |
156 | 156 | |
157 | -$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
|
157 | +$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL.'/modules/'.$moduleDirName); |
|
158 | 158 | // Local icons path |
159 | 159 | if (is_object($helper->getModule())) { |
160 | 160 | $pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
161 | 161 | $pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
162 | 162 | |
163 | - $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
163 | + $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16); |
|
164 | 164 | $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
165 | 165 | } |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | $criteriaPost = new \CriteriaCompo(); |
56 | 56 | $criteriaPost->add(new \Criteria('p.approved', 1), 'AND'); // only active posts |
57 | 57 | |
58 | - $forum_list = [];// get forum lists just for forum names |
|
58 | + $forum_list = []; // get forum lists just for forum names |
|
59 | 59 | if (count($validForums) > 0) { |
60 | 60 | $criteriaPermissions = new \CriteriaCompo(); |
61 | - $criteriaPermissions->add(new \Criteria('p.forum_id', '(' . implode(',', $validForums) . ')', 'IN'), 'AND'); |
|
62 | - $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '(' . implode(', ', $validForums) . ')', 'IN'), 'forum_name', false); |
|
61 | + $criteriaPermissions->add(new \Criteria('p.forum_id', '('.implode(',', $validForums).')', 'IN'), 'AND'); |
|
62 | + $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '('.implode(', ', $validForums).')', 'IN'), 'forum_name', false); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | if (is_numeric($userid) && 0 !== $userid) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } elseif (is_array($userid) && count($userid) > 0) { |
69 | 69 | $userid = array_map('intval', $userid); |
70 | 70 | $criteriaUser = new \CriteriaCompo(); |
71 | - $criteriaUser->add(new \Criteria('p.uid', '(' . implode(',', $userid) . ')', 'IN'), 'OR'); |
|
71 | + $criteriaUser->add(new \Criteria('p.uid', '('.implode(',', $userid).')', 'IN'), 'OR'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | $count = 0; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $criteriaKeywords = new \CriteriaCompo(); |
81 | 81 | foreach ($queryarray as $queryTerm) { |
82 | 82 | $termCriteria = new \CriteriaCompo(); |
83 | - $queryTermLike = '%' . $xoopsDB->escape($queryTerm) . '%'; |
|
83 | + $queryTermLike = '%'.$xoopsDB->escape($queryTerm).'%'; |
|
84 | 84 | if ('title' === $searchin || 'both' === $searchin) { |
85 | 85 | $termCriteria->add(new \Criteria('p.subject', $queryTermLike, 'LIKE'), 'OR'); |
86 | 86 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $criteriaKeywords->add($termCriteria, $andor); |
91 | 91 | } |
92 | 92 | // add highlight keywords to post links |
93 | - $highlightKey = '&keywords=' . implode(' ', $queryarray); |
|
93 | + $highlightKey = '&keywords='.implode(' ', $queryarray); |
|
94 | 94 | $highlightKey = str_replace(' ', '+', $highlightKey); |
95 | 95 | } |
96 | 96 | $criteria = new \CriteriaCompo(); |
@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | $post = $posts[$id]; |
132 | 132 | $post_data = $post->getPostBody(); |
133 | 133 | $ret[$i]['topic_id'] = $post->getVar('topic_id'); |
134 | - $ret[$i]['link'] = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post->getVar('post_id') . $highlightKey; // add highlight key |
|
134 | + $ret[$i]['link'] = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$post->getVar('post_id').$highlightKey; // add highlight key |
|
135 | 135 | $ret[$i]['title'] = $post_data['subject']; |
136 | 136 | $ret[$i]['time'] = $post_data['date']; |
137 | 137 | $ret[$i]['forum_name'] = $myts->htmlSpecialChars($forum_list[$post->getVar('forum_id')]['forum_name']); |
138 | - $ret[$i]['forum_link'] = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $post->getVar('forum_id'); |
|
138 | + $ret[$i]['forum_link'] = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$post->getVar('forum_id'); |
|
139 | 139 | $ret[$i]['post_text'] = $post_data['text']; |
140 | 140 | $ret[$i]['uid'] = $post->getVar('uid'); |
141 | - $ret[$i]['poster'] = $post->getVar('uid') ? '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $ret[$i]['uid'] . '">' . $post_data['author'] . '</a>' : $post_data['author']; |
|
141 | + $ret[$i]['poster'] = $post->getVar('uid') ? '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$ret[$i]['uid'].'">'.$post_data['author'].'</a>' : $post_data['author']; |
|
142 | 142 | ++$i; |
143 | 143 | } |
144 | 144 |