Roundcube Community Forum

 

New reCAPTCHA plugin

Started by dennylin93, February 06, 2010, 08:19:05 AM

Previous topic - Next topic

dennylin93

#15
Hmm, looks like there's a problem with the method I'm using to insert the reCAPTCHA code.

Can you post the plugins you're using (in the order listed in the config) as well as a copy of the HTML code from your browser?

lumen

#16

Makc666

#17
Quote from: lumen;28560Do you have any ideas?

In this code:




     




You have these two HTML tags at one line:


In rcguard.php the code:
    $tmp str_ireplace('</tbody>',
      
'<tr><td class="title"><div id="rcguard"><div id="recaptcha">' $script '</div></div>
</td>
</tr>
</tbody>'
$tmp);


searches for single HTML tag:


You have two ways:

  • Edit plugin's files rcguard.php
  • Edit your index.php file
Why this happened?
I think because you had made incorrect changes in your file:
skins/default/templates/login.html
...... ...... "А стукачков мы не любим!"

Makc666

#18
Quote from: lacri;25411to change language in capchta
edit rcguard.js

and replace
var RecaptchaOptions = {
  
theme 'white'
};
with
var RecaptchaOptions = {
  
theme 'white',
  
lang 'de'
};
de for German

see here for more options
reCAPTCHA API Documentation

There is another magic method to do this one.
And it has to be included in the plugin by default.

  • Open file:
rcguard.php

  • Find line:
$this->include_script('rcguard.js');

  • Replace with:
    if($_SESSION['language']){
        if(
is_readable('localization/' $_SESSION['language'] . '.js')){
            
$this->include_script('localization/' $_SESSION['language'] . '.js');
        }else{
            
$this->include_script('rcguard.js');
        }
    }else{
        
$this->include_script('rcguard.js');
    }


  • Open plugins localization folder and add *.js files for your languages.

    For example:
    • ru_RU.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'ru'
      };

    • de_DE.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'de'
      };

...... ...... "А стукачков мы не любим!"

Makc666

Quote from: lacri;25411to change language in capchta
edit rcguard.js

and replace
var RecaptchaOptions = {
  
theme 'white'
};
with
var RecaptchaOptions = {
  
theme 'white',
  
lang 'de'
};
de for German

see here for more options
reCAPTCHA API Documentation

There is another magic method to do this one.
And it has to be included in the plugin by default.

  • Open file:
rcguard.php

  • Find line:
$this->include_script('rcguard.js');

  • Replace with:
    if($_SESSION['language']){
        if(
is_readable('localization/' $_SESSION['language'] . '.js')){
            
$this->include_script('localization/' $_SESSION['language'] . '.js');
        }else{
            
$this->include_script('rcguard.js');
        }
    }else{
        
$this->include_script('rcguard.js');
    }


  • Open plugins localization folder and add *.js files for your languages.

    For example:
    • ru_RU.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'ru'
      };

    • de_DE.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'de'
      };

...... ...... "А стукачков мы не любим!"

Makc666

Quote from: lacri;25411to change language in capchta
edit rcguard.js

and replace
var RecaptchaOptions = {
  
theme 'white'
};
with
var RecaptchaOptions = {
  
theme 'white',
  
lang 'de'
};
de for German

see here for more options
reCAPTCHA API Documentation

P.S. Delete my previous bad post(s) regarding this problem. Thanks.

There is another magic method to do this one.
And it has to be included in the plugin by default.

  • Open file:
rcguard.php

  • Find line:
$this->include_script('rcguard.js');

  • Replace with:
    if($_SESSION['language']){
        if(
is_readable(slashify(realpath(slashify($this->home))) . '/localization/' $_SESSION['language'] . '.js')){
            
$this->include_script('localization/' $_SESSION['language'] . '.js');
        }else{
            
$this->include_script('rcguard2.js');
        }
    }else{
        
$this->include_script('rcguard.js');
    }


  • Open plugins localization folder and add *.js files for your languages.

    For example:
    • ru_RU.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'ru'
      };

    • de_DE.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'de'
      };

...... ...... "А стукачков мы не любим!"

Makc666

Quote from: lacri;25411to change language in capchta
edit rcguard.js

and replace
var RecaptchaOptions = {
  
theme 'white'
};
with
var RecaptchaOptions = {
  
theme 'white',
  
lang 'de'
};
de for German

see here for more options
reCAPTCHA API Documentation

P.S. Please, delete my others post above regadiing the patch described in this thread.

There is another magic method to do this one.
And it has to be included in the plugin by default.

  • Open file:
rcguard.php

  • Find line:
$this->include_script('rcguard.js');

  • Replace with:
    if($_SESSION['language']){
        if(
is_readable(slashify(realpath(slashify($this->home))) . '/localization/' $_SESSION['language'] . '.js')){
            
$this->include_script('localization/' $_SESSION['language'] . '.js');
        }else{
            
$this->include_script('rcguard.js');
        }
    }else{
        
$this->include_script('rcguard.js');
    }


  • Open plugins localization folder and add *.js files for your languages.

    For example:
    • ru_RU.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'ru'
      };

    • de_DE.js
      var RecaptchaOptions = {
        theme : 'white',
        lang : 'de'
      };

...... ...... "А стукачков мы не любим!"

mattfox27

#22
this plugin kills my ability to show inline html images and attachments?????

I think i got it to work i downloaded and reinstalled it from the above link and it worked the files from the repository didn't work right...weird