Hi,
I am looking for an extension or plugin that will allow surfers who visit my gallery to click on any of the images and it will send them to form to fill out their name, contact number, email address and automatically carry (via hidden field or otherwise) the image id or title. They can then click submit, I get an email and know that they are interested in that image and can call or email them.
There is an unsupported extension called contact_form by Malte Müller (acrylian) and Stephen Billard (sbillard). However I am looking around for ideas. The url is:
[code]
http://www.zenphoto.org/2009/11/contact_form/
[/code]
By the way, how do you use these extensions. I did not see a download link for the contact_form. Just Functions etc. Do I have to copy and pasted the code and build my own objects after that?
HELP?
The contact_form plugin is supported. There's a green checkmark icon which is explained in the sidebar and it is in the category "Officially supported"....... Therefore there is no download link as it is included in the release package. Additionally it is built in in all four standard themes. Just enable that plugin.
However it does not carry the image title or id as it is not meant for that. You would have to modify this plugin or write your own custom plugin.
One option would be to modify the contact_form script to send the referrer HTTP header to you as part of the email also, which would let you know which page the user was on before they clicked "Contact". That might be the simplest way.
I have enabled the contact_form plugin from the admin interface. I have placed the email address I want emails sent to in the Options/plugin options tab. However no form shows in the gallery? How do i get the form to show? I notice there is a "usage" link in the other plugins but not this one.
I found a solution. I did not know that the image description allowed the use of links. So what I did was put a link to my form page and on that page use the php referrer HTTP to send me the GET value pairs. I then used php's explode function to break it up and get the name of the image. Excellent. Thanks for the ideas and suggestions.
As a result I don't even need to use the contact_form. YEAH!
Sure! The Zenphoto Admin console gives the opportunity to add a title and description to any image. The description facilitates the use of links. So in my example in addition to some usual text describing the photo, I end it off with:
[code]
If you like this click here
[/code]
Remember the "Description" text is there when you view the large image, having clicked the thumbnail. And if you look closely in the url bar, there are several variable:vlaue pairs. I have noticed two variables,
[list]
[]the name of the album
[]the name of the image
[/list]
The above holds true if you're using the default theme by Joen Asmussen and Levi Buzolic. Whenever you click on a thumbnail the url in the address bar looks like this:
[code]
http://www.mysite.com/gallery/index.php?album=biking&image=DSC01920.JPG
[/code]
In some other galleries using a different theme it looks like this:
[code]
http://www.zenphoto.org/zenphoto/impressionists/Monet+-+Water+Lillies+-+les+nuages.jpg.php
[/code]
It really doesn't matter. What ever page your link is pointing to, once its using php you can have this on the page:
[code]
/
This example works for this url:
http://www.mysite.com/gallery/index.php?album=biking&image=DSC01920.JPG
/
$original_url = $_SERVER['HTTP_REFERER'];
$picture = explode('=', $original_url);
echo $picture[2];
[/code]
Use another "explode" to separate the '.jpg' from the name of the image. In your own example, you will need to go through your array indexes ($picture[0],$picture[1]..etc) to see which one gives your image name. From there you can then assign that value to one of your form values:
[code]
A side note about forum usage of code examples. As written below the field to post you have to put it into backticks. [code] does not work if use ``
Also I would suggest to use the sanitize() function on the recieved data to avoid any unwanted bad injections.