- Posts: 13
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- [Fixed] Google reCAPTCHA v2 bug on reload & Support Language
[Fixed] Google reCAPTCHA v2 bug on reload & Support Language
- Abdulaziz Mierza
- Topic Author
- Offline
- New Member
Less
More
7 years 11 months ago - 7 years 11 months ago #153927
by Abdulaziz Mierza
[Fixed] Google reCAPTCHA v2 bug on reload & Support Language was created by Abdulaziz Mierza
Hi Everyboy,
This Topis for improve our beautiful K2 :
1-bug in reCAPTCHA v2 on release version of K2 which is :
After accept comment & reload page >> reCAPTCHA not will shown
2-Add Suuport Joomla Language > for example if you using Germany language for joomla , its will show reCAPTCHA Germany from Google
PLease Replace these code in (Note this example only for comments, you can replace for other) :
[your joomla folder]/components/com_k2/views/item/view.html.php
FIND :
REPLACE WITH :
NOTE :
YOU CAN USED FOR ANOTHER FILE LIKE : [your joomla folder]/plugins/system/k2/k2.php
You can download the PHP file from link (ONLY FOR [your joomla folder]/components/com_k2/views/item/view.html.php):
www.dropbox.com/s/etao09vvx2cb5cl/view.html.php?dl=0
This Topis for improve our beautiful K2 :
1-bug in reCAPTCHA v2 on release version of K2 which is :
After accept comment & reload page >> reCAPTCHA not will shown
2-Add Suuport Joomla Language > for example if you using Germany language for joomla , its will show reCAPTCHA Germany from Google
PLease Replace these code in (Note this example only for comments, you can replace for other) :
[your joomla folder]/components/com_k2/views/item/view.html.php
FIND :
if($params->get('recaptchaV2')) {
$document->addScript('https://www.google.com/recaptcha/api.js?onload=onK2RecaptchaLoaded&render=explicit');
$js = 'function onK2RecaptchaLoaded(){grecaptcha.render("recaptcha", {"sitekey" : "'.$item->params->get('recaptcha_public_key').'"});}';
$document->addScriptDeclaration($js);
$this->recaptchaClass = 'k2-recaptcha-v2';
}
REPLACE WITH :
if($params->get('recaptchaV2')) {
$document->addScript('https://www.google.com/recaptcha/api.js?hl=' . JFactory::getLanguage()
->getTag() . '&onload=onK2RecaptchaLoaded&render=explicit');
$js = 'function onK2RecaptchaLoaded(){grecaptcha.render("recaptcha", {"sitekey" : "'.$item->params->get('recaptcha_public_key').'"});}
$K2(window).load(function() {
onK2RecaptchaLoaded();
});
';
$document->addScriptDeclaration($js);
$this->recaptchaClass = 'k2-recaptcha-v2';
}
NOTE :
YOU CAN USED FOR ANOTHER FILE LIKE : [your joomla folder]/plugins/system/k2/k2.php
You can download the PHP file from link (ONLY FOR [your joomla folder]/components/com_k2/views/item/view.html.php):
www.dropbox.com/s/etao09vvx2cb5cl/view.html.php?dl=0
Last edit: 7 years 11 months ago by Abdulaziz Mierza.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 11 months ago #153942
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic [Fixed] Google reCAPTCHA v2 bug on reload & Support Language
Hello Abdulaziz,
Thank you for sharing this, can you make a PR in Github so we evaluate this?
Thank you for sharing this, can you make a PR in Github so we evaluate this?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Abdulaziz Mierza
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
7 years 11 months ago #153952
by Abdulaziz Mierza
Replied by Abdulaziz Mierza on topic [Fixed] Google reCAPTCHA v2 bug on reload & Support Language
Please Log in or Create an account to join the conversation.
- STEPHAN HERBY
- Offline
- Premium Member
Less
More
- Posts: 92
7 years 6 months ago #157795
by STEPHAN HERBY
Replied by STEPHAN HERBY on topic [Fixed] Google reCAPTCHA v2 bug on reload & Support Language
Hi K2 afficionados :)
Just a little thank to Abdulaziz who helped me make working my Captcha with this topic :)
Just a little thank to Abdulaziz who helped me make working my Captcha with this topic :)
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 6 months ago #157806
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic [Fixed] Google reCAPTCHA v2 bug on reload & Support Language
Yes, it was very nice of him to contribute.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- [Fixed] Google reCAPTCHA v2 bug on reload & Support Language