From 73ca1eaa043fabe52d446a3eee77a2c712cd9ed3 Mon Sep 17 00:00:00 2001 From: popcorner <6312791+popcorner@users.noreply.github.com> Date: Wed, 13 Nov 2019 21:52:17 +0800 Subject: [PATCH] 1.0.1 --- ...=> discuz_plugin_cdc_recaptcha_SC_GBK.xml} | 6 +- .../discuz_plugin_cdc_recaptcha_SC_UTF8.xml | 154 ++++++++++++++++++ .../discuz_plugin_cdc_recaptcha_TC_BIG5.xml | 154 ++++++++++++++++++ .../discuz_plugin_cdc_recaptcha_TC_UTF8.xml | 154 ++++++++++++++++++ cdc_recaptcha/seccode/seccode_recaptcha.php | 9 +- .../template/{captcha.js => captchaSC.js} | 0 cdc_recaptcha/template/captchaTC.js | 26 +++ 7 files changed, 496 insertions(+), 7 deletions(-) rename cdc_recaptcha/{discuz_plugin_cdc_recaptcha.xml => discuz_plugin_cdc_recaptcha_SC_GBK.xml} (97%) create mode 100644 cdc_recaptcha/discuz_plugin_cdc_recaptcha_SC_UTF8.xml create mode 100644 cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_BIG5.xml create mode 100644 cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_UTF8.xml rename cdc_recaptcha/template/{captcha.js => captchaSC.js} (100%) create mode 100644 cdc_recaptcha/template/captchaTC.js diff --git a/cdc_recaptcha/discuz_plugin_cdc_recaptcha.xml b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_SC_GBK.xml similarity index 97% rename from cdc_recaptcha/discuz_plugin_cdc_recaptcha.xml rename to cdc_recaptcha/discuz_plugin_cdc_recaptcha_SC_GBK.xml index 6cc193c..3720c1f 100644 --- a/cdc_recaptcha/discuz_plugin_cdc_recaptcha.xml +++ b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_SC_GBK.xml @@ -2,7 +2,7 @@ - + @@ -14,7 +14,7 @@ - + @@ -36,7 +36,7 @@ +4 = recaptcha.google.cn(中国服务域名,直通谷歌中国,但中国大陆以外用户影响未知)]]> diff --git a/cdc_recaptcha/discuz_plugin_cdc_recaptcha_SC_UTF8.xml b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_SC_UTF8.xml new file mode 100644 index 0000000..f5b785d --- /dev/null +++ b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_SC_UTF8.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_BIG5.xml b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_BIG5.xml new file mode 100644 index 0000000..4fdaffd --- /dev/null +++ b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_BIG5.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_UTF8.xml b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_UTF8.xml new file mode 100644 index 0000000..2b8f99b --- /dev/null +++ b/cdc_recaptcha/discuz_plugin_cdc_recaptcha_TC_UTF8.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cdc_recaptcha/seccode/seccode_recaptcha.php b/cdc_recaptcha/seccode/seccode_recaptcha.php index 18fa951..5ceba90 100644 --- a/cdc_recaptcha/seccode/seccode_recaptcha.php +++ b/cdc_recaptcha/seccode/seccode_recaptcha.php @@ -1,8 +1,8 @@ '; + echo ''; $gdomain = $_G['cache']['plugin']['cdc_recaptcha']['domain']; $gdomain = $gdomain?intval($gdomain):2; $return[0] = $this->domainlist[$gdomain]; @@ -50,7 +50,8 @@ public function make($idhash) { $return[5] = intval($_G['cache']['plugin']['cdc_recaptcha']['tabindex']); $return[6] = $_G['cache']['plugin']['cdc_recaptcha']['refresh']?true:false; $return[7] = $_G['cache']['plugin']['cdc_recaptcha']['hlang']; - echo ''; + require_once DISCUZ_ROOT.'./source/plugin/mobile/json.class.php'; + echo ''; } } } diff --git a/cdc_recaptcha/template/captcha.js b/cdc_recaptcha/template/captchaSC.js similarity index 100% rename from cdc_recaptcha/template/captcha.js rename to cdc_recaptcha/template/captchaSC.js diff --git a/cdc_recaptcha/template/captchaTC.js b/cdc_recaptcha/template/captchaTC.js new file mode 100644 index 0000000..1ed3570 --- /dev/null +++ b/cdc_recaptcha/template/captchaTC.js @@ -0,0 +1,26 @@ +(function () { + var idhash = $('recptc').className; + var showid = 'seccode_' + idhash; + if (BROWSER.ie && BROWSER.ie < 10) { + $('v' + showid).innerHTML = '\u60a8\u7684\u700f\u89bd\u5668\u7248\u672c\u904e\u4f4e\uff0c\u7121\u6cd5\u8f09\u5165reCAPTCHA\u9a57\u8b49\u78bc\uff0c\u5efa\u8b70\u4f7f\u7528\u975eIE\u700f\u89bd\u5668\u3002'; + } else { + var data = JSON.parse($('recptc').innerHTML); + appendscript('https://' + data[0] + '/recaptcha/api.js' + (data[7] ? '?hl=' + data[7] : ''), '', 1); + + var sectpl = seccheck_tpl[idhash] != '' ? seccheck_tpl[idhash].replace(//g, 'code' + idhash).replace(/_menu/g, '_hidden') : ''; + var sectplcode = sectpl != '' ? sectpl.split('') : Array('
', ': ', '
', ''); + var addi = ''; + if (data[3]) { + addi += ' data-theme="dark"'; + } + if (data[4]) { + addi += ' data-size="compact"'; + } + if (data[5]) { + addi += 'data-tabindex="' + data[5] + '"'; + } + var grecaptcha = '
Google reCAPTCHA\u9a57\u8b49\u78bc
'; + var string = sectplcode[0] + data[1] + sectplcode[1] + grecaptcha + (data[6] ? '\u5237\u65b0' : '') + sectplcode[2] + sectplcode[3]; + $(showid).innerHTML = string; + } +})() \ No newline at end of file