MyWackoSite: WackoWikiRecaptchaen ...

Home Page | Каталог | Изменения | НовыеКомментарии | Пользователи | Регистрация | Вход:  Пароль:  
Оглавление документа

1. Install reCaptcha on Wacko Wiki R4.2


1. Go to http://recaptcha.net, register yourself, receive private and public keys for your domain and download library with php-source.
Copy this library to your server, extract. Keep in mind path to file 'recaptchalib.php'.

2. Go to the Wacko Wiki home directory and edit file «actions/registration.php».
Edit file «actions/registration.php»
In the very begining, before the lines:



You should add the following:



Next, search the lines:



and add right after them:



3. And now you may add reCaptcha form itself right after lines:



(here the source of reCaptcha form itself)



4. Now it should work. Enjoy!

2. Possible problems and solutions

2.1. Problems with global variables in reCaptcha library


After the integration reCaptcha in Wacko Wiki you may find that it doesn't work. Possible reason may be the next: global variables in are not visible 'recaptchalib.php'. So, you may do the following:

1. Comment out global variables in the source of library and their use with operator Global.

2. Copy these variables in every function where they were used.

Let's try to understand the reasons of such behavior of library ReCaptcha after it was built into Wacko Wiki.
First, the file wacco.php is launched with its parameters. Inside it the object of class “Wacko” and then function of this object Run() is launched.
In its tern function Run() launches lots of other functions and one of them – registration.php – includes ReCaptcha library.
But function include() here just inserts the source of reCaptcha library inside the function, so all variables which were declared as Global in fact are Local inside this function.
So there are no Global variables with this names.

2.2. Problems with reCaptcha and Opera-browser


In some cases valid html-source is very necessary for Opera (You may check validity of web page on http://w3c.org ). After installation of reCaptcha source started not to be valid and its become impossible to register ith the help of Opera. Solution: make the source valid:

1. Open file 'recaptchalib.php' and rewrite all html-tags in accordance with xhtml 1.0. In particular you should close tags which come in pairs. (for example: use tag <br/> instead of <br>).

2. Error in some formatters in Wacko Wiki. “Wacko wiki”-engine adds <p> and </p> tags around the form of registration. Solution: open file «handlers\page\show.php”, search for the line:



and substitute it for


3. Extra: diff-files


You may install reCaptcha with patch-applet using the following diff-files:
“recaptchalib.php”
-problems with global variables and fitness for xhtml 1.0.



«handlers/page/show.php»



«actions/registration.php»
Don't forget to fill up the keys.


4. Script for automatic install

Can be found here: http://swsoft.nsu.ru/~abaturin/recaptcha_install.tar.gz
Install: extract to somewhere and read readme.txt.

5. Links

WackoWiki site: http://wackowiki.com/
ReCapture site: http://recaptcha.net/
Russian version of this article: http://swsoft.nsu.ru/WackoWiki/WackoWikiRecaptcha






 
Файлов нет. [Показать файлы/форму]
Комментариев нет. [Показать комментарии/форму]