Форуми / Cotonti / Extensions / Math Captcha

ToM
#1 26.07.2010 01:44
Hello,

I have one question about MCaptcha. For registration everything works great so I have wanted add the mcaptcha to forum newtopic. I have though it works as plug-in so I add files to plug-in.

mcaptcha.newtopic.tags.php and mcaptcha.newtopic.validate.php

and edit them as:

Code=mcaptcha
Part=newtopic.tags
File=mcaptcha.newtopic.tags
Hooks=forums.newtopic.tags
Tags=forums.newtopic.tpl:{USERS_REGISTER_VERIFYIMG},{USERS_REGISTER_VERIFYINPUT}
Order=10

and

Code=mcaptcha
Part=newtopic.validate
File=mcaptcha.newtopic.validate
Hooks=forums.newtopic.add.first
Tags=
Order=10

{USERS_REGISTER_VERIFYIMG} and {USERS_REGISTER_VERIFYINPUT} are present in forum.newtopic.tpl (is green in admin tool)
and plug0in was uninstaled / reinstalled but hooks doesn't work.

Is there possibility to use this plug-in like that or not?
Have I insert captcha code to forum site or plug-in is enough?

Every tips are welcome, thank.
Salvation is the gift but sometimes is to hard for us to acknowledge it.
esclkm
#2 26.07.2010 03:24
Sources of your units pls
littledev.ru - мой маленький зарождающийся блог о котонти.
снижение стоимости программирования и снижение стоимости производства разные вещи. Первое можно скорее сравнить с раздачей работникам дешевых инструментов, чем со снижением зарплаты
Xerora
#3 26.07.2010 03:52
The hook "forums.newtopic.add.first" doesn't exist. Change it to "forums.newtopic.newtopic.first" and you should be golden :)
ToM
#4 26.07.2010 05:57
Thank Xerora I tried but no any result.

Also thank esclkm,
Here is my two added files (they are just cloned of original mcaptcha.register.tags.php and mcaptcha.register.validate.php files with edited header)

mcaptcha.newtopic.tags_843.txt
mcaptcha.newtopic.validate_843.txt

Maybe there is no possibilities to run the plug-in like that but I want to add MCaptcha to more pages like add post or login etc. so I'm finding the easiest way.

Thank you very much
Salvation is the gift but sometimes is to hard for us to acknowledge it.
Xerora
#5 26.07.2010 07:58
Everything is correct but check the following:

- That the tags are inside <form></form>
- That the tags are before <input type="submit" />
- That the tags are NOT inside ANY <!-- --> comment blocks ( other than the MAIN one ).

These tags are defined specifically inside the script to be parsed inside certain comment blocks. These tags in this script should only need to be within <!-- BEGIN: MAIN --> and <!-- END: MAIN --> but not within any other blocks.

Also, the validate file you linked does NOT reflect the changes to the hook I said above.

Відредаговано: Xerora (26.07.2010 08:27, 13 років тому)
Trustmaster
#6 26.07.2010 14:08
I have nothing to add to Xerora's notes except that I'd recommend renaming tags for clarity a bit: {FORUMS_NEWTOPIC_VERIFYIMG}, {FORUMS_NEWTOPIC_VERIFYINPUT}. But the input should at least show up if those tags are in their place.
May the Source be with you!
ToM
#7 26.07.2010 17:32
I bless you, thank you very much it was:
---------
"- That the tags are NOT inside ANY <!-- --> comment blocks ( other than the MAIN one )."

issue (and the .add.firs ofc).
---------

So there is no possibility to add this plug-in captcha into ANY <!-- -->?
e.g. forum.posts.tpl has its form into <!-- --> so I have to move the <!--END--> up?
like this case:

<!-- BEGIN: FORUMS_POSTS_NEWPOST -->

<!-- BEGIN: FORUMS_POSTS_NEWPOST_ERROR -->
<div class="error">
{FORUMS_POSTS_NEWPOST_ERROR_MSG}
</div>
<!-- END: FORUMS_POSTS_NEWPOST_ERROR -->

<form action="{FORUMS_POSTS_NEWPOST_SEND}" method="post" name="newpost">
<div style="width:100%;">{FORUMS_POSTS_NEWPOST_TEXTBOXER}</div>

<!-- END: FORUMS_POSTS_NEWPOST -->
<CENTER>
{FORUMS_POSTS_VERIFYIMG}
{FORUMS_POSTS_VERIFYINPUT}
</CENTER>
<div class="valid"><input type="submit" value="{PHP.L.Reply}" /></div>
</form>

This line " <!-- END: FORUMS_POSTS_NEWPOST -->" should be (or is in original) after </form> but for Captcha functionality I had to move up before captcha VERIFYMG.

Is it the correct solution? or there is a better ? If I need to put captcha into <!-- --> I have to implement its (captcha) code to a main PHP e.g. forum.posts.inc.php?

Thank you very much.
Salvation is the gift but sometimes is to hard for us to acknowledge it.
Trustmaster
#8 26.07.2010 23:23
Use forums.posts.newpost.tags instead of forums.posts.tags
May the Source be with you!
ToM
#9 27.07.2010 01:06
You are no so far form genius Tee :)) , Thank you very much it works great.
also thank Xerora and esclkm :)
Salvation is the gift but sometimes is to hard for us to acknowledge it.