Member
Member
arimakidd   18-05-2010, 11:49
#1

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?

Administrator
Administrator
acrylian   18-05-2010, 12:02
#2

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.

Member
Member
Blue Dragonfly   18-05-2010, 17:09
#3

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.

Member
Member
arimakidd   19-05-2010, 00:56
#4

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.

Member
Member
sbillard   19-05-2010, 02:34
#5

If you are not using one of the distributed forms you will have to modify your theme to place a useage link somewhere. Suggest you look at one of them to see how they do it.

Member
Member
arimakidd   20-05-2010, 19:04
#6

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!

Member
Member
jonscot   20-05-2010, 22:26
#7

Arimakidd,
Any chance of posting your "changes" here, so use new users can learn faster?

Member
Member
arimakidd   21-05-2010, 01:18
#8

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]

Administrator
Administrator
acrylian   21-05-2010, 11:19
#9

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.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.