PDA

View Full Version : Sending postcards


rid
30th of December 2006 (Sat), 10:00
Happy New Year!

I have added some code to send postcards on my site:

http://robertiandavis.com/gallery/

(At the top of the page there is a link.)
The code works most of the time, but I still need to clean it up. If anyone is interested, I'll be glad to share the code.

Ian Davis

ridbus@bellsouth.net

iceman
30th of December 2006 (Sat), 20:57
Very nice feature Ian, I would like to give the code a try!

Thanks

rid
30th of December 2006 (Sat), 22:27
Dennis, glad you liked it. I have put most of the files at:

http://robertiandavis.com/postcard_code/

I have made a tar and a zip of the php files. There is a hints.txt file that outlines what I did.

I am having a problem this side. I'll test the code and get it working perfectly. Then, randomly, it stops working! I have sent the exact same postcard 20 times only to receive a plain text message about half of the time! Then the exact same code will work fine (100% of the time) for a while.

Wish you luck!

Ian.

iceman
31st of December 2006 (Sun), 17:45
Thanks Much! Happy New Year!

UweB
1st of January 2007 (Mon), 05:55
Hi Ian!
i just looked at your gallery and photos. You've been to some very nice island places !

But what i wanted to say is that in the Mozilla 1.7.7 and Firefox 1.5 Browser the oval logo is layered partly on top of the links (right top corner) and also on top of the microthumbs so they are both not visible. In IE it looks OK....

unfortunatley i'm not allowed to post pictures here otherwise i would publish a screenshot...

rid
4th of January 2007 (Thu), 22:07
Thanks Uwe! That was silly of me not to check it on different browsers! I appreciate you looking out for me.

As for the photos, I was born in Barbados, and I go back fairly often. I live in Miami.

Iceman, I have given up sending the full postcard. I am using the coward's way of e-mailing the link. The HTML email is being mangled in transmission.

I am now trying (as of today when I discovered what it was) to make my code XHTML compliant, but I am still at the stage of "dangerous hacker"!

Ian Davis

iceman
5th of January 2007 (Fri), 17:25
No problem, thanks for trying!

Thanks Uwe! That was silly of me not to check it on different browsers! I appreciate you looking out for me.

As for the photos, I was born in Barbados, and I go back fairly often. I live in Miami.

Iceman, I have given up sending the full postcard. I am using the coward's way of e-mailing the link. The HTML email is being mangled in transmission.

I am now trying (as of today when I discovered what it was) to make my code XHTML compliant, but I am still at the stage of "dangerous hacker"!

Ian Davis

rid
6th of January 2007 (Sat), 21:14
The "Postcard" code now appears to be stable. I am just emailing a link (after confirmation)for the card to be viewed online.

As the original code worked well only some of the time, I am removing the files from the link I posted. Some accounts do not accept HTML, and many remove <style statements and links.

If anyone would like the new code, let me know.

Ian Davis

www.robertiandavis.com (http://www.robertiandavis.com)

iceman
8th of January 2007 (Mon), 19:13
Hello Ian, please send me the code---thanks

The "Postcard" code now appears to be stable. I am just emailing a link (after confirmation)for the card to be viewed online.

As the original code worked well only some of the time, I am removing the files from the link I posted. Some accounts do not accept HTML, and many remove <style statements and links.

If anyone would like the new code, let me know.

Ian Davis

www.robertiandavis.com (http://www.robertiandavis.com)

rid
15th of January 2007 (Mon), 23:19
Dennis,

Sorry for the delay! I'll put something together and get it to you, unless you would like my later stuff seen here: http://robertiandavis.com/gallery/accesscontrol/protectedpage.php
This is protected by a separate database just for postcards.

At the moment I am working on integrating a package called Postcard Direct with the EE database. I am almost there, but I need a vital piece of information that I cannot find. The example above is not integrated, it is assembled by hand (hence the duplicate images and text).

The program list.php generates rows of thumbs (or microthumbs). Each of these thumbs (the <img) is wrapped in an <a href="photo.php? etc. I need to know exactly where that code is being generated (prog or function and line number). If I am given this, I can generate code that can send a postcard for any image on your database.

If you need anything in a hurry, email me ridbus@bellsouth.net

Good luck,

Ian.

rid
16th of January 2007 (Tue), 00:32
OK Dennis, I found the lines of code.

I think I'll hold back here and then give you a final (but beta) version that can send a postcard from any image in your EE database. (Nothing is written to the EE database. You will need to create another database.)

The reason for the registration is that you can put anybody's email into the "From" space! Threats and obscenities could be sent!

If you don't want verification, you can download and install the code from Postcard Direct, or just remove the "include" when you get my code.

Ian.

UweB
16th of January 2007 (Tue), 13:18
If your "postcards" are ready i would like to try them too...

iceman
16th of January 2007 (Tue), 19:46
OK Dennis, I found the lines of code.

I think I'll hold back here and then give you a final (but beta) version that can send a postcard from any image in your EE database. (Nothing is written to the EE database. You will need to create another database.)

The reason for the registration is that you can put anybody's email into the "From" space! Threats and obscenities could be sent!

If you don't want verification, you can download and install the code from Postcard Direct, or just remove the "include" when you get my code.

Ian.
I'll just hold on Ian-thanks

rid
19th of January 2007 (Fri), 15:35
Dennis and Uwe:

Here is the link:

http://robertiandavis.com/gallery/accesscontrol/list.php

It is not complete, but if you click on any thumb you can send a postcard (either from the "thumb" or "microthumb" views). (Don't forget to pick Web Mail account or Standard at the bottom of mail form. It won't work if you get it wrong.)

I have written the user account creation/password authorization code already, and will paste it soon.

The code will come in a few days.

Have a good weekend!

Ian.

UweB
20th of January 2007 (Sat), 03:10
Hi Ian, i just wanted to try this out but it looks like this....i published a screenshot of your page in the browser here...:

http://www.borck.ch/postcard.html

have a look...

timned88
21st of January 2007 (Sun), 00:03
i experienced the same errors. hopefully you can get this resolved because i would LOVE to be able to have this functionality on my site as well. good luck and hope to see success soon. thanks for undertaking this project, it will be awesome when done.

rid
22nd of January 2007 (Mon), 23:07
Thanks for the screenshot! I would be grateful if you would let me know what browser you are using, because mine seems to correct all my errors! Looks OK over here, but I did correct several typos.

I put a zip file at:
http://robertiandavis.com/postcard/
To run the prog: http://robertiandavis.com/gallery/accesscontrol/list.php

Simply I am redirecting to a CGI script instead of photo.php

(This is just a hack on duplicated files in a subfolder. A better way of doing it would be to add postcards to the pulldown menu in list.php, and then add extra functions to common functions in basecode. OR to add a plist.php prog under gallery...)

I promise that I will get this working!

Ian.

timned88
23rd of January 2007 (Tue), 23:53
i was using firefox 2.0.
looks much better today, can't wait for the final debugged code. keep up the great work.

UweB
24th of January 2007 (Wed), 01:11
I'm using Mozilla 1.7.7 and for testing i use IE 7, Netscape 8 (here you can switch between the IE and Firefox engines which is very practical) , Opera...

Your page looks better now.... :-)

rid
24th of January 2007 (Wed), 17:37
Thanks to both of you,UweB & timned88! It is very helpful when errors are brought to my attention.

I have now installed both Firefox and Netscape. I just corrected the zip file. At this point the zip is not a "plug in", but rather a rough guide for someone familiar with PHP.

I plan to insert some tracking code using a separate database that stores:
the to and from email addresses, the names, the IP address, the timestamp, and the message. (Users will be alerted to this.) This way a malicious user could be tracked.

My "Send a Postcard" link still points to my first effort, but this will be redirected once I get the tracking code written.

Ian.

iceman
24th of January 2007 (Wed), 17:57
Great,
Thanks Ian

Thanks to both of you,UweB & timned88! It is very helpful when errors are brought to my attention.

I have now installed both Firefox and Netscape. I just corrected the zip file. At this point the zip is not a "plug in", but rather a rough guide for someone familiar with PHP.

I plan to insert some tracking code using a separate database that stores:
the to and from email addresses, the names, the IP address, the timestamp, and the message. (Users will be alerted to this.) This way a malicious user could be tracked.

My "Send a Postcard" link still points to my first effort, but this will be redirected once I get the tracking code written.

Ian.

timned88
27th of January 2007 (Sat), 18:23
sounds good. i keep my fingers crossed.

rid
13th of February 2007 (Tue), 17:33
Finally! It's finished except for cosmetics.
http://robertiandavis.com/gallery/
Click of "SEND A POSTCARD" at the top of the page. Try putting in bad data.

What's in it:
SQL injection protection
Client side: Javascript validation without popups/alerts
Server side: PHP validation + test connection
One miserable little arrow .gif that took me an hour

Bugs:
Let me know if you see any.
Using back button on browser, may put you in the wrong state
If HTML is prohibited, cutting and pasting URL will be needed

Ian.

timned88
13th of February 2007 (Tue), 22:59
wow, that is really awesome. are you going to be posting the finished code? congrats on a job well done.
tim
(www.themagicinpixels.com)

rid
14th of March 2007 (Wed), 18:36
Thanks Tim,

Sorry for the delay. I have been busy elsewhere!

I have decided not to post the code because it is not modular and it will be difficult to adapt, but I will share the major code changes with you via email, if you send me an email at ridbus@bellsouth.net

Basically this is what I did so far.

1. Copied required templates, basecode, outputstyles folders to a subfolder "pc" under gallery
2. Copied list.php and photo.php to "pc"
ONLY change to code in "gallery" was to put a link to pc/list.php on index.php
3. Modified outputstyle of pc/list.php to include captions by default
4. Made major changes to pc/photo.php, including adding form that posts to pc/pc_sendconf.php
5. Wrote pc/pc_sendconf.php which displays postcard, emails confirmation and updates a separate database with details of email
6. Added all the validation/security

A better way would have been to
1. Create a modified copy of list.php postcardlist.php under gallery. Create a template + whatever else is needed for this new file
2. Do the same for photo.php.
3. Incorporate pc_sendconf,php into photo.php

All the best,

Ian.

videoman57
30th of September 2008 (Tue), 21:19
Hi,
Just wanted to know if you still have the postcard script for ee?
Thanks,
jmk

thanks for emailing me...I know you are so busy...I will wait til you have time for the code...Jim

videoman57
9th of October 2008 (Thu), 11:22
Hi,
Just wanted to know if you still have the postcard script for ee?
Thanks,
jmk

thanks for emailing me...I know you are so busy...I will wait til you have time for the code...Jim

videoman57
9th of October 2008 (Thu), 12:14
Hello...
Does anyone out there use EE and also have the postcards or ecards scripting..??? I have looked everywhere, and cannot seem to locate it...I think it is a wonderful addition to any EE photo site? Thanks in advance for your help!
videoman57