Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Nominate XOOPS!

Learn XOOPS Core

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $15.00
Net Balance: $14.11
Left to go: $85.89

Donations
Anonymous ($15)Jul-20

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 Abuse adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap Captcha cell cent chronolabs CHUNG content CĂN demo docek download Dresses evden eve facebook Fat Food for free Gateway Google Guide herre Honeypot HP html5 Human HỘ IP iPhone jQuery List log Loss mobile module modules Monster new newbb news NHÀ online PARK phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon Room security Sentry site Smartphone Smarty Solution Spam Studio tag tags tdmcreate template The Theme themes User userlog web weight Wishcraft xoops Xortify

New Users

Registering user

# 137627

Roscislaw12

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post

« 1 2 (3)


#21 Posted on: 2010/7/17 14:16 Re: New javascript-based captcha for XOOPS
Just replace the captcha folder in core/class with the one in this dl... :)

Top


Danordesign - Get XOOPS Modules!
XOOPS Nordic

Runeher
Module Developer
Module Developer
Joined:
2008/1/24 12:46
From Norway
Group:
Registered Users
Posts: 723
(Show More) (Show Less)


#22 Posted on: 2010/7/17 14:50 Re: New javascript-based captcha for XOOPS
Thanks Runeher

I replaced the captcha folder in core/class, and when I go to the register page it´s show noting.

What I´m doing wrong? I test in xoops 2.44 and 2.45

Top

oswaldo
Not too shy to talk
Not too shy to talk
Joined:
2008/8/22 9:15
Group:
Registered Users
Posts: 156
(Show More) (Show Less)


#23 Posted on: 2010/7/17 16:06 Re: New javascript-based captcha for XOOPS
As Frankblack said in the first post: "1. jquery.js must be included in theme", so try adding to your theme (between <head></head>):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>


Top


Danordesign - Get XOOPS Modules!
XOOPS Nordic

Runeher
Module Developer
Module Developer
Joined:
2008/1/24 12:46
From Norway
Group:
Registered Users
Posts: 723
(Show More) (Show Less)


#24 Posted on: 2010/7/17 19:32 Re: New javascript-based captcha for XOOPS
Thanks

Sorry I´m dumb



Top

oswaldo
Not too shy to talk
Not too shy to talk
Joined:
2008/8/22 9:15
Group:
Registered Users
Posts: 156
(Show More) (Show Less)


#25 Posted on: 2010/7/30 1:29 Re: New javascript-based captcha for XOOPS
Here is a nice gimmick for the captcha: if the captcha is solved correctly ONLY THEN the submit button will appear.

Example code for a module:
$form_output->addElement(new XoopsFormButton('''submitme'$form->getVar('form_submit_text'), 'submit'));


Example code for the style.css:
#submitme { display: none; }


New code for jquery.sexy-captcha-0.1.js (hope the textsanitizer is not breaking everything):
/*
 * Sexy Captcha v.0.2
 * Designed and developed by: BWM Media (bwmmedia.com)
 */
(function($) {
    $.
fn.sexyCaptcha = function(url) {
        
this.each(function() {
            $(
this).load(url, { action'refresh' }, function() {
                $(
'.draggable').draggable({ containment'parent'snap'.target'snapMode'inner'snapTolerance35revert'invalid'opacity0.75});
                $(
'.target').droppable({ accept'.draggable'tolerance'intersect' });
    
                
//On drop of draggable object
                
$('.target').bind('drop', function(eventui) {
                    $(
'#captchaWrapper').find('.captchaAnswer').val($(ui.draggable).attr('id'));
                    $(
'#captchaWrapper').find('.draggable').draggable('disable');
                    $(
'#captchaWrapper').find('.draggable').unbind('click');
                    $(
'#captchaWrapper').find('.targetWrapper').children('.target').hide();
    
                    
//Check captcha answer
                    
$.post(url, { action'verify'captcha: $(ui.draggable).attr('id') }, function(data) {
                        if (
data.status == "success") {
                            $(
'#captchaWrapper').find('.targetWrapper').addClass('captchaSuccess').hide().fadeIn('slow');
                            
document.getElementById('submitme').style.display 'block';
                        } else {
                            $(
'#captchaWrapper').find('.targetWrapper').addClass('captchaFail').hide().fadeIn('slow');
                            
document.getElementById('submitme').style.display 'none';
                        }
                    }, 
'json');
                });
                
                
//On double-click of object
                
$('.draggable').bind('click', function(eventui) {
                    $(
'#captchaWrapper').find('.captchaAnswer').val($(this).attr('id'));
                    $(
'#captchaWrapper').find('.draggable').draggable('disable');
                    $(
'#captchaWrapper').find('.draggable').unbind('click');
                    $(
'#captchaWrapper').find('.targetWrapper').children('.target').hide();
                    $(
this).removeClass('draggable');
                    $(
this).addClass('target');
                    $(
'#captchaWrapper').find('.targetWrapper').html($(this));
                    
//$(this).hide();
    
                    //Check captcha answer
                    
$.post(url, { action'verify'captcha: $(this).attr('id') }, function(data) {
                        if (
data.status == "success") {
                            $(
'#captchaWrapper').find('.targetWrapper').addClass('captchaSuccess').hide().fadeIn('slow');
                            
document.getElementById('submitme').style.display 'block';
                        } else {
                            $(
'#captchaWrapper').find('.targetWrapper').addClass('captchaFail').hide().fadeIn('slow');
                            
document.getElementById('submitme').style.display 'none';
                        }
                    }, 
'json');
                });
                
                
//Redraw captcha
                
$('.captchaRefresh').click(function() {
                    $(
'#captchaWrapper').sexyCaptcha(url);
                    
                    return 
false;
                });
            });
        });

        return 
this;
    };
})(
jQuery);


I mean, this captcha relies on javascript, so we can use another peace of javascript to hide the submit button. Enjoy.

Edit: in this case all submit buttons that have to be hidden, must have an id called submitme. To use the example you have to modify the modules a bit.

Top

frankblack
Just can't stay away
Just can't stay away
Joined:
2005/6/13 3:03
From D-Schiefbahn
Group:
Registered Users
Posts: 785
(Show More) (Show Less)




« 1 2 (3)



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You can vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]