Forums / Cotonti / Extensions / Support / Add mCaptcha to contactus plugin

Could use a little help

foxhound
#1 2009-08-29 19:25
I am trying to add mcaptcha to the contactus plugin which was originally made for seditio but works without problems in Cotonti as well.

I have added the following to the contactus.php:
// Add mcaptcha to contactus
$t->assign(array(   'CONTACTUS_MCAPTCHA' => mcaptcha_generate(),
		  'CONTACTUS_VERIFY' => '<input type="text" name="rverify" size="4" />',));

$rverify = sed_import('rverify', 'P', 'INT');
if(!sed_captcha_validate($rverify))
	{   
		$error_string .= $L['captcha_wrong'].'<br />';
	}


Than I tried to add it to the form itself but that is where I am stuck (yes, I know, I am a php noob :( )

// adding captcha
$plugin_body .= "<tr><td>".$L['plu_contactcaptcha'].": </td><td>\n;
$plugin_body .= "{CONTACTUS_MCAPTCHA}\n";
$plugin_body .= "<tr><td>".$L['plu_contactcaptcha'].": </td><td>\n;
$plugin_body .= "{CONTACTUS_VERIFY}\n";

// end captcha

I realise it wont work with the tags now in php so I tried to copy how the forum was build with other parts of the contactus plugins, changing it to the mcaptcha variables etc but I keep just getting php errors when I try to acces the contactus page.
If someone can help me on this that would be appreciated :)
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
esclkm
#2 2009-08-29 19:27
Please download mcaptcha for cotonti.
You can find it on this site.
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
foxhound
#3 2009-08-29 19:50
Ehm, yes that is what I am trying to add to contactus.

mcaptcha for Cotonti is installed and working on my test site. Now I wanted to add it to the contactus plugin as well. I assumed I had to add the code as specified on the download page.
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
esclkm
#4 2009-08-29 20:00
what kind of contact us do you use?
please show me screen
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
foxhound
#5 2009-08-29 20:21
This is the one



And if you want to see the plugin, I uploaded it to my site so you can see for yourself :)
- Contactus plugin
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
esclkm
#6 2009-08-29 20:30
I ask it because contactus from ratibor is not working with captcha's
If you can you may translate in translate.google.com my article : http://www.cotonti.com/docs/ru/misc/231
In which I show how to integate different types of captchas in you plugin. As exaple was - the simplest contactus
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
foxhound
#7 2009-08-29 21:19
Thanks for that link. That was very usefull. However there is one thing which I do not completely understand. The code as laid out on theat page is not exactly how you added it to the example plugin (the one you can dowload at the end of that page).
So, its a bit confusing for a noob like me :)

Anyway, I just installed the plugin version you provide there and seems to work perfectly, thanks a lot!! :)


[edit]
I assume I can not use the Captcha manager with this plugin version which I downloaded from that tutorial page right?
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
This post was edited by foxhound (2009-08-29 21:25, 14 years ago)
esclkm
#8 2009-08-29 21:29
Yes! manager used only when you need to use on your site more than one captcha
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
foxhound
#9 2009-08-29 22:34
Ok, I understand.

Thanks for all the help!!
On to the next plugins :)
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />