Advertisement
vitnet

recaptcha

Apr 30th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.85 KB | None | 0 0
  1. 1.0 Откройте файл engine/ajax/fast.reg.php
  2.  
  3. найдите
  4.  
  5.             $tpl->set( '{recaptcha}', "<div class=\"g-recaptcha\" data-sitekey=\"{$config['recaptcha_public_key']}\" data-theme=\"{$config['recaptcha_theme']}\"></div><script src='https://www.google.com/recaptcha/api.js?hl={$lang['wysiwyg_language']}' async defer></script>" );
  6.  
  7. замените на
  8.  
  9.             $tpl->set( '{recaptcha}', "<div id=\"reg_recaptcha\"></div><script src=\"https://www.google.com/recaptcha/api.js?onload=Callback&render=explicit&hl={$lang['wysiwyg_language']}\"></script><script type=\"text/javascript\">
  10. var recaptcha;
  11. var Callback = function() {
  12.     recaptcha = grecaptcha.render('reg_recaptcha', {
  13.         'theme': '{$config['recaptcha_theme']}',
  14.         'sitekey': '{$config['recaptcha_public_key']}'
  15.     });
  16. };
  17. </script>" );
  18.  
  19. 2.0 Откройте файл engine/modules/show.full.php
  20.  
  21. найдите
  22.  
  23.                 $tpl->set( '{recaptcha}', "<div class=\"g-recaptcha\" data-sitekey=\"{$config['recaptcha_public_key']}\" data-theme=\"{$config['recaptcha_theme']}\"></div>" );
  24.  
  25. замените на
  26.  
  27.                 $tpl->set( '{recaptcha}', "<div id=\"com_recaptcha\"></div><!--div class=\"g-recaptcha\" data-sitekey=\"{$config['recaptcha_public_key']}\" data-theme=\"{$config['recaptcha_theme']}\"></div-->" );
  28.  
  29. далее найти
  30.  
  31.             $tpl->copy_template .= <<<HTML
  32. <script src="https://www.google.com/recaptcha/api.js?hl={$lang['wysiwyg_language']}"></script>
  33. HTML;
  34.  
  35. замените на
  36.  
  37.             $tpl->copy_template .= <<<HTML
  38. <script src="https://www.google.com/recaptcha/api.js?onload=Callback&render=explicit&hl={$lang['wysiwyg_language']}"></script>
  39. <script type="text/javascript">
  40. var recaptcha;
  41. var Callback = function() {
  42.     recaptcha = grecaptcha.render('com_recaptcha', {
  43.         'theme': '{$config['recaptcha_theme']}',
  44.         'sitekey': '{$config['recaptcha_public_key']}'
  45.     });
  46. };
  47. </script>
  48. HTML;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement