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?
Comments
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.
As a result I don't even need to use the contact_form. YEAH!
Any chance of posting your "changes" here, so use new users can learn faster?
[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,
- the name of the album
- the name of the image
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]
<input type="text" name="picture_chosen" value="<?php $$picture[2];?>" />
[/code]
Thus when submitting the form the name of the picture is submitted. The icing on the cake, what I forgot to mention at the beginning is that the Admin console also gives you the opportunity to 'Name' your image. So now when you do this, not some obscure name like "dscn0082" (the .jpg can be cut off again using explode)is submitted by your form but rather "bigredbike". And that's it. All possible because the name of the image is in the url, so it can be retrieved using:
[code]
$_SERVER['HTTP_REFERER']
[/code]
In addition the description option in ZenPhoto allows you to put links in your content. Php does the rest.
` Also I would suggest to use the `sanitize()` function on the recieved data to avoid any unwanted bad injections.