Go Back   Mosets Community > Third party Developers, Addons and Services for Mosets components > 3rd party addons & Custom Jobs

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-16-2009, 10:54 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default reCAPTCHA on Mosets 2.1.2+3 and Joomla 1.5.x

Ok I've started a new thread on this since the old thread isnt valid for users of Mosets 2.1.2 and Joomla 1.5.x

I've managed to get reCAPTCHA working on the Contact owner, Report Listing, Recommend and Claim pages of Mosets 2.1.2+3

Requirements

This requires registration and API key from the reCAPTCHA website and download the zip file.

Get your keys here http://recaptcha.net/

Get your zip file from here

http://code.google.com/p/recaptcha/d...:phplib-Latest

Documentation is here

http://recaptcha.net/apidocs/captcha/client.html

Register and obtain your API keys. Keep this information handy and dont lose it.


Here is the code I used to place in the tpl.php pages. This will display the reCAPTCHA on your page

<?php
require_once('captcha/recaptchalib.php');
$publickey = "Place your publickey here"; // you got this from the signup page
echo recaptcha_get_html($publickey);

?>

Example:

<?php
require_once('captcha/recaptchalib.php');
$publickey = "6Lf1bAkBGT#&FR7LeYIkjth61T5n-BpmpXI3IHMa"; // you got this from the signup page
echo recaptcha_get_html($publickey);

?>

Themes

You can place in the .tpl.php file there is a script option which changes the theme and way it looks on your page.

Place this script very top of the tpl.php page above all else.

<script type= "text/javascript">
var RecaptchaOptions = {
theme: 'clean'
};
</script>

Theme options are 'red' | 'white' | 'blackglass' | 'clean' | 'custom'

For the purpose of the example we have used 'clean'

Code to be placed in mtree.php file

For the reCAPTCHA to check and validate the code entered this code needs to be placed correctly with respect to the tpl.php file you have modified with the reCAPTCHA code.

This is the code I use.

// Start of Recaptcha

require_once('recaptchalib.php');
$privatekey = "same as above example place your private key here";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
echo "<script>alert (\"".JText::_( 'Wrong recaptcha code. Please go back and try again' )."\"); window.history.go(-1);</script>";
exit(0);
}

// End of recaptcha

In the following examples I will detail how to add these codes for the contact owner form.

Last edited by Lenfitz; 02-18-2010 at 09:42 PM.
Reply With Quote
  #2  
Old 11-16-2009, 11:30 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default reCAPTCHA Contact Owner Page

First and foremost I strongly recommend you back up any and all pages you are going to modify in case something goes wrong!!

Step1. From the Library folder that you downloaded in your zip file.

Create a folder in your public html called "captcha". Place the file called recaptchalib.php in the captcha folder.

Also place the file named recaptchalib.php in your mtree folder and m2 folder along with your tpl.php files

Step 2. Locate and open your Contact Owner page.

/components/com_mtree/templates/m2/page_contactOwner.tpl.php

If you wish to use a theme insert this script at the very top of the page, if not leave it out.

<script type= "text/javascript">
var RecaptchaOptions = {
theme: 'clean'
};
</script>

Next

These are the lines above and below where you need to insert this code. Only add the bolded code to this area.

<tr><td colspan="2"><b><?php echo JText::_( 'Message' ) ?>:</b></td></tr>
<tr><td colspan="2"><textarea name="message" rows="8" cols="69" class="inputbox"></textarea></td></tr>
<tr>

<td colspan="2">

<?php
require_once('captcha/recaptchalib.php');
$publickey = "with your public key inserted here"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>


<input type="hidden" name="option" value="<?php echo $this->option ?>" />
<input type="hidden" name="task" value="send_contact" />
<input type="hidden" name="link_id" value="<?php echo $this->link->link_id ?>" />


Save your page. If done correctly you should have a captcha visible on your contact owner page at this point.

Step 3. Insert checking code into mtree.php
Locate your mtree.php file.. components/com_mtree/mtree.php

Open to edit mtree.php

For Contact Owner section go to line 3417

Insert the bold code here

echo _NOT_EXIST;

} else {

// Beginning of recaptcha
require_once('recaptchalib.php');
$privatekey = "Remember to place your private key here";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
echo "<script>alert (\"".JText::_( 'Wrong recaptcha code. Please go back and try again' )."\"); window.history.go(-1);</script>";
exit(0);
}

// End of recaptcha


$your_name = JRequest::getVar( 'your_name', '', 'post');
$your_email = JRequest::getVar( 'your_email', '', 'post');


You should now have a working reCAPTCHA on your contact owners page.

This procedure is the same for Recommend, Claim and Report tpl.php pages except you will need to locate in mtree precisely which line corresponds to Recommend, Claim, Report. Look for the "// Check for request forgeries" section of each and place after

echo _NOT_EXIST;

} else {

>>> Place start of code here.

Last edited by Lenfitz; 11-16-2009 at 01:04 PM.
Reply With Quote
  #3  
Old 11-16-2009, 12:24 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Here are the modified Contact Owner, Recommend, Report and claim tpl.php files to display reCAPTCHA.

You will need to open them up and place your public key in the "place your public key here" section. Also you will need to point them in the direction of your folder you place your recaptchalib.php

If you decide to place the recaptchalib.php file elsewhere you can do this and point the tpl.php and mtree.php files to that folder.

You can find the .tpl.php files in this location on your site,

/components/com_mtree/templates/m2


Example:

If I create a folder in the public html folder called "captcha" I would point this code here

require_once('captcha/recaptchalib.php');


Good luck. If you need more help just post here.
Attached Files
File Type: php page_claim.tpl.php (1.6 KB, 20 views)
File Type: php page_contactOwner.tpl.php (2.4 KB, 22 views)
File Type: php page_recommend.tpl.php (2.9 KB, 13 views)
File Type: php page_report.tpl.php (2.6 KB, 17 views)

Last edited by Lenfitz; 03-21-2010 at 01:33 PM.
Reply With Quote
  #4  
Old 02-07-2010, 01:19 PM
karenbanting karenbanting is offline
Mosets'd
 
Join Date: Jan 2010
Location: Australia
Posts: 9
Default Re: Captcha for Mosets Tree 2.1.2 - Does it still work for latest version 2.1.3?

Hi,
Do the fixes that you have very kindly supplied for MT 2.12 still work with the latest version? If not, does anyone else have a solution?

I came across this post by accident, and being as I'm still setting up Mosets on our site I had no idea that MT was missing Captcha!!! (I assumed it was included until now as it's such a BASIC REQUIREMENT - I found this post after reading articles about some MT sites have been spammed so much their web hosts are threatening to shut down their sites... so this is not a small issue & I'm disgusted it still hasn't been addressed).
But I've just checked my MT version 2.1.3 and.....I AM TOTALLY STUNNED THAT THIS ESSENTIAL FEATURE IS STILL MISSING.... SAME GOES FOR THE MISSING PAYMENT PROCESSING, missing Documentation etc..... Crikey, it seems almost all the essential features for a commercial directory are totally absent - if I'd have known before purchasing MT I doubt very much I would have bought it.

When are the developers going to incorporate these essential features? Can we please have some answers & a road map of where this product is heading? And a time-frame too (and please, no verbal attacks from any trolls who seem to attack anyone who dare complain in this forum please - after paying $120 I think I'm allowed to complain about missing documentation, payment system & captcha missing from a commercial extension..... ) . Oh, and for the record, documentation doesn't need a full time team or months to create.... perhaps that explains why free & part-time developers manage to provide it....
Reply With Quote
  #5  
Old 02-07-2010, 05:30 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Hi Karen, I'll check to see if the 2.12 files i've supplied are usable for 2.13. If not i'll update them for you.

Hang in there a day or so.



Also I think the payments plus system may have been updated already.

http://forum.mosets.com/showthread.php?t=9944

Check with Tradewise regarding payments plus as its his add-on.
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 02-07-2010 at 10:27 PM.
Reply With Quote
  #6  
Old 02-07-2010, 07:36 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default Updated 2.13 files.

Here are the 2.13 files.

Same as above with mtree.php although the lines the validation code needs to be inserted may have altered due to updated code changing the line placement. The same still applies with respect to each of the claim, contactowner, recommend, report in the mtree.php file.

You can find the .tpl.php files in this location on your site,

/components/com_mtree/templates/m2

For those who wish to add reCaptcha to the listing submit page i've added the addlisting tpl file.

Have fun.

Sorry it was'nt posted earlier but im still on 2.12 and been very busy with other work.
Attached Files
File Type: php page_claim.tpl.php (1.6 KB, 24 views)
File Type: php page_contactOwner.tpl.php (2.4 KB, 37 views)
File Type: php page_recommend.tpl.php (2.9 KB, 21 views)
File Type: php page_report.tpl.php (2.6 KB, 22 views)
File Type: php page_addListing.tpl.php (11.7 KB, 38 views)
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 03-29-2010 at 08:22 AM.
Reply With Quote
  #7  
Old 02-27-2010, 03:31 AM
davidfeinstein davidfeinstein is offline
Mosets'd
 
Join Date: Jan 2010
Posts: 19
Default

This is truly a great asset to mosets. Thank You for creating it and making it very easy to understand my client will be thrilled.

I agree with Karen this should be out of the box standard.

Patrick
Reply With Quote
  #8  
Old 02-27-2010, 04:28 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

My pleasure.

Captcha has always been a community assist type asset albiet it an important one. It keeps Mosets costs down for everyone by community contribution. But this may change in the future if Lee decides so although I can't see it changing in the short term future.

Also there are many forms of captcha and in the end its the user responsibility to choose their preferred form of captcha. Website security does lay firmly with the end user.

So for now it is free. Enjoy.
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 02-27-2010 at 04:31 AM.
Reply With Quote
  #9  
Old 03-29-2010, 08:22 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

For those who wish to add reCaptcha to the listing submit page i've updated and added the addlisting tpl file.

Enjoy
__________________
Member of the Australian and USA Joomla! Translation Team
Reply With Quote
  #10  
Old 03-29-2010, 05:15 PM
karenbanting karenbanting is offline
Mosets'd
 
Join Date: Jan 2010
Location: Australia
Posts: 9
Default Thanks Lenfitz

Thanks for the Captcha Lenfitz, you're very kind. Sorry for the delay in responding but I hurt my arm & had to take some time off.... plus it now looks like we may be using another product for the main directory which has all the features needed & more (...reciprocal backlink checker, thumbnails, payments etc), but I'm going to try to use Mosets for a free directory, so the Captcha will come in very useful.
Regards, & thanks again,
Karen
Reply With Quote
  #11  
Old 04-15-2010, 01:04 AM
davidjspringer davidjspringer is offline
Mosets'd
 
Join Date: Apr 2010
Posts: 2
Default

Hi

I am on Joomla 1.0.11 and mtree 1.58

Getting lots of review spam and trying to implement recaptcha.

Its not working.

Whether I enter the correct words or not I always get you entered the incorrect code.

in page_writereview.tpl.php I have

Code:
.
.
.
		<td align="left">
			<?php $this->plugin('textarea', 'rev_text', '', 8, 50, 'class="inputbox"'); ?>
			<br /><br />
			<?php 
			require_once('recaptcha/recaptchalib.php');
			$publickey = "mypubliccodekey";
			echo recaptcha_get_html($publickey); 
			?>
			<input type="hidden" name="option" value="<?php echo $this->option ?>" />
			<input type="hidden" name="task" value="addreview" />
			<input type="hidden" name="Itemid" value="<?php echo $this->Itemid ?>" />
			<input type="hidden" name="link_id" value="<?php echo $this->link->link_id ?>" />
			<input type="button" value="<?php echo $this->_MT_LANG->ADD_REVIEW ?>" onclick="javascript:submitbutton('addreview')" class="button" /> <input type="button" value="<?php echo $this->_MT_LANG->CANCEL ?>" onclick="history.back();" class="button" />
		</td>
.
.
.
in mtree.php in the addreview function I have

Code:
.
.
.
	# Get the review text
	$rev_text = trim( mosGetParam( $_POST, 'rev_text', '' ) );
	$rev_title = trim( strip_tags(mosGetParam( $_POST, 'rev_title', '' )) );
	$guest_name = trim( strip_tags(mosGetParam( $_POST, 'guest_name', '' )) );
	
	require_once('recaptcha/recaptchalib.php');
	$privatekey = "mysecretkey";

	$resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
	if (!$resp->is_valid) { die ($resp->is_valid . "The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); }
.
.
.
Reply With Quote
  #12  
Old 04-15-2010, 04:55 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Hi David,

For Mosets and joomla older versions there is a captcha which works well here

http://forum.mosets.com/showthread.php?t=4360


The recaptcha as described in this topic has been tested for Mosets 2.x and joomla 1.5.x versions only.


On a side note make sure you have your recaptchalib.php file in a folder called recaptcha in your public_html folder (root)
Cheers
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 04-15-2010 at 04:58 AM.
Reply With Quote
  #13  
Old 04-15-2010, 06:40 AM
davidjspringer davidjspringer is offline
Mosets'd
 
Join Date: Apr 2010
Posts: 2
Default

Quote:
Originally Posted by Lenfitz View Post
Hi David,

For Mosets and joomla older versions there is a captcha which works well here

http://forum.mosets.com/showthread.php?t=4360


The recaptcha as described in this topic has been tested for Mosets 2.x and joomla 1.5.x versions only.


On a side note make sure you have your recaptchalib.php file in a folder called recaptcha in your public_html folder (root)
Cheers
The recaptcha is set up correctly somehow the response field post field is not being made available to the mtree.php file. It really should work but have not a clue why.

I will try this other one you gave to me and see how that goes.

Thanks.
Reply With Quote
  #14  
Old 08-13-2010, 02:17 AM
chrisnewham chrisnewham is offline
Mosets'd
 
Join Date: Aug 2010
Posts: 16
Default Captcha problem

Lenfitz,

As a newbee, I appreciate all the details you have provided but I'm afraid that I've been unable to get beyond trying to install Captcha on the contact owner page, and hope you can help me.

The blank message page comes up with an undecorated, black and white Captcha panel and when I send a message I get the following:
-----------------------
Warning: require_once(capture/recaptchalib.php) [function.require-once]: failed to open stream: No such file or directory in /home/jobsearc/public_html/components/com_mtree/mtree.php on line 3451

Fatal error: require_once() [function.require]: Failed opening required 'capture/recaptchalib.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jobsearc/public_html/components/com_mtree/mtree.php on line 3451
----------------------
Line 3451 is the line for the private key, which has the correct value.

If there is anything in your instructions that I didn't quite get, it was the action of " pointing the code to
require_once('captcha/recaptchalib.php');

I have made that change to both the mtree.php and page_contact Owner.tpl.php files. Is that correct?

I'm using:
Joomla 1.5.20 (ja_purity template)
Mostets Tree 2.1.5


I'll appreciate your feedback.
Thanks,
- Chris
Reply With Quote
  #15  
Old 08-16-2010, 03:37 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Quote:
Originally Posted by chrisnewham View Post
Lenfitz,

As a newbee, I appreciate all the details you have provided but I'm afraid that I've been unable to get beyond trying to install Captcha on the contact owner page, and hope you can help me.

The blank message page comes up with an undecorated, black and white Captcha panel and when I send a message I get the following:
-----------------------
Warning: require_once(capture/recaptchalib.php) [function.require-once]: failed to open stream: No such file or directory in /home/jobsearc/public_html/components/com_mtree/mtree.php on line 3451

Fatal error: require_once() [function.require]: Failed opening required 'capture/recaptchalib.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jobsearc/public_html/components/com_mtree/mtree.php on line 3451
----------------------
Line 3451 is the line for the private key, which has the correct value.

If there is anything in your instructions that I didn't quite get, it was the action of " pointing the code to
require_once('captcha/recaptchalib.php');

I have made that change to both the mtree.php and page_contact Owner.tpl.php files. Is that correct?

I'm using:
Joomla 1.5.20 (ja_purity template)
Mostets Tree 2.1.5


I'll appreciate your feedback.
Thanks,
- Chris
Hi Chris,

The re-captcha is for the M2 template regardless of "website" template. JA purity should be fine but as I do not use that template I cannot say if there are any conflicts. In theory there should be none.

Firstly if you getting an undecorated skin then try changing the script below

<script type= "text/javascript">
var RecaptchaOptions = {
theme: 'clean'
};
</script>

Theme options are 'red' | 'white' | 'blackglass' | 'clean' | 'custom'

For the purpose of the example we have used 'clean'

I have enbolded the options u need to change to modify skins.


In your case the recaptchalib.php from what i can see should be in a folder you have created in your /public_html/capture folder.

I've noted that you have changed captcha to capture. Thats fine as long as all the code which points to captcha is changed to capture.

Hope this helps. Let me know how you go.

Please note I havent upgraded the .tpl files to 2.1.5 as yet as i've been very busy. Also I havent checked whether the .tpl files have changed or need to be changed but i'll check update them soon if necessary.
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 08-16-2010 at 03:41 PM.
Reply With Quote
  #16  
Old 08-19-2010, 02:09 PM
chrisnewham chrisnewham is offline
Mosets'd
 
Join Date: Aug 2010
Posts: 16
Default

Lenfitz.
I'll just love it if this is all about captcha vs capture! As soon as I've delt with a couple of crises, I'll check it out.
Thanks.
Reply With Quote
  #17  
Old 08-22-2010, 11:06 AM
chrisnewham chrisnewham is offline
Mosets'd
 
Join Date: Aug 2010
Posts: 16
Smile Getting Captcha'd

Hi Lenfitz,

There's nothing like a spelling error . . . .

I'm now successfully using your files for addListing, recommend and report.

I even managed to modify the one attached for writeReview.

Thanks for your valuable help,
- Chris
Attached Files
File Type: php page_writeReview.tpl.php (3.5 KB, 24 views)

Last edited by chrisnewham; 08-22-2010 at 11:52 PM.
Reply With Quote
  #18  
Old 08-22-2010, 09:56 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Quote:
Originally Posted by chrisnewham View Post
Hi Lenfitz,

There's nothing like a spelling error . . . .

I'm now successfully using your files for addListing, recommend and report.

I even managed to modify the one attached for writeReview.

Thanks for your valuable help,
- Chris
My pleasure. I'm really glad things worked out for you. Once you get the hang of it (and it sounds very much like you have) its a big help for yourself and your members towards getting rid of spammers.

Thanks for adding the writereview.tpl it all helps the Mosets community.

Cheers
__________________
Member of the Australian and USA Joomla! Translation Team
Reply With Quote
  #19  
Old 09-25-2010, 12:52 AM
marinos marinos is offline
Mosets'd
 
Join Date: Sep 2010
Posts: 104
Default registered users

this works great, is there a way to turn recaptcha off for all logged in users?
Reply With Quote
  #20  
Old 09-25-2010, 11:22 AM
marinos marinos is offline
Mosets'd
 
Join Date: Sep 2010
Posts: 104
Default

is there a way to extend this so it can also work on joomla registration and contact page.

I have tyred installing a recapcha plugin called "joo recaptcha" because I would rather not hack joomla but im getting a conflict error that looks a little like this

Fatal error: Cannot redeclare _recaptcha_qsencode() (previously declared in /home/hostuser/public_html/mydomainname.com/subdomainfolder/plugins/system/joo_recaptcha/recaptchalib.php:47) in /home/hostuser/public_html/mydomainname.com/subdomainfolder/captcha/recaptchalib.php on line 55

this error shows on all pages where the recaptcha hack described in this topic has been implemented ie

claim page
contactOwner page
recommend page
report page

the error does not show on the pages the joomla plugin deals with ie

user registration
contact page

would anyone know how to get around this?

also this hack has a small issue, if a user get the captch wrong which happens quite often, the form they had filled in (add listing) completely clears and the user has to add all info again before trying the captcha again.
Reply With Quote
  #21  
Old 09-25-2010, 11:44 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

marinoshadjipapas, You will need to post your "joo recaptcha" issues on that plugins forum for support. We do not support other captcha plugins here.

Good luck.
__________________
Member of the Australian and USA Joomla! Translation Team
Reply With Quote
  #22  
Old 09-25-2010, 01:55 PM
marinos marinos is offline
Mosets'd
 
Join Date: Sep 2010
Posts: 104
Default Re: reCAPTCHA on Mosets 2.1.2+3 and Joomla 1.5.x

Thanks Lenfitz for your quick reply

Regarding this Plugin:
- This hack has a small issue, if a user gets the captch wrong which happens quite often, the form they had spent time filling in (example: add listing form) completely clears and the user has to add all info again before trying the recaptcha again.

- Is there a way to extend this plugin so it can also work on joomla registration and contact page. If I install another solution to the joomla registration form I get a conflict. If you are going to recaptcha mosets tree, wouldn't you want to recaptcha joomla FIRST?
Maybe if there is another solution it would be nice if someone could direct us there.

Thanks again for the great plugin
Reply With Quote
  #23  
Old 09-28-2010, 01:50 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Hi marinoshadjipapas,

Indeed so if a user gets the captcha wrong it resets the page information, but that is the way it works to reduce bot spam. It requires a reload which also changes the captcha code. Users can request a different code without the page resetting itself by clicking the circular arrows.

I use Walter Cedrics Capture Security Images for Joomla login, registration and contact pages.

http://www.waltercedric.com/joomla-r...ecurityimages5

I have thought about incorporating the reCAPTCHA into the Joomla login, registration and contact pages but just havent had the time to do so.

Also if I was to do that its not related to Mosets so I couldnt post it here anyway.

Cheers
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 09-28-2010 at 02:08 AM.
Reply With Quote
  #24  
Old 09-28-2010, 07:55 AM
marinos marinos is offline
Mosets'd
 
Join Date: Sep 2010
Posts: 104
Default

Thank you for the reply Lenfitz

I see your logic with the captcha resetting the page for extra security. makes sense.

I don't mean to devalue recaptcha but I captchered my joomla and mosets tree using the same captcha plugin with much less code and NO mosets tree core file hacks.

For anyone else interested until recaptcha works on both as suggested in this topics title, here is how I did it.

I installed osolcaptcha on joomla and expanded it to mosets tree by adding a small code in the mosets tree M2 template file just before the submit button just as you would for the recaptcha explained here, only differance is you only need to add one small code to the template file where as the recaptcha here needs 2 codes in template and 1 in a mosets tree core file.

get osolcaptcha from here
http://extensions.joomla.org/extensi.../captcha/11521

how to install example:
- Install and set up osolcaptcha on joomla using joomla install/uninstall
- add a small code to page_contactOwner.tpl.php for the contact listing owner form.
- to add code open /components/com_mtree/templates/m2/page_contactOwner.tpl.php
- find at the end of the page
Code:
<input type="button" value="<?php echo JText::_( 'Send' ) ?>" onclick="javascript:submitbutton('send_contact')" class="button" /> <input type="button" value="<?php echo JText::_( 'Cancel' ) ?>" onclick="javascript:submitbutton('cancel')" class="button" />
        </td>
    </tr>
- add this code just before the above code
Code:
<!-- begin OSOLCaptcha -->
<?php


global $mainframe;
//set the argument below to true if you need to show vertically( 3 cells one below the other)
$mainframe->triggerEvent('onShowOSOLCaptcha', array(false));
?>
<!-- end OSOLCaptcha -->
ENJOY A SITE WIDE UNIVERSAL CAPTCHA

Thankyou Lenfitz for this topic and solutions. If it wasn't for this topic I would not have managed this solution even though its different.

Quote:
Also if I was to do that its not related to Mosets so I couldnt post it here anyway.
I would think anything that helps mosets tree work better on your preferred joomla setup (including joomla security captcha system) was also related to mosets tree since mosets tree works on joomla, not vice versa. We might have to agree to disagree.
Reply With Quote
  #25  
Old 10-24-2010, 03:17 AM
chrisnewham chrisnewham is offline
Mosets'd
 
Join Date: Aug 2010
Posts: 16
Default A Captcha Gotcha?

Hi Lenfitz,

I originally tested each page using the re-Captcha function by adding new content then typing the two words and clicking on Submit. This worked and I was satisfied.

Weeks later I've been inspired to re-test all my pages with reCaptcha, and I discovered that in each case I can submit new content without typing the two words and without a reminder to do so!

Am I alone in experiencing this and do you have any ideas about the cause?

Thanks,
- Chris
Reply With Quote
  #26  
Old 10-24-2010, 09:21 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Hi chrisnewham,

I just re-tested mine and it works fine. Did you use the complete code above or partial?

There is a part of the code that if no information is entered it should bring up a box stating wrong code used.

Also if you have updated mosets you will need to re-enter the code into the mtree file.


Cheers
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 10-24-2010 at 09:36 AM.
Reply With Quote
  #27  
Old 12-15-2010, 02:31 AM
virginiaimiller's Avatar
virginiaimiller virginiaimiller is offline
Mosets'd
 
Join Date: Oct 2010
Posts: 24
Default Question - where to insert code in MTREE.php?

Hi -

Quick question: for the AddListing form, where is the corresponding code inserted in the MTREE.php file? I'm assuming it's inserted in the SaveListing() function, but I've tried two places per these instructions and I can't seem to get it working!

THANK YOU!!

V
Reply With Quote
  #28  
Old 12-15-2010, 03:02 AM
chrisnewham chrisnewham is offline
Mosets'd
 
Join Date: Aug 2010
Posts: 16
Default

Hi Virginia,
I'm sorry that I don't have a quick answer. I have had to shelve my project that included reCaptcha, in part because of the problem identified in my post of 10/23, and have forgotten most of what I had learned! I expect to get back to it in the next few weeks and may find an answer to your question then. Meanwhile, hopefully, Lenfitsz will see this exchange and has an answer at his finger tips.
- Chris
Reply With Quote
  #29  
Old 12-15-2010, 03:41 AM
virginiaimiller's Avatar
virginiaimiller virginiaimiller is offline
Mosets'd
 
Join Date: Oct 2010
Posts: 24
Default Hi Chris - thank you

Hi Chris-
Thank you for the quick reply - I'm also hoping that Lenfitz has an answer for this! Many thanks to both of you for looking at this!

Making the Captcha display with javascript per Lenfitz' instructions was easy - the challenge is altering the MTree.php file to process the Captcha along with the various forms - depending on where I enter the Captcha code in MTree.php, I get a blank page after form submit, or the Captcha is simply ignored!

I'll keep working on it and let you know if I figure anything out - thank you!

V
Reply With Quote
  #30  
Old 12-15-2010, 08:02 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Which version of Moset's are you using?
__________________
Member of the Australian and USA Joomla! Translation Team
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mosets Tree 2.0.5 released - now supports Joomla! 1.5 with Legacy plugin dknight Announcements 0 12-31-2007 11:34 PM
Joomla! Extensions Directory launched with Mosets Tree dknight Announcements 0 03-06-2006 05:23 PM


All times are GMT +8. The time now is 01:00 PM.

Copyright © 2005-2010 Mosets Consulting

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.