From e8abe7b9995bb88452b2e79ca4f5152ecf63568d Mon Sep 17 00:00:00 2001 From: KuJoe <1040086+KuJoe@users.noreply.github.com> Date: Mon, 23 Mar 2026 01:01:16 -0400 Subject: [PATCH] Updated local comment system moving the settings into /admin/config Local comments system uses config.ini and is in /admin/config now with all other settings. --- config/config.ini.example | 19 ++ lang/ar_AR.ini | 9 + lang/be_BY.ini | 9 + lang/cs_CZ.ini | 9 + lang/da_DK.ini | 9 + lang/de_DE.ini | 9 + lang/de_DE_gender_doppelpunkt.ini | 9 + lang/de_DE_gender_dudenkonform.ini | 9 + lang/el_GR.ini | 9 + lang/en_US.ini | 9 + lang/eo_EO.ini | 9 + lang/es_ES.ini | 9 + lang/fa_IR.ini | 9 + lang/fr_FR.ini | 9 + lang/gl_ES.ini | 9 + lang/gu_GU.ini | 9 + lang/hi_HI.ini | 9 + lang/hr_HR.ini | 9 + lang/hu_HU.ini | 9 + lang/id_ID.ini | 9 + lang/it_IT.ini | 9 + lang/ko_KO.ini | 9 + lang/ku_KU.ini | 9 + lang/ms_MY.ini | 9 + lang/nl_NL.ini | 9 + lang/pl_PL.ini | 9 + lang/pt_BR.ini | 9 + lang/ru_RU.ini | 9 + lang/sv_SE.ini | 9 + lang/tr_TR.ini | 9 + lang/uk_UA.ini | 9 + lang/zh_CN.ini | 9 + lang/zh_TW.ini | 9 + system/admin/views/comments.html.php | 162 +---------------- system/admin/views/config-comments.html.php | 169 ++++++++++++++++++ system/admin/views/config-custom.html.php | 3 + system/admin/views/config-metatags.html.php | 3 + .../admin/views/config-performance.html.php | 3 + system/admin/views/config-reading.html.php | 3 + system/admin/views/config-security.html.php | 3 + system/admin/views/config-widget.html.php | 5 +- system/admin/views/config-writing.html.php | 3 + system/admin/views/config.html.php | 3 + system/admin/views/layout.html.php | 11 +- system/configList.json | 15 ++ system/htmly.php | 77 +++++++- system/includes/comments-frontend.php | 2 +- system/includes/comments.php | 138 +++----------- 48 files changed, 620 insertions(+), 287 deletions(-) create mode 100644 system/admin/views/config-comments.html.php diff --git a/config/config.ini.example b/config/config.ini.example index 5dd8594c..93aa96df 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -45,6 +45,25 @@ breadcrumb.home = "Home" ; Comment system. Choose "facebook", "disqus", or "disable". comment.system = "disable" +; Local comments settings +comments.moderation = "false" +comments.honeypot = "true" +comments.jstime = "true" +comments.notify = "true" +comments.notifyadmin = "true" +comments.admin.email = "" +comments.salt = "" + +; Local comments SMTP settings +comments.mail.enabled = "false" +comments.mail.host = "" +comments.mail.username = "" +comments.mail.password = "" +comments.mail.port = "587" +comments.mail.encryption = "tls" +comments.mail.from.email = "" +comments.mail.from.name = "" + ; Facebook comments fb.appid = "" fb.num = "5" diff --git a/lang/ar_AR.ini b/lang/ar_AR.ini index 7bad38e0..a1dc8bf7 100644 --- a/lang/ar_AR.ini +++ b/lang/ar_AR.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/be_BY.ini b/lang/be_BY.ini index 7619234e..3b7b7e33 100644 --- a/lang/be_BY.ini +++ b/lang/be_BY.ini @@ -341,3 +341,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/cs_CZ.ini b/lang/cs_CZ.ini index 0efb7edb..3f542a9d 100644 --- a/lang/cs_CZ.ini +++ b/lang/cs_CZ.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/da_DK.ini b/lang/da_DK.ini index 0f741751..8afd6ecc 100644 --- a/lang/da_DK.ini +++ b/lang/da_DK.ini @@ -351,3 +351,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/de_DE.ini b/lang/de_DE.ini index 7c082bb2..acbaba9d 100644 --- a/lang/de_DE.ini +++ b/lang/de_DE.ini @@ -340,3 +340,12 @@ subpages = "Unterseiten" getstarted = "Los geht's" onthispage = "Auf dieser Seite" backtotop = "Nach oben" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/de_DE_gender_doppelpunkt.ini b/lang/de_DE_gender_doppelpunkt.ini index 551734ee..a81f2943 100644 --- a/lang/de_DE_gender_doppelpunkt.ini +++ b/lang/de_DE_gender_doppelpunkt.ini @@ -340,3 +340,12 @@ subpages = "Unterseiten" getstarted = "Los geht's" onthispage = "Auf dieser Seite" backtotop = "Nach oben" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/de_DE_gender_dudenkonform.ini b/lang/de_DE_gender_dudenkonform.ini index 18af8cb1..e0a2f7a5 100644 --- a/lang/de_DE_gender_dudenkonform.ini +++ b/lang/de_DE_gender_dudenkonform.ini @@ -340,3 +340,12 @@ subpages = "Unterseiten" getstarted = "Los geht's" onthispage = "Auf dieser Seite" backtotop = "Nach oben" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/el_GR.ini b/lang/el_GR.ini index 777c38fc..3169ca6e 100644 --- a/lang/el_GR.ini +++ b/lang/el_GR.ini @@ -342,3 +342,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/en_US.ini b/lang/en_US.ini index e1c41ae8..32bb81f5 100644 --- a/lang/en_US.ini +++ b/lang/en_US.ini @@ -407,3 +407,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/eo_EO.ini b/lang/eo_EO.ini index 0eaf827c..e55af16a 100644 --- a/lang/eo_EO.ini +++ b/lang/eo_EO.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/es_ES.ini b/lang/es_ES.ini index 5e9dcdc9..0d36fbc0 100644 --- a/lang/es_ES.ini +++ b/lang/es_ES.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/fa_IR.ini b/lang/fa_IR.ini index bd573eef..50f5f49a 100644 --- a/lang/fa_IR.ini +++ b/lang/fa_IR.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/fr_FR.ini b/lang/fr_FR.ini index 56e2c49e..d8d250fd 100644 --- a/lang/fr_FR.ini +++ b/lang/fr_FR.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/gl_ES.ini b/lang/gl_ES.ini index b2867a66..50b52a24 100644 --- a/lang/gl_ES.ini +++ b/lang/gl_ES.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/gu_GU.ini b/lang/gu_GU.ini index 227c0754..82a8c45a 100644 --- a/lang/gu_GU.ini +++ b/lang/gu_GU.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/hi_HI.ini b/lang/hi_HI.ini index 4a35a652..12fe0c38 100644 --- a/lang/hi_HI.ini +++ b/lang/hi_HI.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/hr_HR.ini b/lang/hr_HR.ini index 7fe76419..3712e037 100644 --- a/lang/hr_HR.ini +++ b/lang/hr_HR.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/hu_HU.ini b/lang/hu_HU.ini index c37f2cc0..e35e3737 100644 --- a/lang/hu_HU.ini +++ b/lang/hu_HU.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/id_ID.ini b/lang/id_ID.ini index 837f63dd..9b1b528f 100644 --- a/lang/id_ID.ini +++ b/lang/id_ID.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/it_IT.ini b/lang/it_IT.ini index 4c1ff3a7..dfed9b88 100644 --- a/lang/it_IT.ini +++ b/lang/it_IT.ini @@ -407,3 +407,12 @@ backtotop = "Torna in cima" subpages = "Sottopagine" getstarted = "Per cominciare" onthispage = "Su questa pagina" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/ko_KO.ini b/lang/ko_KO.ini index f2ce9e42..5981a0a5 100644 --- a/lang/ko_KO.ini +++ b/lang/ko_KO.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/ku_KU.ini b/lang/ku_KU.ini index 40444a0f..1e7ae25e 100644 --- a/lang/ku_KU.ini +++ b/lang/ku_KU.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/ms_MY.ini b/lang/ms_MY.ini index da727ae4..b930e53e 100644 --- a/lang/ms_MY.ini +++ b/lang/ms_MY.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/nl_NL.ini b/lang/nl_NL.ini index 867b4a00..d1a0456d 100644 --- a/lang/nl_NL.ini +++ b/lang/nl_NL.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/pl_PL.ini b/lang/pl_PL.ini index 38857936..bdd58094 100644 --- a/lang/pl_PL.ini +++ b/lang/pl_PL.ini @@ -341,3 +341,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/pt_BR.ini b/lang/pt_BR.ini index dd34ab7d..990dec1f 100644 --- a/lang/pt_BR.ini +++ b/lang/pt_BR.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/ru_RU.ini b/lang/ru_RU.ini index f4e07156..9c305514 100644 --- a/lang/ru_RU.ini +++ b/lang/ru_RU.ini @@ -341,3 +341,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/sv_SE.ini b/lang/sv_SE.ini index 33e2ed8b..c2db1399 100644 --- a/lang/sv_SE.ini +++ b/lang/sv_SE.ini @@ -352,3 +352,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/tr_TR.ini b/lang/tr_TR.ini index 40765140..cf409181 100644 --- a/lang/tr_TR.ini +++ b/lang/tr_TR.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/uk_UA.ini b/lang/uk_UA.ini index 908ff05c..387bcaa5 100644 --- a/lang/uk_UA.ini +++ b/lang/uk_UA.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/zh_CN.ini b/lang/zh_CN.ini index 7dd4c09a..b62f4894 100644 --- a/lang/zh_CN.ini +++ b/lang/zh_CN.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/lang/zh_TW.ini b/lang/zh_TW.ini index 670821c1..b6dd975a 100644 --- a/lang/zh_TW.ini +++ b/lang/zh_TW.ini @@ -340,3 +340,12 @@ backtotop = "Back to top" subpages = "Sub pages" getstarted = "Get started" onthispage = "On this page" +<<<<<<< Updated upstream +======= +keep_me_logged_in = "Keep me logged in" +session_security = "Session security" +ip_session_validation = "IP session validation" +ip_session_validation_explain = "Keep this enabled for better security. Disable only for users whose IP changes frequently (for example, mobile networks)." +enable_jstime = "Enable jstime" +jstime_desc = "Block spam submissions that are sent too quickly by bots." +>>>>>>> Stashed changes diff --git a/system/admin/views/comments.html.php b/system/admin/views/comments.html.php index e90f2fed..98a84df6 100644 --- a/system/admin/views/comments.html.php +++ b/system/admin/views/comments.html.php @@ -19,8 +19,6 @@ -

@@ -125,165 +123,6 @@ - - -
- - - - -

-
- -
- -
-
- > - -
- -
-
- -
- -
-
- > - -
- - -
- > - -
- -
-
- -

-
- -
- -
-
- > - -
-
-
- -
- -
- - -
-
- -

-
- -
- -
-
- > - -
-
-
- -
- -
- -
-
- -
- -
- - 587 (TLS) or 465 (SSL) -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
-
- -
-
- -
- -

@@ -326,3 +165,4 @@ + diff --git a/system/admin/views/config-comments.html.php b/system/admin/views/config-comments.html.php new file mode 100644 index 00000000..084891c8 --- /dev/null +++ b/system/admin/views/config-comments.html.php @@ -0,0 +1,169 @@ + +

+
+ +

+
+ +

+
+ +
+ +
+
+ + > + +
+ +
+
+ +
+ +
+
+ + > + +
+ + +
+ + > + +
+ +
+
+ +

+
+ +
+ +
+
+ + > + +
+
+
+ +
+ +
+ + +
+
+ +

+
+ +
+ +
+
+ + > + +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ + 587 (TLS) or 465 (SSL) +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
\ No newline at end of file diff --git a/system/admin/views/config-custom.html.php b/system/admin/views/config-custom.html.php index 50d195d6..26388c19 100644 --- a/system/admin/views/config-custom.html.php +++ b/system/admin/views/config-custom.html.php @@ -9,6 +9,9 @@ + + + diff --git a/system/admin/views/config-metatags.html.php b/system/admin/views/config-metatags.html.php index d3c6df8e..21124c80 100644 --- a/system/admin/views/config-metatags.html.php +++ b/system/admin/views/config-metatags.html.php @@ -68,6 +68,9 @@ + + + diff --git a/system/admin/views/config-performance.html.php b/system/admin/views/config-performance.html.php index b6a0ded3..8e06137e 100644 --- a/system/admin/views/config-performance.html.php +++ b/system/admin/views/config-performance.html.php @@ -9,6 +9,9 @@ + + + diff --git a/system/admin/views/config-reading.html.php b/system/admin/views/config-reading.html.php index 64d70973..0b60db7e 100644 --- a/system/admin/views/config-reading.html.php +++ b/system/admin/views/config-reading.html.php @@ -9,6 +9,9 @@ + + + diff --git a/system/admin/views/config-security.html.php b/system/admin/views/config-security.html.php index 55dfe003..564015b6 100644 --- a/system/admin/views/config-security.html.php +++ b/system/admin/views/config-security.html.php @@ -9,6 +9,9 @@ + + + diff --git a/system/admin/views/config-widget.html.php b/system/admin/views/config-widget.html.php index 68ed571c..d9870bac 100644 --- a/system/admin/views/config-widget.html.php +++ b/system/admin/views/config-widget.html.php @@ -9,6 +9,9 @@ + + + @@ -133,7 +136,7 @@
-

+


diff --git a/system/admin/views/config-writing.html.php b/system/admin/views/config-writing.html.php index dd9dcf11..546b1a00 100644 --- a/system/admin/views/config-writing.html.php +++ b/system/admin/views/config-writing.html.php @@ -9,6 +9,9 @@ + + +
diff --git a/system/admin/views/config.html.php b/system/admin/views/config.html.php index c665ce15..b6e1e772 100644 --- a/system/admin/views/config.html.php +++ b/system/admin/views/config.html.php @@ -22,6 +22,9 @@ + + + diff --git a/system/admin/views/layout.html.php b/system/admin/views/layout.html.php index 6df46d26..903a5986 100644 --- a/system/admin/views/layout.html.php +++ b/system/admin/views/layout.html.php @@ -155,7 +155,7 @@

- + 0): ?> @@ -182,15 +182,6 @@

- - - diff --git a/system/configList.json b/system/configList.json index b417257d..f983476d 100644 --- a/system/configList.json +++ b/system/configList.json @@ -23,6 +23,21 @@ "social.tiktok", "breadcrumb.home", "comment.system", + "comments.moderation", + "comments.honeypot", + "comments.jstime", + "comments.notify", + "comments.notifyadmin", + "comments.admin.email", + "comments.salt", + "comments.mail.enabled", + "comments.mail.host", + "comments.mail.username", + "comments.mail.password", + "comments.mail.port", + "comments.mail.encryption", + "comments.mail.from.email", + "comments.mail.from.name", "fb.appid", "fb.num", "fb.color", diff --git a/system/htmly.php b/system/htmly.php index 6ae4e69a..c5c0df48 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -2457,6 +2457,75 @@ } }); +// Show Config page +get('/admin/config/comments', function () { + + $user = $_SESSION[site_url()]['user'] ?? null; + $role = user('role', $user) ?? null; + + if (login()) { + config('views.root', 'system/admin/views'); + if ($role === 'admin') { + render('config-comments', array( + 'title' => generate_title('is_default', i18n('Config')), + 'description' => safe_html(strip_tags(blog_description())), + 'canonical' => site_url(), + 'metatags' => generate_meta(null, null), + 'type' => 'is_admin-config', + 'is_admin' => true, + 'bodyclass' => 'admin-config', + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('Config') + )); + } else { + render('denied', array( + 'title' => generate_title('is_default', i18n('Config')), + 'description' => safe_html(strip_tags(blog_description())), + 'canonical' => site_url(), + 'metatags' => generate_meta(null, null), + 'type' => 'is_admin-config', + 'is_admin' => true, + 'bodyclass' => 'denied', + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('Config') + )); + } + } else { + $login = site_url() . 'login'; + header("location: $login"); + } +}); + +// Submitted Config page data +post('/admin/config/comments', function () { + + $proper = is_csrf_proper(from($_REQUEST, 'csrf_token')) ?? null; + if (login() && $proper) { + $new_config = array(); + $new_Keys = array(); + $user = $_SESSION[site_url()]['user']; + $role = user('role', $user); + if ($role === 'admin') { + foreach ($_POST as $name => $value) { + if (substr($name, 0, 8) == "-config-") { + $name = str_replace("_", ".", substr($name, 8)); + if(!is_null(config($name))) { + $new_config[$name] = $value; + } else { + $new_Keys[$name] = $value; + } + } + } + save_config($new_config, $new_Keys); + $redir = site_url() . 'admin/config/comments'; + header("location: $redir"); + } else { + $redir = site_url(); + header("location: $redir"); + } + } else { + $login = site_url() . 'login'; + header("location: $login"); + } +}); // Show Config page get('/admin/config/performance', function () { @@ -3123,7 +3192,7 @@ 'type' => 'is_admin-comments', 'is_admin' => true, 'bodyclass' => 'admin-comments', - 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('Comments'), + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('comments'), 'tab' => 'all', 'page' => $page, 'comments' => $comments, @@ -3171,7 +3240,7 @@ 'type' => 'is_admin-comments', 'is_admin' => true, 'bodyclass' => 'admin-comments', - 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('Comments') . ' » ' . i18n('Pending'), + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('comments') . ' » ' . i18n('Pending'), 'tab' => 'pending', 'page' => $page, 'comments' => $comments, @@ -3201,7 +3270,7 @@ 'type' => 'is_admin-comments', 'is_admin' => true, 'bodyclass' => 'admin-comments', - 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('Comments') . ' » ' . i18n('Settings'), + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('comments') . ' » ' . i18n('Settings'), 'tab' => 'settings', 'pendingCount' => $pendingCount )); @@ -3304,7 +3373,7 @@ 'type' => 'is_admin-comments', 'is_admin' => true, 'bodyclass' => 'admin-comments', - 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('Comments') . ' » ' . i18n('Edit'), + 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . i18n('comments') . ' » ' . i18n('Edit'), 'editComment' => $editComment, 'pendingCount' => $pendingCount )); diff --git a/system/includes/comments-frontend.php b/system/includes/comments-frontend.php index dfb60ed6..6a4f1ff2 100644 --- a/system/includes/comments-frontend.php +++ b/system/includes/comments-frontend.php @@ -141,7 +141,7 @@ function displayComments($url, $file = null) ?>
- + $value) { - // Ensure null and empty values are saved as empty strings - if ($value === null || $value === '') { - $value = '""'; - } else { - // Encode value - $value = json_encode($value, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); - } - - $map = array('\r\n' => ' \n ', '\r' => ' \n '); - $value = trim(strtr($value, $map)); - - // Escape dots in the key for regex - $escapedWord = str_replace('.', '\.', $word); - - // Try to replace existing line - $pattern = "/^" . $escapedWord . " = .*/m"; - if (preg_match($pattern, $string)) { - $string = preg_replace($pattern, $word . ' = ' . $value, $string); - } else { - // If line doesn't exist, add it at the end - $string = rtrim($string) . "\n" . $word . ' = ' . $value . "\n"; - } - } - - $string = rtrim($string) . "\n"; - $result = file_put_contents($config_file, $string, LOCK_EX); - - // Clear PHP opcache for this file - if (function_exists('opcache_invalidate')) { - opcache_invalidate($config_file, true); - } - - // Clear cache after saving - if ($result !== false) { - comments_config('reload'); - } - - return $result; -} - /** * Get comments file path for a post/page * Replicates content file path inside comments folder @@ -403,14 +321,14 @@ function validateComment($data) } // Validate honeypot (if enabled) - if (comments_config('comments.honeypot') === 'true') { + if (config('comments.honeypot') === 'true') { if (!empty($data['website'])) { $errors[] = 'comment_submission_error_spam'; } } // Validate js and time (if enabled) - minimum 2 seconds, maximum 600 seconds - if (comments_config('comments.jstime') === 'true') { + if (config('comments.jstime') === 'true') { if (!$data['company'] || secondsGenerationSubmit($data['company']) < 3 || secondsGenerationSubmit($data['company']) > 3600) { $errors[] = 'comment_submission_error_spam'; } @@ -464,7 +382,7 @@ function commentInsert($data, $url, $mdfile = null) 'date' => date('Y-m-d H:i:s', $timestamp), 'parent_id' => isset($data['parent_id']) && !empty($data['parent_id']) ? $data['parent_id'] : null, 'notify' => isset($data['notify']) && $data['notify'] === '1', - 'published' => comments_config('comments.moderation') !== 'true', // Auto-publish if moderation disabled + 'published' => config('comments.moderation') !== 'true', // Auto-publish if moderation disabled 'ip' => $_SERVER['REMOTE_ADDR'] ?? 'unknown' ); @@ -514,7 +432,7 @@ function setSubscription($email, $action) { if (!is_dir($subscriptions_dir)) { mkdir($subscriptions_dir); } - $subscription_file = $subscriptions_dir . '/' . encryptEmailForFilename($email, comments_config('comments.salt')); + $subscription_file = $subscriptions_dir . '/' . encryptEmailForFilename($email, config('comments.salt')); $subscription = getSubscription($email); @@ -554,7 +472,7 @@ function setSubscription($email, $action) { // returns array function getSubscription($email) { $subscriptions_dir = 'content/comments/.subscriptions'; - $subscription_file = $subscriptions_dir . '/' . encryptEmailForFilename($email, comments_config('comments.salt')); + $subscription_file = $subscriptions_dir . '/' . encryptEmailForFilename($email, config('comments.salt')); if (!file_exists($subscription_file)) { $subscription['status'] = 'no'; $subscription['date'] = date('Y-m-d H:i:s'); @@ -643,13 +561,13 @@ function sendSubscriptionEmail($email) { // Server settings $mail->isSMTP(); - $mail->Host = comments_config('comments.mail.host'); + $mail->Host = config('comments.mail.host'); $mail->SMTPAuth = true; - $mail->Username = comments_config('comments.mail.username'); - $mail->Password = comments_config('comments.mail.password'); - $mail->Port = comments_config('comments.mail.port'); + $mail->Username = config('comments.mail.username'); + $mail->Password = config('comments.mail.password'); + $mail->Port = config('comments.mail.port'); - $encryption = comments_config('comments.mail.encryption'); + $encryption = config('comments.mail.encryption'); if ($encryption === 'tls') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; } elseif ($encryption === 'ssl') { @@ -658,8 +576,8 @@ function sendSubscriptionEmail($email) { // Recipients $mail->setFrom( - comments_config('comments.mail.from.email'), - comments_config('comments.mail.from.name') + config('comments.mail.from.email'), + config('comments.mail.from.name') ); $mail->addAddress($email); @@ -672,9 +590,9 @@ function sendSubscriptionEmail($email) {

" . i18n('comment_subscribe_thread') . ": ".config('site.url')."

" . i18n('comment_subscribe_request') . " ".config('blog.title')."

" . i18n('comment_subscribe_never_requested') . "

-

" . i18n('comment_subscribe_click') . " " . i18n('comment_subscribe_here') . " " . i18n('comment_subscribe_confirm_message') . "

+

" . i18n('comment_subscribe_click') . " " . i18n('comment_subscribe_here') . " " . i18n('comment_subscribe_confirm_message') . "

 

-

" . i18n('comment_subscribe_unsubscribe_message') . " ".config('blog.title')." " . i18n('comment_subscribe_unsubscribe_anytime') . ": " . i18n('comment_unsubscribe') . ".

+

" . i18n('comment_subscribe_unsubscribe_message') . " ".config('blog.title')." " . i18n('comment_subscribe_unsubscribe_anytime') . ": " . i18n('comment_unsubscribe') . ".

 

"; @@ -840,7 +758,7 @@ function commentModify($file, $commentId, $data) function sendCommentNotifications($url, $newComment, $allComments, $notifyAdmin = true, $notifySubscribers = true) { // Check if mail is enabled - if (comments_config('comments.mail.enabled') !== 'true') { + if (config('comments.mail.enabled') !== 'true') { return; } @@ -848,11 +766,11 @@ function sendCommentNotifications($url, $newComment, $allComments, $notifyAdmin // Add admin email - notify if comments.notifyadmin = "true" OR comments.moderation = "true" if ($notifyAdmin) { - $shouldNotifyAdmin = (comments_config('comments.notifyadmin') === 'true') || - (comments_config('comments.moderation') === 'true'); + $shouldNotifyAdmin = (config('comments.notifyadmin') === 'true') || + (config('comments.moderation') === 'true'); if ($shouldNotifyAdmin) { - $adminEmail = comments_config('comments.admin.email'); + $adminEmail = config('comments.admin.email'); if (!empty($adminEmail) && filter_var($adminEmail, FILTER_VALIDATE_EMAIL)) { $recipients[$adminEmail] = array( 'name' => 'Administrator', @@ -863,7 +781,7 @@ function sendCommentNotifications($url, $newComment, $allComments, $notifyAdmin } // Add subscribers only if notifySubscribers is true AND comments.notify is enabled - if ($notifySubscribers && comments_config('comments.notify') === 'true') { + if ($notifySubscribers && config('comments.notify') === 'true') { // Add parent comment author (if replying) if (!empty($newComment['parent_id'])) { foreach ($allComments as $comment) { @@ -920,13 +838,13 @@ function sendCommentEmail($to, $toName, $url, $comment, $type = 'admin') // Server settings $mail->isSMTP(); - $mail->Host = comments_config('comments.mail.host'); + $mail->Host = config('comments.mail.host'); $mail->SMTPAuth = true; - $mail->Username = comments_config('comments.mail.username'); - $mail->Password = comments_config('comments.mail.password'); - $mail->Port = comments_config('comments.mail.port'); + $mail->Username = config('comments.mail.username'); + $mail->Password = config('comments.mail.password'); + $mail->Port = config('comments.mail.port'); - $encryption = comments_config('comments.mail.encryption'); + $encryption = config('comments.mail.encryption'); if ($encryption === 'tls') { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; } elseif ($encryption === 'ssl') { @@ -935,8 +853,8 @@ function sendCommentEmail($to, $toName, $url, $comment, $type = 'admin') // Recipients $mail->setFrom( - comments_config('comments.mail.from.email'), - comments_config('comments.mail.from.name') + config('comments.mail.from.email'), + config('comments.mail.from.name') ); $mail->addAddress($to, $toName); @@ -945,7 +863,7 @@ function sendCommentEmail($to, $toName, $url, $comment, $type = 'admin') $mail->CharSet = 'UTF-8'; if ($type === 'admin') { - if (comments_config('comments.moderation') === 'true') { + if (config('comments.moderation') === 'true') { $mail->Subject = i18n('comment_email_admin_awaiting') . " - " . config('blog.title'); } else { @@ -967,7 +885,7 @@ function sendCommentEmail($to, $toName, $url, $comment, $type = 'admin')

" . nl2br(htmlspecialchars($comment['comment'])) . "

" . i18n('comment_email_view_comment') . "

 

-

" . i18n('comment_subscribe_unsubscribe_message') . " ".config('blog.title')." " . i18n('comment_subscribe_unsubscribe_anytime') . ": " . i18n('comment_unsubscribe') . ".

+

" . i18n('comment_subscribe_unsubscribe_message') . " ".config('blog.title')." " . i18n('comment_subscribe_unsubscribe_anytime') . ": " . i18n('comment_unsubscribe') . ".

 

"; }