forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: wirewolf on October 31, 2006, 02:00:22 am

Title: Contact us mail form plugin with image verification for Coppermine Photo Gallery
Post by: wirewolf on October 31, 2006, 02:00:22 am
Contact us mail form plugin with image verification by wirewolf, v1.1 - for Coppermine Photo Gallery, 1.4.x

Original mod by myself, wirewolf, http://forum.coppermine-gallery.net/index.php?topic=37846.0

For this plugin, original files for the codebase, configuration and the init.inc are from the devs, donnoman, gaugau, with modifications by BMossavari, Frantz (inspired from GYZMO's Add On) and adaptation by myself for this plugin. This is my first plugin for Coopermine and I learned a lot by studying the scripts from other plugins.

Original contact_us.php and english.php files by myself, randomimage.php file by unknown author. If anyone would like to provide translations for other languages, please do so.

This plugin will add a contact us mail form with image verification and a 'Contact Us' link on the top menu bar for Coppermine Photo Gallery, 1.4.x  Tested with classic theme, not tested with others, but it should work.

The contact form will display error messages when a users fails to enter the required information. All fields are required, Name, Email Address, Subject, Comments, and the image verification code. It also allows for the user to 'Reset' the image if they have difficulty reading the code. The error messages are displayed right on the contact form page. Even if they have only entered partial information, the error messages will toggle on or off accordingly upon hitting the 'Submit' button. It not only checks for a required email address from the user, but it also checks that the email address they enter is correctly formatted.

A new image code is generated any time they hit the 'Submit' button without all of the required information entered, or if they hit the 'Reset Image' button. However, they will not lose any of the information they have entered up to that point. unless they hit the 'Reset Form' button (reloads the entire form) or, of course, leave the page.

They can't send a message until the form is successfully submitted, when they are then directed automatically to a 'Thank You Page'. The email is then sent via the email address you have entered in the Admin Control Panel. The email you receive not only has the users input, but contains a link to check out their ip address (with ARIN Whois) and lists their server agent.

See working plugin at http://academyphotos.net/photogallery/index.php?file=contact_us/contact_us

Added the cpg_mail() function, so it should work with both mail() and SMTP (thanks to Nibbler for some guidance on the correct coding)

You can download the zip file at the end of this post. It contains all of the plugin files plus a README.txt file with full instructions. For those unfamilar with installing a plugin, see http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#plugin_manager

step 1:
Download and unzip the archive - contact_us.zip
Upload the "contact_us" directory structure as is to your Coppermine gallery's plugins folder.

end upload plugin

step 2:
Login to your admin panel, go to config, then "Manage Plugins"
Find the Contact Us entry in the available plugins and click install.
A new menu button is now added for opening contact us mail form.
If you want, you can also add a link to the form in your custom footer, IE:
<a href="index.php?file=contact_us/contact_us">Contact Us</a>

Enjoy! wirewolf, John

If the devs like, please move move post accordingly, Thanks

Add On: Uploaded new zip file with corrections for cpg_mail function as suggested by Nibbler
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gal
Post by: Nibbler on October 31, 2006, 02:13:12 am
You might like to consider using cpg_mail() instead of mail(). That way it will work for people who use SMTP to send emails too. Also, if you name the plugin's directory as contact_us then it will play much better with the plugin manager.

Thanks for your contribution.
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gal
Post by: wirewolf on October 31, 2006, 02:35:14 am
Hi Nibbler, thanks

The folder is named contact_us. (I didn't want it to conflict with other mods or plugins named contact).

I just tried the script with the cpg_mail() and got this:
Fatal error: Call to undefined function: cpg_mail() in photogallery/plugins/contact_us/contact_us.php on line 93

For now I'll go back to the mail() until I can figure it out. The contact_us.php file calls for the include/init.inc.php file, so the cpg_mail() function should have been defined. Any clues?

wirewolf
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gal
Post by: wirewolf on October 31, 2006, 02:50:57 am
I just looked up the function
Code: [Select]
cpg_mail($to, $subject, $msg_body = '', $type = 'text/plain', $sender_name = '', $sender_email = '', $msg_body_plaintext = '') in the mailer.inc.php file

this is my line of code in my contact_us.php script:
Code: [Select]
mail($CONFIG['gallery_admin_email'], $sender_subject, $messageproper, "From: \"$sender_name\" <$sender_email>" . $headersep . "Reply-To: \"$sender_name\" <$sender_email>");
Would I have to match the coding variables to my script in order for cpg_mail() to work?

wirewolf
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gal
Post by: Nibbler on October 31, 2006, 03:23:33 am
You need to

Code: [Select]
include 'include/mailer.inc.php';
 to be able to use cpg_mail(). You also need to give it the right arguments, yes.

Code: [Select]
cpg_mail('admin', $sender_subject, $messageproper, 'text/plain', $sender_name, $sender_email);
The folder is named 'contact_us_plugin_v1.1' in the package I downloaded.
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gal
Post by: wirewolf on October 31, 2006, 05:30:11 am
Thanks Nibbler.

I was starting to look at some of the coding from existing scripts when I got the email notice about your reply. Applied the changes you suggested and it works like a charm now, Thank you.

added - include 'include/mailer.inc.php'; - to the script and changed the one line to:
cpg_mail('admin', $sender_subject, $messageproper, 'text/plain', $sender_name, $sender_email);
 

I replaced the zip file with the corrections in the top post.

Again, Thanks for the assist,
wirewolf
Title: Modification, German Translation
Post by: m@rk on December 27, 2006, 07:04:25 pm
Great Plugin!

Here's my German translation.
I left the "Check your spelling" fields blank.

Modification:

With attached modified contact_us.php, the anti spam protection appears only for not-logged-in-guests.
Also, members have their name and email fix in the form.
By default, the gallery name is set as subject.
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gal
Post by: wirewolf on January 06, 2007, 05:46:35 pm
Thank you m@rk, for the translation and the guests/members coding addition.

I didn't even occur to me of adding that. My site has no registered users (except for me!). It's for display of photos I'm taking only. Great add-on

I also have a mod for capcha for e-cards - http://forum.coppermine-gallery.net/index.php?topic=37635.0 . Your additional code would be great for that too.

Have to look in to it.

Again, thanks
wirewolf
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gal
Post by: JvM on January 14, 2007, 11:33:11 pm
My dutch translation ;)
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gallery
Post by: kushti on April 18, 2007, 10:34:46 am
I got a problem with all the contact plug-ins I have installed because the image verification does not work - this did work at first but has now stopped! Does anyone have an idea why this has happened how how to fix it?
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gallery
Post by: LukaszP on May 08, 2007, 08:39:04 am
Polish lang
polskie tłumaczenie
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gallery
Post by: panatan on December 05, 2007, 12:34:22 pm
Hi all !

Instead "Captcha (Visual Confirmation) for adding comments" like shown in this post "http://forum.coppermine-gallery.net/index.php?topic=36319.msg233202#msg233202" i've installed "Contact Us Mail Form v1.1" (wirewolf)

But i never receive any message when i'm testing...

I've changed "cpg_mail" in "mail" but it doesn't works...

Could you help me ?
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gallery
Post by: sard on May 01, 2009, 01:55:57 am
This is macedonian translation of this plugin.

Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gallery
Post by: Luksi1 on October 18, 2009, 05:08:43 pm
Great plugin!

You can find Slovenian translation here.

Chears,

Luka
Title: Re: Contact us mail form plugin with image verification for Coppermine Photo Gallery
Post by: durangod on January 06, 2010, 07:22:30 am
Most excellent Mod, works perfectly on the fruity theme... only thing i changed was i added a back button, other than that PERFECT!!  NICE JOB...