Author Topic: Email list of images in lightbox...  (Read 152172 times)

0 Members and 1 Guest are viewing this topic.

Offline jarmen

  • Newbie
  • *
  • Posts: 23
    • View Profile
Email list of images in lightbox...
« on: December 13, 2002, 09:00:00 AM »
Is it possible to create a mod that would allow a registered user to click a link to email the admin a list of images they have in their lightbox, possibly with a comment?  It just needs to have a simple comment field, then email the image names.

This script is all but perfect for my use except for that one feature.

Thanks, excellent job Jan

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
Re: Email list of images in lightbox...
« Reply #1 on: December 13, 2002, 10:20:21 AM »
Quote from: jarmen
Is it possible to create a mod that would allow a registered user to click a link to email the admin a list of images they have in their lightbox, possibly with a comment?  It just needs to have a simple comment field, then email the image names.


Yeap, can be done. I did  so creating a sort of quotation form for the site (which is more than what you are asking for but stripping it down is always easy :) ). The user can with that form ask for an offer. I want to change it in the future so that it feeds into the database but right now a simple eMail is enough for us.

If you want to take a peek http://www.bildagentur-hamburg.com/ - only in German at the moment though. You have to register and then login and from the lightbox ("Leuchtkasten") you'll see a button "Angebot anfordern" ("ask for an offer"). Feel free to try that (yes, also click on "absenden" - just put something in one of the "bemerkung" boxes so that i know it's not real :) )

If this is basically what you need I can post the code here - be aware that it's dirty though and a couple of things are hard-wired where they maybe shouldn't.

cheers,
Bernd

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Very nice
« Reply #2 on: December 13, 2002, 03:54:40 PM »
Very nice site and mod Bernd !  (I like what you've done with the colors and layout.)

Could you post the code you modified for us?  

I'm a photographer who wants to allow publishers to collect images to a lightbox and then use a form, similar to the one you added, to email me a request for those images for their review.  

I'm also a programmer who can get around in PHP so I would be comfortable looking over and adapting what you've done.  Perhaps I can massage it to be more generic for others to use too if you don't mind.

Thanks for the insight.

Offline jarmen

  • Newbie
  • *
  • Posts: 23
    • View Profile
Great
« Reply #3 on: December 13, 2002, 04:20:22 PM »
That's basically what i'm looking for too.  For stock art photography, people are looking at a lot of images.  It helps if they can select the ones they like than just be able to request those automatically plus some comments.  Can you share your code?

Josef

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
here ya go
« Reply #4 on: December 15, 2002, 10:24:08 AM »
OK, first off thnx for the positive feedback. And a special thanks for asking about this thing as I had to go in to see how I actually did it and then find out that it was actually not working because I had a few links messed up ...
:oops:

Here's what I did: basically I took the lightbox.php, added/changed a few things and created a <form> around it which I send with PHP via mail. For this I make use of the PHP feature that when calling a PHP page via a <form> automatically variables are created and filled according to the fields in the <form>. This is actually the easiest part - it's not pretty but for the moment it works :) A nicer solution would be to feed it into the database and send a notification to the admin or something like that (for me that's phase 2 ...).
The HTML is created in the quotation.php with a while ... do loop for all images in the lightbox.

I've created a ZIP file with the files quotation.php (to be put into the 4images root), the quotation.html (to be put into the template folder), the quotation_send.php (the thing that creates the mail out of the <form>) - I did not include the quotation_ok.html nor the quotation_error.html as there is nothing special in there; the paths to them are to be found in the quotation_send.php, and I think they have to be hard coded. Download it from here (Edit: If you want to have the scripts please send me a PM as I want to keep a little bit track of who's getting it and who's not - there is one competitor in exactly our field who I don't want to be aware of this feature/script :? ).

So, I hope you'll find your way around. If you have questions or things are unclear (which wouldn't surprise me) please yell out! And Chris: feel free to massage it as much as you like (as long as we get the results presented but I don't think this needs to be mentioned, right? :-) )

One more remark: I've modified the user registration as you might've seen and the only reason (at least so far) is to automatically put these values into the quotation form when it's called. And there are definetly things in the quotation.php that don't need to be there and are just in there because it has been a lightbox.php once (i.e. I don't really know what they are there for so I rather let them be).

HTH and as I said if there are questions or things that need explanation/clarification please say so!
Bernd

Offline jarmen

  • Newbie
  • *
  • Posts: 23
    • View Profile
Thanks Bernd
« Reply #5 on: December 15, 2002, 07:37:31 PM »
I'll try and mix it in later today.  It would be great if someone could, as you say 'massage' the script, and put it into a packaged .zip with install directions. My PHP is limited so I can try what I can.  I'll let you know my results.  Thanks again.

Josef

Offline mantra

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
    • DREAM WITH MANTRA
Is there any engglish version about this mood??
« Reply #6 on: December 28, 2002, 03:43:16 PM »
Is there any engglish version about this mood??  :wink:

Chris have you try already ??

Offline jarmen

  • Newbie
  • *
  • Posts: 23
    • View Profile
Email list of images in lightbox...
« Reply #7 on: December 28, 2002, 06:24:10 PM »
As soon as I get everything re-packaged I'll post my translated version (if Bernd doesn't mind).

J

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
Email list of images in lightbox...
« Reply #8 on: December 29, 2002, 01:13:17 AM »
Quote from: jarmen
As soon as I get everything re-packaged I'll post my translated version (if Bernd doesn't mind).


Feel free to do so - every contribution is well appreciated :)

cheers,
Bernd

Offline jarmen

  • Newbie
  • *
  • Posts: 23
    • View Profile
Email list of images in lightbox...
« Reply #9 on: December 31, 2002, 05:34:32 AM »
Bernd,

Can you give me some advice on how to better format the email that is sent?  Maybe adding some spaces between the requested images, etc...

thanks

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Cool
« Reply #10 on: December 31, 2002, 03:09:17 PM »
Any progress on the translation / repackaging?

Offline mantra

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
    • DREAM WITH MANTRA
I hope
« Reply #11 on: January 01, 2003, 01:40:51 AM »
First I think format email can have template [ this will be great ]
or adding some spaces between the requested images [ like you said ]

and validation script [ java or php ] to check all field before sending the request
The best feature I hope is separate the database between lightbox and this mood so we can make new button in detail page as this mood, the user donít lose the image in their lightbox if they delete in quotation.

BTW this mood I try already and fined no error

Thanks Bernd
 :wink:  :wink:

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
Email list of images in lightbox...
« Reply #12 on: January 02, 2003, 06:03:33 PM »
Quote from: jarmen
Can you give me some advice on how to better format the email that is sent?  Maybe adding some spaces between the requested images, etc...


Hmm, the part to edit (in the quotation_send.php obviously) would be here
Code: [Select]
while (list($textfeld, $wert) = each ($HTTP_POST_VARS))
$inPHormer_msg .= "$textfeld: $wert\n";


I'm have no real clue about PHP but this is something that works
Code: [Select]
while (list($textfeld, $wert) = each ($HTTP_POST_VARS))
{
if (preg_match("/Bildnr/", $textfeld)) {
$inPHormer_msg .= "\n------------\n\n";
}
else ;
$inPHormer_msg .= "$textfeld: $wert\n";
}


Replace the part Bildnr with the name of the variable before which you want to have the dashes and the extra line breaks (is this understandable?). Anyway, output now looks like this for me
Code: [Select]
[..]
Angebot_via: email

------------

Bildnr_1: 011-10-02
Verwendungszweck_1: z.B. Plakate
Abb_Breite_1:
Abb_Hoehe_1:
Plazierung_1: innen
Auflage_1:
Verbreitung_1: Land
Verbreitungsland_Bezeichnung_1: Deutschland
Nutzungsdauer_1: 1 Jahr
Andere_Nutzungsdauer_1:
Branchensperre_1: nein
Bemerkung_1:

------------

Bildnr_2: 040-10-23
Verwendungszweck_2: z.B. Plakate
Abb_Breite_2:
Abb_Hoehe_2:
Plazierung_2: innen
Auflage_2:
Verbreitung_2: Land
Verbreitungsland_Bezeichnung_2: Deutschland
Nutzungsdauer_2: 1 Jahr
Andere_Nutzungsdauer_2:
Branchensperre_2: nein
Bemerkung_2:
[..]


Or you create an HTML mail and put each image data into one neat table (or you could also put image links that link to thumbnails in there) ... thy sky's the limit :lol:
I stick to the solution I have here right now - next step IMHO should be to not send the stuff via mail but store it in the database and have a page where the admin looks up all the lists.

HTH + cheers,
Bernd

Offline jengwen

  • Jr. Member
  • **
  • Posts: 85
    • View Profile
    • http://www.jenrichardsphotography.com
Any progress
« Reply #13 on: January 09, 2003, 06:41:27 PM »
Any progress made on this yet?  I would love to add this functionality to my web page.  Thanks!

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Email list of images in lightbox...
« Reply #14 on: January 09, 2003, 08:18:58 PM »
Quote from: jarmen
Can you give me some advice on how to better format the email that is sent?  Maybe adding some spaces between the requested images, etc

I suggest you look at phorm from www.phorm.com  It's a very flexible and powerful php form handler.  With it you can easily set the HTML format of emails that get sent.

 

Post your comments here