@@ -21,49 +21,49 @@ |
||
21 | 21 | $moduleDirName = basename(dirname(dirname(__DIR__))); |
22 | 22 | $moduleDirNameUpper = strtoupper($moduleDirName); |
23 | 23 | |
24 | -define('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS', 'GD library support: '); |
|
25 | -define('CO_' . $moduleDirNameUpper . '_GDLIBVERSION', 'GD Library version: '); |
|
26 | -define('CO_' . $moduleDirNameUpper . '_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)"); |
|
27 | -define('CO_' . $moduleDirNameUpper . '_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)"); |
|
28 | -define('CO_' . $moduleDirNameUpper . '_IMAGEINFO', 'Server status'); |
|
29 | -define('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): '); |
|
30 | -define('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): '); |
|
31 | -define('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): '); |
|
32 | -define('CO_' . $moduleDirNameUpper . '_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> "); |
|
33 | -define('CO_' . $moduleDirNameUpper . '_OFF', "<span style='font-weight: bold;'>OFF</span>"); |
|
34 | -define('CO_' . $moduleDirNameUpper . '_ON', "<span style='font-weight: bold;'>ON</span>"); |
|
35 | -define('CO_' . $moduleDirNameUpper . '_SERVERPATH', 'Server path to XOOPS root: '); |
|
36 | -define('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS', 'Server uploads status: '); |
|
37 | -define('CO_' . $moduleDirNameUpper . '_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>"); |
|
38 | -define('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.'); |
|
24 | +define('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS', 'GD library support: '); |
|
25 | +define('CO_'.$moduleDirNameUpper.'_GDLIBVERSION', 'GD Library version: '); |
|
26 | +define('CO_'.$moduleDirNameUpper.'_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)"); |
|
27 | +define('CO_'.$moduleDirNameUpper.'_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)"); |
|
28 | +define('CO_'.$moduleDirNameUpper.'_IMAGEINFO', 'Server status'); |
|
29 | +define('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): '); |
|
30 | +define('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): '); |
|
31 | +define('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): '); |
|
32 | +define('CO_'.$moduleDirNameUpper.'_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> "); |
|
33 | +define('CO_'.$moduleDirNameUpper.'_OFF', "<span style='font-weight: bold;'>OFF</span>"); |
|
34 | +define('CO_'.$moduleDirNameUpper.'_ON', "<span style='font-weight: bold;'>ON</span>"); |
|
35 | +define('CO_'.$moduleDirNameUpper.'_SERVERPATH', 'Server path to XOOPS root: '); |
|
36 | +define('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS', 'Server uploads status: '); |
|
37 | +define('CO_'.$moduleDirNameUpper.'_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>"); |
|
38 | +define('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.'); |
|
39 | 39 | |
40 | -define('CO_' . $moduleDirNameUpper . '_PRINT', "<span style='font-weight: bold;'>Print</span>"); |
|
41 | -define('CO_' . $moduleDirNameUpper . '_PDF', "<span style='font-weight: bold;'>Create PDF</span>"); |
|
40 | +define('CO_'.$moduleDirNameUpper.'_PRINT', "<span style='font-weight: bold;'>Print</span>"); |
|
41 | +define('CO_'.$moduleDirNameUpper.'_PDF', "<span style='font-weight: bold;'>Create PDF</span>"); |
|
42 | 42 | |
43 | -define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'"); |
|
44 | -define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED1', "Update failed - couldn't add new fields"); |
|
45 | -define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'"); |
|
46 | -define('CO_' . $moduleDirNameUpper . '_ERROR_COLUMN', 'Could not create column in database : %s'); |
|
47 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)'); |
|
48 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)'); |
|
49 | -define('CO_' . $moduleDirNameUpper . '_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module'); |
|
43 | +define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'"); |
|
44 | +define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED1', "Update failed - couldn't add new fields"); |
|
45 | +define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'"); |
|
46 | +define('CO_'.$moduleDirNameUpper.'_ERROR_COLUMN', 'Could not create column in database : %s'); |
|
47 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)'); |
|
48 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)'); |
|
49 | +define('CO_'.$moduleDirNameUpper.'_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module'); |
|
50 | 50 | |
51 | -define('CO_' . $moduleDirNameUpper . '_FOLDERS_DELETED_OK', 'Upload Folders have been deleted'); |
|
51 | +define('CO_'.$moduleDirNameUpper.'_FOLDERS_DELETED_OK', 'Upload Folders have been deleted'); |
|
52 | 52 | |
53 | 53 | // Error Msgs |
54 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH', 'Could not delete %s directory'); |
|
55 | -define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_REMOVE', 'Could not delete %s'); |
|
56 | -define('CO_' . $moduleDirNameUpper . '_ERROR_NO_PLUGIN', 'Could not load plugin'); |
|
54 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH', 'Could not delete %s directory'); |
|
55 | +define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_REMOVE', 'Could not delete %s'); |
|
56 | +define('CO_'.$moduleDirNameUpper.'_ERROR_NO_PLUGIN', 'Could not load plugin'); |
|
57 | 57 | |
58 | 58 | //Help |
59 | -define('CO_' . $moduleDirNameUpper . '_DIRNAME', basename(dirname(dirname(__DIR__)))); |
|
60 | -define('CO_' . $moduleDirNameUpper . '_HELP_HEADER', __DIR__ . '/help/helpheader.tpl'); |
|
61 | -define('CO_' . $moduleDirNameUpper . '_BACK_2_ADMIN', 'Back to Administration of '); |
|
62 | -define('CO_' . $moduleDirNameUpper . '_OVERVIEW', 'Overview'); |
|
59 | +define('CO_'.$moduleDirNameUpper.'_DIRNAME', basename(dirname(dirname(__DIR__)))); |
|
60 | +define('CO_'.$moduleDirNameUpper.'_HELP_HEADER', __DIR__.'/help/helpheader.tpl'); |
|
61 | +define('CO_'.$moduleDirNameUpper.'_BACK_2_ADMIN', 'Back to Administration of '); |
|
62 | +define('CO_'.$moduleDirNameUpper.'_OVERVIEW', 'Overview'); |
|
63 | 63 | |
64 | 64 | //define('CO_' . $moduleDirNameUpper . '_HELP_DIR', __DIR__); |
65 | 65 | |
66 | 66 | //help multi-page |
67 | -define('CO_' . $moduleDirNameUpper . '_DISCLAIMER', 'Disclaimer'); |
|
68 | -define('CO_' . $moduleDirNameUpper . '_LICENSE', 'License'); |
|
69 | -define('CO_' . $moduleDirNameUpper . '_SUPPORT', 'Support'); |
|
67 | +define('CO_'.$moduleDirNameUpper.'_DISCLAIMER', 'Disclaimer'); |
|
68 | +define('CO_'.$moduleDirNameUpper.'_LICENSE', 'License'); |
|
69 | +define('CO_'.$moduleDirNameUpper.'_SUPPORT', 'Support'); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | define('_MI_NEWBB_INSTALL_FORUM_DESC', 'Forum for test.'); |
213 | 213 | define('_MI_NEWBB_INSTALL_POST_SUBJECT', 'Congratulations! The forum is working.'); |
214 | 214 | define('_MI_NEWBB_INSTALL_POST_TEXT', ' |
215 | - Welcome to ' . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES) . ' forum. |
|
215 | + Welcome to ' . htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES).' forum. |
|
216 | 216 | Feel free to register and login to start your topics. |
217 | 217 | |
218 | 218 | If you have any question concerning NewBB usage, please visit your local support site or [url=https://xoops.org/modules/newbb/]XOOPS Support Site[/url]. |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | |
321 | 321 | //Help |
322 | 322 | define('_MI_NEWBB_DIRNAME', basename(dirname(dirname(__DIR__)))); |
323 | -define('_MI_NEWBB_HELP_HEADER', __DIR__ . '/help/helpheader.tpl'); |
|
323 | +define('_MI_NEWBB_HELP_HEADER', __DIR__.'/help/helpheader.tpl'); |
|
324 | 324 | define('_MI_NEWBB_BACK_2_ADMIN', 'Back to Administration of '); |
325 | 325 | define('_MI_NEWBB_OVERVIEW', 'Overview'); |
326 | 326 |
@@ -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'); |
@@ -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; |