Create custom joomla captcha - php

I've been assigned to create a captcha verification for a custom component in joomla, but I'm stuck at how to do it properly.
I'm aware of the fact that there are many captcha plugins like recaptcha available but I am required to use a custom captcha created by the company.
It saves the image text in a session and creates the image in a component so calling index.php?option=com_captcha directly in the browser will output a captcha image.
The problem is that I'm completely new to joomla and can't seem to find a proper way to create code that could be reused through out the system. I tried to do this by creating a module that would call the captcha component, then do the logic and check if captcha was correct.
The problem I faced with doing this was the fact that I couldn't find a way to pass variables to my module, thus I couldn't pass the session variable that's required by captcha component.
I've looked at plugins but I'm not sure that you can call a plugin directly from a component.
I'm currently stumped and got no ideas which direction to go to and what to search for. Any help will be appreciated, thanks.

You don't mention your Joomla! version but if it's 1.6+ why not use a captcha plugin?
Then any third party extension can use it automatically if you set it as the sites default captcha mechanism.
Plugins are also a lot easier to write than a component... captcha plugins only have a few required methods — onInit($id), onDisplay($name, $id, $class) and onCheckAnswer($code)

Related

Joomla 3 registration form

On one of the sites i need to do some changes on for a client i am having trouble finding something.
On the standard Joomla 3 registration system a custom field was added to the form, but that form does not email to the admin when someone registers, please can someone point me in the correct direction on where i can make that field be sent in the email.
I have looks on quite a few pages on the net but have not come right with any of the answers that i found. I have also tried going to most of the php files to see if i cant find something but i am not having much luck.
Unfortunately that email is hard coded; it is really a legacy from Joomla 1.0. What you would probably want to do is turn off the core notification system and instead use a plugin that would be triggered with the onUserAfterSave event and use similar code to what is in the core. You will find that in the activate($token) method in the frontend registration model for com_users.
The plugins/user/joomla plugin gives an example of how to build an email, bit in your case you would want to build it when the user is created in the site application (isSite() == true). You can also look at the contactcreator plugin in the same folder; it also uses the onUserAfterSave event.

joomla spambots error

Using widgetkit map (external component by yootheme) in joomla 2.5, joomla detect when I insert an email address and give me this error
This email address is being protected from spambots. You need JavaScript enabled to view it.
Javascript obviously is enabled.
do you have the plugin Content - Email Cloaking active ?
Disable it and everything should be fine.
If you're a programmer or webdesigner, you should look for any JavaScript error messages with a tool of your choice, which will help you to identify the problem.
There are several possible causes. Here are two of them:
Sometimes, a content plugin interferres with the tags or output of
another plugin. Obviously, the email cloak plugin is called and
executed correctly (thus the message), but the JavaScript to display
the email address seems to be corrupted. You could try to re-order
the plugins, so that the email cloak plugin is executed after all
3rd party (i.e., not default Joomla) plugins.
A JavaScript library is not loaded. This often happens in
conjunction with templates. To check this, switch your installation
to a standard template (e.g. Beez2). If the problem vanishes,
correct your template.
You can solve this in three ways.
Email Cloaking plugin Disable.
While using custom Module Prepare content Disable.
Using Place holders to fix the issue on particular article.
For more about Joomla spambots error
Hope its helps someone.

Assign template joomla with sessions

I need to change the template depends on the sessions, that means Once user logged in we need to change the template.
note: I need to achieve this by coding not from administrator.
any help?
Have you tried googling the subject?
Using "Joomla Pluggin User Template" i get a post regarding a pluggin provided by rockettheme that gives a dropdown list savable...
Maybe try to search next time?
http://www.google.ca/search?q=joomla+pluggin+template+per+user&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:fr:official&client=firefox-a
I have solved my problem with assigning template manually through coding part.
I did by changing the function in includes/application.php
Function name is getTemplate(); This function returns the template name.
Its worked for me.
i don't think so that it is possible, cause Joomla is a CMS(Content Management System)
and it has its own rule to develop your site.
If you want that kind of feature then you have to leave to use CMS and have to develop dynamic website
EDIT according to #jprofitt, it is possible with some CSS tricks, just detect the login session of the user and apply that CSS but i think, for this you have to detect the session on the index.php file, that is your template file, i am not sure cause i never did that.

How to take my PHP form handler pages into WordPress to connect with PayPal API

I'm trying to integrate a form like this into Wordpress
This form works perfectly with the PayPal API sandbox. However, when I tried to move this work over to the WP site of my organization, globalcitizenyear.org/donate/donation-form-2/, I keep coming up short.
Anyone have any tips to keep in mind when doing this? What steps would you take first to make this happen in Wordpress - any details on what to avoid, or what potential hangups might be?
Make a page called page-donation-form-2.php and load this code into it. You can leave in the get_header() and get_footer() tags if you want to have the site wrapper around the outside.
Make sure to change your form action also. And remember, that since this is in WordPress now, you will need to avoid some reserved form elements. Full list here.
If you have any trouble, please post your code here.

Quickpost form on Drupal front page

Hey, I'm quite new to Drupal and am having some issues with implementing a node form on the front page of the site.
I want to have a really simple quick post form on the users front page when they are logged in, just a few fields and a submit button, no advanced options or anything.
Is there a really simple way to do this by placing some php in the front-page.tpl.php file?
I think what you are looking for is http://drupal.org/project/webformblock. (also requires the webform module)
Create a region on the front page and just put this block in it. You can set options in the block to only appear on the front page.
Or you could just invoke the block directly in the tpl.php file.
http://drupal.org/node/26502
Yes and no. This is not the drupal way of doing things- although you COULD make it work this way.
If you are looking for a simple solution, try a module like webform and put it on the front page. You can do this by either creating a page and setting it as the front page (under site information in the admin menu), or by creating a block, putting it in the 'content top' region of your theme, and in the configure block setting it only to display on (a special keyword that means frontpage).
Hope this helps!
Chris.
If your login goes to the /user page you can use the webformblock module (http://drupal.org/project/webformblock) to configure a Webform to only show up on the "user" page under site building > blocks > configure (next the the webform block). You can also check the option there to only show the block for authenticated users or another role of your choice.
You do not want to create a form without going through Drupal's form API, as you lose a lot of security features and there are many tools out there already that make it easy to generate and maintain forms through the Drupal interface. As the above answers suggest, webform is the Drupal way to create quick forms. And I think you will love the interface.
http://drupal.org/project/webform
Thanks for all your help guys. I tried the webformblock module and whilst it did fit the bill, it required me to create a new content type (maybe I wasn't using it right?).
In the end, after searching I found the Form Block module http://drupal.org/project/formblock which fitted my needs perfectly. It can be configured for existing content types really easily.

Categories