4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on February 16, 2003, 09:53:51 PM

Title: [Mod] Notify sender on received eCard
Post by: V@no on February 16, 2003, 09:53:51 PM
This MOD will send email notify to the sender, when eCard has been received/viewed by recipient.

----------------------------------------------------------------
Files to edit:
postcards.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/postcard_create.html
/templates/<yourtemplate>/postcard_preview.html

...............................................................................

New template:
/lang/<yourlanguage>/email/postcard_confirm.html
-----------------------------------------------------------------


Step 1.
Open postcards.php

Find:
Code: [Select]
 $recipient_email = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_email']));Add after:
Code: [Select]
$confirm = $HTTP_POST_VARS['confirm'];
1.2
Find:
Code: [Select]
 $sql = "INSERT INTO ".POSTCARDS_TABLE."
          (postcard_id, image_id, postcard_date, postcard_bg_color, postcard_border_color, postcard_font_color, postcard_font_face, postcard_sender_name, postcard_sender_email, postcard_recipient_name, postcard_recipient_email, postcard_headline, postcard_message)
          VALUES
          ('$postcard_id', $image_id, $current_time, '$bg_color', '$border_color', '$font_color', '$font_face', '$sender_name', '$sender_email', '$recipient_name', '$recipient_email', '$headline', '$message')";
  $result = $site_db->query($sql);
Replace with:
Code: [Select]
 $sql = "INSERT INTO ".POSTCARDS_TABLE."
          (postcard_id, image_id, postcard_date, postcard_bg_color, postcard_border_color, postcard_font_color, postcard_font_face, postcard_sender_name, postcard_sender_email, postcard_recipient_name, postcard_recipient_email, postcard_headline, postcard_message, postcard_confirm)
          VALUES
          ('$postcard_id', $image_id, $current_time, '$bg_color', '$border_color', '$font_color', '$font_face', '$sender_name', '$sender_email', '$recipient_name', '$recipient_email', '$headline', '$message', '$confirm')";
  $result = $site_db->query($sql);

1.3.
Find:
Code: [Select]
   $sql = "SELECT p.postcard_id, p.image_id, p.postcard_date, p.postcard_bg_color, p.postcard_border_color, p.postcard_font_color, p.postcard_font_face, p.postcard_sender_name, p.postcard_sender_email, p.postcard_recipient_name, p.postcard_recipient_email, p.postcard_headline, p.postcard_message, i.image_name, i.cat_id, i.image_media_file, i.image_thumb_file
            FROM ".POSTCARDS_TABLE." p, ".IMAGES_TABLE." i
            WHERE p.postcard_id = '$postcard_id' AND p.image_id = i.image_id";
    $image_row = $site_db->query_firstrow($sql);
Replace with:
Code: [Select]
   $sql = "SELECT p.postcard_id, p.image_id, p.postcard_date, p.postcard_bg_color, p.postcard_border_color, p.postcard_font_color, p.postcard_font_face, p.postcard_sender_name, p.postcard_sender_email, p.postcard_recipient_name, p.postcard_recipient_email, p.postcard_headline, p.postcard_message, i.image_name, i.cat_id, i.image_media_file, i.image_thumb_file, p.postcard_confirm
            FROM ".POSTCARDS_TABLE." p, ".IMAGES_TABLE." i
            WHERE p.postcard_id = '$postcard_id' AND p.image_id = i.image_id";
    $image_row = $site_db->query_firstrow($sql);

1.4.
Find:
4images older then v1.7.7
Code: [Select]
   if (!$image_row) {
      $msg = $lang['invalid_postcard_id'];
    }
    else {
4images v1.7.7 or newer
Code: [Select]
    if (!$image_row) {
      show_error_page($lang['invalid_postcard_id']);
    }
    else {

Add after:
Code: [Select]
if ($msg == "" && $image_row['postcard_confirm'] == 1) {
$sql = "UPDATE ".POSTCARDS_TABLE."
SET postcard_confirm = 0
WHERE postcard_id = '$postcard_id'";
$site_db->query($sql);
$current_time = time();
include(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$site_email->set_to(stripslashes($image_row['postcard_sender_email']), stripslashes($image_row['postcard_sender_name']));
$site_email->set_from(stripslashes($config['site_email']), "");
$site_email->set_subject($lang['postcard_confirm_subj']);
$site_email->register_vars(array(
"recipient_name" => stripslashes($image_row['postcard_sender_name']),
"recipient_email" => stripslashes($image_row['postcard_sender_email']),
"sender_name" => stripslashes($image_row['postcard_recipient_name']),
"sender_email" => stripslashes($image_row['postcard_recipient_email']),
"postcard_send_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
"site_url" => $script_url."/details.php?".URL_IMAGE_ID."=".$image_row['image_id'],
"site_name" => $config['site_name']
));
$site_email->set_body("postcard_confirm", $config['language_dir']);
$site_email->send_email();
}

1.5.
Find:
Code: [Select]
   $main_template = "postcard_preview";
    $image = get_media_code($image_row['image_media_file'], $image_id, $cat_id, $image_row['image_name'], $mode, 1);
    $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_id, $cat_id, $image_row['image_name'], $mode);
    $site_template->register_vars(array(
Add right after:
Code: [Select]
"lang_postcard_confirm" => $lang['postcard_confirm'],
"postcard_confirm" => ($HTTP_POST_VARS['confirm'] == 1) ? $lang['yes'] : $lang['no'],
"confirm" => $HTTP_POST_VARS['confirm'],

1.6.
Find:
Code: [Select]
if ($action == "createcard") {
  if (!$sendprocess) {
    $bg_color = "";
    $border_color = "";
    $font_color = "";
    $font_face = "";
    $sender_name = ($user_info['user_level'] != GUEST) ? $user_info['user_name'] : "";
    $sender_email = ($user_info['user_level'] != GUEST) ? $user_info['user_email'] : "";
    $recipient_name = "";
    $recipient_email = "";
    $headline = "";
    $message = "";
  }
  $image = get_media_code($image_row['image_media_file'], $image_id, $cat_id, $image_row['image_name'], $mode, 1);
  $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_id, $cat_id, $image_row['image_name'], $mode);
  $site_template->register_vars(array(
Add right after:
Code: [Select]
"lang_postcard_confirm" => $lang['postcard_confirm']."?",

Step 2.
Open /lang/<yourlanguage>/main.php

Add at the end of the file, just before ?> :
Code: [Select]
$lang['postcard_confirm'] = "Receive confirmation when postcard viewed";
$lang['postcard_confirm_subj'] = "eCard confirmation";


Step 3.
Open /templates/<yourtemplate>/postcard_create.html

Add this:
Code: [Select]
<TR>
<TD class="row1" valign="top"><B>{lang_postcard_confirm}</B></TD>
<TD class="row1" valign="top">
<INPUT type="checkbox" name="confirm" value="1" checked>
</TD>
</TR>


Step 4.
Open /templates/<yourtemplate>/postcard_preview.html

Add this:
Code: [Select]
<B>{lang_postcard_confirm}:</B> {postcard_confirm}and this:
Code: [Select]
   <INPUT type="hidden" name="confirm" value="{confirm}" />

Step 5.
Create new template /lang/<yourlanguage>/email/postcard_confirm.html
Insert this:
Code: [Select]
Dear {recipient_name},

{sender_name} ({sender_email}) received your eCard!

{site_url}
--
Best regards,
{site_name}


Step 6.
Download install_ecard.zip ... then unzip it, upload it to 4images ROOT dir and start it. [ update 04.01.2007 by mawenzi ]

Now, when u are sending eCard, u have an option to receive a notify, when your recipient viewed the eCard.

http://gallery.vano.org/postcard7570

P.S. sorry for my bad english, if u think of better text for this mod, let me know.
Title: [Mod] Notify sender on received eCard
Post by: fabulous on February 17, 2003, 04:21:21 PM
i just did it, works perfectly, thanks V@no :D
Title: Reply and {postcard_url}
Post by: edndale on February 18, 2003, 02:54:59 AM
I tried this edit in the
lang/<your language>/email
templates for the newly created
postcard_confirm.html
**************************
Dear {recipient_name},

<A href=mailto:{sender_email}>{sender_name}</A> received your eCard!

{postcard_url}

{site_url}
--
Best regards,
{site_name}
***********************

But the reply in email prints as:

Dear testing,

<A href=mailto:someoone@home.com>Mr. Someone</A> received your eCard!

{postcard_url}

http://yoursite.com/postcard/details.php?image_id=78
--
Best regards,
Your Gallery


The postcard_url doesn't get printed while the site_url does...

QUESTION 1:
Is there another step to have {postcard_url} process like it does in postcard_message.html?

QUESTION 2:
Can html tags be used in the email confirmation?
 :roll:
Title: [Mod] Notify sender on received eCard
Post by: V@no on February 18, 2003, 04:06:36 AM
Answer 1:
in Step 1.4. add
Code: [Select]
     "url_postcard" => $script_url."/postcards.php?".URL_POSTCARD_ID."=".$postcard_id,
after
Code: [Select]
"site_url" => $script_url."/details.php?".URL_IMAGE_ID."=".$image_row['image_id'],

Answer 2:
4images uses plain text for sending emails, so, it's not possible now.
Title: [Mod] Notify sender on received eCard
Post by: irishblue on February 26, 2003, 06:46:47 PM
how did you do the swatches color selection on your site? looks good!  :)  could you show us how you did that? instead of the few default colors we are given. Thanks!
Title: Ya V@no
Post by: mantra on March 18, 2003, 02:53:08 AM
Yes V@no would you share with us how you do that [ selecting color on E-card ]

 :wink:  :wink:
Title: Re: Ya V@no
Post by: V@no on March 18, 2003, 05:44:47 AM
Quote from: mantra
Yes V@no would you share with us how you do that [ selecting color on E-card ]

 :wink:  :wink:

here is my template:
http://come.no-ip.com/postcard_create.phps
also, u'll need that "colors" image.
Title: Thanks V@no
Post by: mantra on March 21, 2003, 01:39:16 AM
Thanks V@no :D
100% NICE
Title: Re: Ya V@no
Post by: Harry on March 30, 2003, 04:15:20 PM
Quote from: V@no
Quote from: mantra
Yes V@no would you share with us how you do that [ selecting color on E-card ]

 :wink:  :wink:

here is my template:
http://come.no-ip.com/postcard_create.phps
also, u'll need that "colors" image.


Hello V@no,

I think I got it to work, but one of the nasty side effects seems to be that the "modify your ecard" button does not work anymore. I tried it on your site as well and that has the same problem. Do you have any idea how to fix this? If you cannot edit your ecard there is no use of a preview...

(edit:) I just discovered ths has nothing to do with the mod (I think?!?) But the problem is there; is this a bug of the main script?

Thanks,
Harry
Title: Re: Ya V@no
Post by: V@no on March 30, 2003, 04:29:40 PM
Quote from: Harry
I tried it on your site as well and that has the same problem.

HUH???  8O  8O  8O
hehe.
I'm not quet sure what are u talking about, it working perfectly for me.

Make sure that JavaScript is anabled on your system, because "back" button uses javascript to go back in the "history".
Title: Re: Ya V@no
Post by: Harry on March 30, 2003, 06:21:15 PM
Quote from: V@no
Quote from: Harry
I tried it on your site as well and that has the same problem.

HUH???  8O  8O  8O
hehe.
I'm not quet sure what are u talking about, it working perfectly for me.

Make sure that JavaScript is anabled on your system, because "back" button uses javascript to go back in the "history".


errr, rebooting helps!  8O  :?  :roll:

Seems to be a cache problems with the postcards.php script, still happens every now and then..

Butyour script works now, I have altered the layout and some options quite abit, you can see it at: http://7summits.com/images

Thanks again for the mod,
Harry
Title: [Mod] Notify sender on received eCard
Post by: V@no on March 30, 2003, 06:50:29 PM
works just fine to me.
Title: Sender notify on eCard received
Post by: MiG26 on April 01, 2003, 05:10:35 PM
Quote from: V@no
works just fine to me.


and for me,  :D
tanks you all for your help

http://www.mig26.com/pictures
Title: [Mod] Notify sender on received eCard
Post by: Shap on April 02, 2003, 02:53:43 AM
Very Nice!!!

Could it be possible to auto blind carbon copy an email to the admin, kind of a way to count or see how many ecards are getting sent?
Title: [Mod] Notify sender on received eCard
Post by: V@no on April 02, 2003, 03:52:30 AM
Quote from: Shap
Very Nice!!!

Could it be possible to auto blind carbon copy an email to the admin, kind of a way to count or see how many ecards are getting sent?

yes, it's not a problem, but...I'd reather make some eCards stats, something like "Keep Track Of What Each User Has Downloaded  (http://4homepages.de/forum/viewtopic.php?t=4606)
Any valuntiers to make something like that? :wink: :D
btw, I already implimented something like that into my site, u can see it in memberlist (http://come.no-ip.com/memberlist.php)
right now the code is tooooooo massy, as soon as I clean it up little bit, I'll post it (unless someone else do it ;))
Title: [Mod] Notify sender on received eCard
Post by: Shap on April 02, 2003, 06:07:55 AM
Quote from: V@no

yes, it's not a problem, but...I'd reather make some eCards stats, something like "Keep Track Of What Each User Has Downloaded  (http://4homepages.de/forum/viewtopic.php?t=4606)
Any valuntiers to make something like that? :wink: :D
btw, I already implimented something like that into my site, u can see it in memberlist (http://come.no-ip.com/memberlist.php)
right now the code is tooooooo massy, as soon as I clean it up little bit, I'll post it (unless someone else do it ;))


WOW, i like your members page! I'm a stats freak, did the "Keep Track Of What Each User Has Downloaded" MOD do all that?

I likes.........a lot!

I'd Love to create an eCards stats page, cause I think its probably the "most needed" MOD not out yet, but my experience with PHP is copy/paste only  :cry:
Title: [Mod] Notify sender on received eCard
Post by: djavet on April 08, 2003, 03:37:35 PM
Just install this new mod, great!!!
But I've a little problem...

I can see only the public folder, no more the folder for members... Snif snif.. What is wrong...?

-> http://www.john-howe.com/portfolio/


Thx for your help.
Title: [Mod] Notify sender on received eCard
Post by: djavet on April 08, 2003, 05:11:08 PM
:D

Everything is ok now.
I've nothing change, all all is ok...
Don't know if my host reboot the server, maybe!
Strange thing... Pülease ignore this post.

Sorry.
Regards, Dom
Title: [Mod] Notify sender on received eCard
Post by: Shap on April 09, 2003, 02:52:44 AM
Quote from: V@no

yes, it's not a problem, but...I'd reather make some eCards stats, something like "Keep Track Of What Each User Has Downloaded  (http://4homepages.de/forum/viewtopic.php?t=4606)
Any valuntiers to make something like that? :wink: :D
btw, I already implimented something like that into my site, u can see it in memberlist (http://come.no-ip.com/memberlist.php)
right now the code is tooooooo massy, as soon as I clean it up little bit, I'll post it (unless someone else do it ;))



Post it! Post it! Post it!  8)
Title: [Mod] Notify sender on received eCard
Post by: boeser on June 07, 2003, 11:27:05 AM
Hi V@no!

i realized a little mistake in your additional mod

you wrote:

Quote from: V@no
Answer 1:
in Step 1.4. add
Code: [Select]
     "url_postcard" => $site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_row['image_id']),
after
Code: [Select]
"site_url" => $script_url."/details.php?".URL_IMAGE_ID."=".$image_row['image_id'],



the line we have to add should be:

Code: [Select]

"url_postcard" => $script_url."/postcards.php?".URL_POSTCARD_ID."=".$postcard_id


then it works fine for me!

and thank you for this great mod!
jan

(not the "4homepage.de-jan")  :wink:
Title: [Mod] Notify sender on received eCard
Post by: V@no on June 07, 2003, 05:23:58 PM
thx, boeser! :D
I just updated my post.
Title: arrrrrggghhhhh
Post by: WaywardTraveller on June 29, 2003, 08:05:00 PM
I have almost finished installing this hack for the Image Gallery...but I clicked on the hyperlink to download those files I need (i.e. from the come.no-ip.com site) and the SQL server is dooooowwwwwnnnnnn!!

Can someone kindly post those files again, or (even better) if someone were so kind as to email them to me, it would be much appreciated  8)

peace
WaywardTraveller
Title: Re: [Mod] Notify sender on received eCard
Post by: that Dude on March 26, 2005, 08:27:09 AM
Question 1: Excuse me if it is a silly question but when I send an e-card the receiver gets the following message:

Your eCard has been sent on 25.03.2005 21:52and will be stored in our..

I wanted to use the following insted

Your e-Card has been sent on 25.03.2005 21:52 and will be stored in our..

What kind of changes that I need to make? thanks for you help!

Question 2: What are the thing you need to change if you used "1.7, 1.7.1: "Modify eCard" / "eCard bearbeiten" button" (http://www.4homepages.de/forum/index.php?topic=6805.0) already?
Title: Re: [Mod] Notify sender on received eCard
Post by: udaman on August 28, 2005, 05:29:49 AM
Quote
"postcard_url" => $script_url."/postcards.php?".URL_POSTCARD_ID."=".$postcard_id,

I had to use the above code..

I am trying to solve the following problem as well. Any help will be appreciated.

Your eCard has been sent on 25.03.2005 21:52and will be stored in our.. (no space between the time and "and" part)
Title: Re: [Mod] Notify sender on received eCard
Post by: ungu on September 24, 2005, 10:13:30 PM
Hatte wie beschreieben die notify installiert bzw geändert. Jetzt kommt aber beim senden der ecard diese meldung:

DB Error: Bad SQL Query: INSERT INTO 4images_postcards (postcard_id, image_id, postcard_date, postcard_bg_color, postcard_border_color, postcard_font_color, postcard_font_face, postcard_sender_name, postcard_sender_email, postcard_recipient_name, postcard_recipient_email, postcard_headline, postcard_message, postcard_confirm) VALUES ('a0bc4086721faf245a9d0b011a4f9bff', 120, 1127592584, '#ffffff', '#000000', '#000000', 'arial', 'testing', 'ayu@weinandy.net', 'volker', 'volker@weinandy.net', 'testing', 'testing', '1')
Unknown column 'postcard_confirm' in 'field list'

was habe ich da falsch gemacht? danke :)
Title: Re: [Mod] Notify sender on received eCard
Post by: V@no on September 24, 2005, 10:30:38 PM
Step 6.
Download "eCard Notify Install (http://gallery.vano.org/file14dl)"

then unzip it, upload it to 4images ROOT dir and start it.
Title: Re: [Mod] Notify sender on received eCard
Post by: ungu on September 24, 2005, 10:38:06 PM
Hmmmm... das habe vorhin schon gemacht.... habe's nochmal wiederholt...kommt aber immer noch gleiche fehlermeldung....
was ist mit start it gemeint?? habe das .php mit ftp im root upgeloaded muss ich noch machen?
Title: Re: [Mod] Notify sender on received eCard
Post by: mawenzi on September 25, 2005, 12:14:43 AM
@ ungu,

Quote from: ungu
was ist mit start it gemeint??

... :roll: ... nichts für ungut, aber ...

die Datei http://.../install_ecard.php musst du direkt in deiner Browserzeile aufrufen (d.h. ...start it ...) ... und so wird die erforderliche Tabelle in deiner 4images-Datenbank installiert.

mawenzi
Title: Re: [Mod] Notify sender on received eCard
Post by: ungu on September 25, 2005, 12:23:40 AM
Oh man.... das ist ja so peinlich  :oops:

trotzdem...vielen dank mawenzi und V@no, jetzt funz wieder :) happy weekend ;)
Title: Re: [Mod] Notify sender on received eCard
Post by: Vincent on October 21, 2005, 10:24:28 AM
is it possible to send a information to the sender if the ECard has not been picked up!

and is there a postcard couter?

sincerly
vincent
Title: Re: [Mod] Notify sender on received eCard
Post by: Vincent on November 06, 2005, 08:21:58 AM
up
Title: Re: [Mod] Notify sender on received eCard
Post by: ulisses2003 on November 09, 2005, 06:41:05 AM
what happend...  just before to send the card the browser show this error

Template Error: Couldn't open Template ./templates/7dana/.html

i need your help thanks
Title: Re: [Mod] Notify sender on received eCard
Post by: Vincent on November 09, 2005, 07:32:03 AM
@ulisses2003
there is something missing - which html file should be opend?

7dana/.html

sincerly
vincent

Title: Re: [Mod] Notify sender on received eCard
Post by: Klaus99 on February 21, 2006, 10:31:54 PM
Hatte wie beschreieben die notify installiert bzw geändert. Beim Kartenerstellen ist das Auswahlfeld "Receive confirmation when postcard viewed?" standardmäßig aktiv. Doch egal ob aktiv oder deaktiviert, der Kartenversender erhält keine Bestätigung.
Wer kann mir helfen?  www.p-fach.de/postcard
MfG
Klaus


Ich habe mal meine postcard.php eingefügt, vielleicht weiß jemand woran es liegt.(Der Code wurde schon mal geändert, da man von der Vorschau nicht zurück auf Bearbeiten konnte.

 <?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: postcards.php                                        *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.1                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
if (isset($HTTP_GET_VARS[URL_POSTCARD_ID]) || isset($HTTP_POST_VARS[URL_POSTCARD_ID])) {
  $postcard_id = (isset($HTTP_GET_VARS[URL_POSTCARD_ID])) ? trim($HTTP_GET_VARS[URL_POSTCARD_ID]) : trim($HTTP_POST_VARS[URL_POSTCARD_ID]);
}
else {
  $postcard_id = 0;
}

if ($action == "") {
  $action = ($postcard_id) ? "showcard" : "createcard";
}

$main_template = ($action == "createcard" || $action == "modifycard") ? "postcard_create" :  (($action == "previewcard") ? "postcard_create" : "postcard_send");
include(ROOT_PATH.'includes/page_header.php');

$sendprocess = 0;

if ($action != "showcard") {
  $sql = "SELECT i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, c.cat_name".get_user_table_field(", u.", "user_name")."
          FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_id = $image_id";
  $image_row = $site_db->query_firstrow($sql);
  if (!$image_row) {
    header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
    exit;
  }
  $cat_id = $image_row['cat_id'];
  $image_row['user_name'] = $image_row[$user_table_fields['user_name']];
 
  if (!check_permission("auth_sendpostcard", $cat_id)) {
    header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
    exit;
  }
}

if ($action == "sendcard") {
  $expiry = time() - 60 * 60 * 24 * POSTCARD_EXPIRY;
  $sql = "DELETE FROM ".POSTCARDS_TABLE."
          WHERE (postcard_date < $expiry)";
  $site_db->query($sql);

  $bg_color = un_htmlspecialchars(trim($HTTP_POST_VARS['bg_color']));
  $border_color = un_htmlspecialchars(trim($HTTP_POST_VARS['border_color']));
  $font_color = un_htmlspecialchars(trim($HTTP_POST_VARS['font_color']));
  $font_face = un_htmlspecialchars(trim($HTTP_POST_VARS['font_face']));

  $sender_name = un_htmlspecialchars(trim($HTTP_POST_VARS['sender_name']));
  $sender_email = un_htmlspecialchars(trim($HTTP_POST_VARS['sender_email']));
  $recipient_name = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_name']));
  $recipient_email = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_email']));

$confirm = $HTTP_POST_VARS['confirm'];


  $headline = un_htmlspecialchars(trim($HTTP_POST_VARS['headline']));
  $message = un_htmlspecialchars(trim($HTTP_POST_VARS['message']));

  $back_url = (!empty($HTTP_POST_VARS['back_url'])) ? stripslashes(trim($HTTP_POST_VARS['back_url'])) : $site_sess->url(ROOT_PATH."index.php", "&");

  $postcard_id = get_random_key(POSTCARDS_TABLE, "postcard_id");
  $current_time = time();

 $sql = "INSERT INTO ".POSTCARDS_TABLE."
         (postcard_id, image_id, postcard_date, postcard_bg_color, postcard_border_color, postcard_font_color, postcard_font_face, postcard_sender_name, postcard_sender_email, postcard_recipient_name, postcard_recipient_email, postcard_headline, postcard_message, postcard_confirm)
         VALUES
         ('$postcard_id', $image_id, $current_time, '$bg_color', '$border_color', '$font_color', '$font_face', '$sender_name', '$sender_email', '$recipient_name', '$recipient_email', '$headline', '$message', '$confirm')";
 $result = $site_db->query($sql);
  if ($result) {
    $postcard_url = $script_url."/postcards.php?".URL_POSTCARD_ID."=".$postcard_id;

    include(ROOT_PATH.'includes/email.php');
    $site_email = new Email();
    $site_email->set_to(stripslashes($recipient_email));
    $site_email->set_from(stripslashes($sender_email), stripslashes($sender_name));
    $site_email->set_subject($lang['send_postcard_emailsubject']);
    $site_email->register_vars(array(
      "sender_name" => stripslashes($sender_name),
      "sender_email" => stripslashes($sender_email),
      "recipient_name" => stripslashes($recipient_name),
      "postcard_url" => stripslashes($postcard_url),
      "postcard_send_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
      "site_name" => $config['site_name']
    ));
    $site_email->set_body("postcard_message", $config['language_dir']);
    $site_email->send_email();

    $msg .= $lang['send_postcard_success'];
    $msg .= "<br /><a href=\"".$back_url."\">".$lang['back_to_gallery']."</a>";
    $action = "showcard";
  }
  else {
    $msg = $lang['general_error'];
    $action = "previewcard";
    $main_template = "postcard_preview";
  }
}

if ($action == "showcard") {
  $expiry = time() - 60 * 60 * 24 * POSTCARD_EXPIRY;
  $sql = "DELETE FROM ".POSTCARDS_TABLE."
          WHERE (postcard_date < $expiry)";
  $site_db->query($sql);

  if (!$postcard_id){
    header("Location: ".$site_sess->url(ROOT_PATH."index.php", "&"));
    exit;
  }
  else {
    $sql = "SELECT p.postcard_id, p.image_id, p.postcard_date, p.postcard_bg_color, p.postcard_border_color, p.postcard_font_color, p.postcard_font_face, p.postcard_sender_name, p.postcard_sender_email, p.postcard_recipient_name, p.postcard_recipient_email, p.postcard_headline, p.postcard_message, i.image_name, i.cat_id, i.image_media_file, i.image_thumb_file, p.postcard_confirm
           FROM ".POSTCARDS_TABLE." p, ".IMAGES_TABLE." i
           WHERE p.postcard_id = '$postcard_id' AND p.image_id = i.image_id";
   $image_row = $site_db->query_firstrow($sql);
    if (!$image_row) {
      $msg = $lang['invalid_postcard_id'];
    }
    else {
if ($msg == "" && $image_row['postcard_confirm'] == 1) {
            $sql = "UPDATE ".POSTCARDS_TABLE."
                        SET postcard_confirm = 0
                        WHERE postcard_id = '$postcard_id'";
            $site_db->query($sql);
            $current_time = time();
            include(ROOT_PATH.'includes/email.php');
            $site_email = new Email();
            $site_email->set_to(stripslashes($image_row['postcard_sender_email']), stripslashes($image_row['postcard_sender_name']));
            $site_email->set_from(stripslashes($config['site_email']), "");
            $site_email->set_subject($lang['postcard_confirm_subj']);
            $site_email->register_vars(array(
               "recipient_name" => stripslashes($image_row['postcard_sender_name']),
               "recipient_email" => stripslashes($image_row['postcard_sender_email']),
               "sender_name" => stripslashes($image_row['postcard_recipient_name']),
               "sender_email" => stripslashes($image_row['postcard_recipient_email']),
               "postcard_send_date" => format_date($config['date_format']." ".$config['time_format'], $current_time),
               "site_url" => $script_url."/details.php?".URL_IMAGE_ID."=".$image_row['image_id'],
               "site_name" => $config['site_name']
            ));
            $site_email->set_body("postcard_confirm", $config['language_dir']);
            $site_email->send_email();
         }



      $image = get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, 1);
      $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode);
      $image_name_link = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\">".htmlspecialchars($image_row['image_name'])."</a>";
      $site_template->register_vars(array(
        "image" => $image,
        "thumbnail" => $thumbnail,
        "image_name_link" => $image_name_link,
        "bg_color" => htmlspecialchars($image_row['postcard_bg_color']),
        "border_color" => htmlspecialchars($image_row['postcard_border_color']),
        "font_color" => htmlspecialchars($image_row['postcard_font_color']),
        "font_face" => htmlspecialchars($image_row['postcard_font_face']),
        "sender_name" => htmlspecialchars($image_row['postcard_sender_name']),
        "sender_email" => htmlspecialchars($image_row['postcard_sender_email']),
        "recipient_name" => htmlspecialchars($image_row['postcard_recipient_name']),
        "recipient_email" => htmlspecialchars($image_row['postcard_recipient_email']),
        "headline" => htmlspecialchars($image_row['postcard_headline']),
        "message" => htmlspecialchars($image_row['postcard_message'])
      ));
    }
  }
}




if ($action == "previewcard") {
  $error = 0;
  $bg_color = htmlspecialchars(trim($HTTP_POST_VARS['bg_color']));
  $border_color = htmlspecialchars(trim($HTTP_POST_VARS['border_color']));
  $font_color = htmlspecialchars(trim($HTTP_POST_VARS['font_color']));
  $font_face = htmlspecialchars(trim($HTTP_POST_VARS['font_face']));

  $sender_name = htmlspecialchars(trim($HTTP_POST_VARS['sender_name']));
  $sender_email = htmlspecialchars(trim($HTTP_POST_VARS['sender_email']));
  $recipient_name = htmlspecialchars(trim($HTTP_POST_VARS['recipient_name']));
  $recipient_email = htmlspecialchars(trim($HTTP_POST_VARS['recipient_email']));

  $headline = htmlspecialchars(trim($HTTP_POST_VARS['headline']));
  $message = htmlspecialchars(trim($HTTP_POST_VARS['message']));

  $back_url = (!empty($HTTP_POST_VARS['back_url'])) ? htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['back_url']))) : $site_sess->url(ROOT_PATH."index.php, "&"");

  if ($sender_name == "" || $sender_email == "" || $recipient_name == "" || $recipient_email == "" || $headline == "" || $message == "") {
    $msg .= $lang['lostfield_error'];
    $error = 1;
  }
  if (($sender_email != "" && !check_email($sender_email)) || ($recipient_email != "" && !check_email($recipient_email))) {
    $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_email_format'];
    $error = 1;
  }

  if (!$error) {
    $main_template = "postcard_preview";
    $image = get_media_code($image_row['image_media_file'], $image_id, $cat_id, $image_row['image_name'], $mode, 1);
    $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_id, $cat_id, $image_row['image_name'], $mode);
    $site_template->register_vars(array("lang_postcard_confirm" => $lang['postcard_confirm'],
         "postcard_confirm" => ($HTTP_POST_VARS['confirm'] == 1) ? $lang['yes'] : $lang['no'],
         "confirm" => $HTTP_POST_VARS['confirm'],
      "image" => $image,
      "thumbnail" => $thumbnail,
      "image_name" => $image_row['image_name'],
      "url_postcard" => $site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_id),
      "bg_color" => stripslashes($bg_color),
      "border_color" => stripslashes($border_color),
      "font_color" => stripslashes($font_color),
      "font_face" => stripslashes($font_face),
      "sender_name" => stripslashes($sender_name),
      "sender_email" => stripslashes($sender_email),
      "recipient_name" => stripslashes($recipient_name),
      "recipient_email" => stripslashes($recipient_email),
      "headline" => stripslashes($headline),
      "message" => stripslashes($message),
      "lang_sender" => $lang['sender'],
      "lang_recipient" => $lang['recipient'],
      "lang_edit_postcard" => $lang['edit_postcard'],
      "lang_send_postcard" => $lang['send_postcard'],
      "back_url" => $back_url
    ));
  }
  else {
    $action = "createcard";
    $main_template = "postcard_create";
    $sendprocess = 1;
  }
}

if ($action == "createcard" || $action == "modifycard") {
  if (!$sendprocess) {

 if ($action == "modifycard") {
    $bg_color = un_htmlspecialchars(trim($HTTP_POST_VARS['bg_color']));
    $border_color = un_htmlspecialchars(trim($HTTP_POST_VARS['border_color']));
    $font_color = un_htmlspecialchars(trim($HTTP_POST_VARS['font_color']));
    $font_face = un_htmlspecialchars(trim($HTTP_POST_VARS['font_face']));

    $sender_name = un_htmlspecialchars(trim($HTTP_POST_VARS['sender_name']));
    $sender_email = un_htmlspecialchars(trim($HTTP_POST_VARS['sender_email']));
    $recipient_name = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_name']));
    $recipient_email = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_email']));

    $headline = un_htmlspecialchars(trim($HTTP_POST_VARS['headline']));
    $message = un_htmlspecialchars(trim($HTTP_POST_VARS['message']));
  }




    $bg_color = "";
    $border_color = "";
    $font_color = "";
    $font_face = "";
    $sender_name = ($user_info['user_level'] != GUEST) ? $user_info['user_name'] : "";
    $sender_email = ($user_info['user_level'] != GUEST) ? $user_info['user_email'] : "";
    $recipient_name = "";
    $recipient_email = "";
    $headline = "";
    $message = "";
  }
 


  $image = get_media_code($image_row['image_media_file'], $image_id, $cat_id, $image_row['image_name'], $mode, 1);
  $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_id, $cat_id, $image_row['image_name'], $mode);
 $site_template->register_vars(array("lang_postcard_confirm" => $lang['postcard_confirm']."?",
    "image" => $image,
    "thumbnail" => $thumbnail,
    "image_name" => $image_row['image_name'],
    "lang_bg_color" => $lang['bg_color'],
    "bg_color" => $bg_color,
    "lang_border_color" => $lang['border_color'],
    "border_color" => $border_color,
    "lang_font_color" => $lang['font_color'],
    "font_color" => $font_color,
    "lang_font_face" => $lang['font_face'],
    "font_face" => $font_face,
    "lang_sender" => $lang['sender'],
    "lang_recipient" => $lang['recipient'],
    "lang_email" => $lang['email'],
    "lang_name" => $lang['name'],
    "lang_headline" => $lang['headline'],
    "lang_message" => $lang['message'],
    "lang_preview_postcard" => $lang['preview_postcard'],
    "url_postcard" => $site_sess->url(ROOT_PATH."postcards.php?".URL_IMAGE_ID."=".$image_id),
    "sender_name" => stripslashes($sender_name),
    "sender_email" => stripslashes($sender_email),
    "recipient_name" => stripslashes($recipient_name),
    "recipient_email" => stripslashes($recipient_email),
    "headline" => stripslashes($headline),
    "message" => stripslashes($message),
    "lang_send_postcard" => $lang['send_postcard'],
    "back_url" => stripslashes($url)
  ));}

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($mode == "lightbox" && !empty($user_info['lightbox_image_ids'])) {
  $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php")."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id."&amp;mode=".$mode)."\" class=\"clickstream\">".$image_row['image_name']."</a>".$config['category_separator'];
}
elseif ($mode == "search" && !empty($session_info['search_id'])) {
  $clickstream .= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?show_result=1")."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id."&amp;mode=".$mode)."\" class=\"clickstream\">".$image_row['image_name']."</a>".$config['category_separator'];
}
else {
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".$image_row['image_name']."</a>".$config['category_separator'];
}
$clickstream .= $lang['send_postcard']."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream,
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
Title: Re: [Mod] Notify sender on received eCard
Post by: IcEcReaM on February 21, 2006, 11:12:03 PM
Die Karte ist aber schon vom Empfänger gelesen worden, oder?
Der Mod sendet nur ne Mail, wenn die E-Card vom Empfnger gelesen wurde.
Title: Re: [Mod] Notify sender on received eCard
Post by: Klaus99 on February 22, 2006, 12:01:05 AM
Ja, die Karte wurde vom Empfänger schon gelesen. Wenn ich nach dem erstellen der Karte auf Vorschau gehe steht dort "Receive confirmation when postcard viewed: Nein", auch wenn ich es bei der erstellung der Karte auf "ja" eingestellt hatte.
Title: Re: [Mod] Notify sender on received eCard
Post by: Yeti on December 23, 2006, 08:18:13 PM
1.)   
Quote
Step 6.
Download "eCard Notify Install (http://gallery.vano.org/file14dl)"
the link is down :?


2. I foünd the code for step 1   3 times. Shall I alter it only at its first Position or at all 3 Positions?
   Ich habe den Code von Step 1 gleich 3 Mal gefunden. Soll ich die Änderung nur an der ersten Fundstelle einfügen, oder gleich alle 3 mal?
Open postcards.php

 Step 1:Find:
Code:
 $recipient_email = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_email']));Add after:
Code:
   $confirm = $HTTP_POST_VARS['confirm'];
Title: Re: [Mod] Notify sender on received eCard
Post by: IcZin on January 02, 2007, 02:27:38 AM
HELP !!! Vano... help....
Quote
Step 6.
Download "eCard Notify Install"
the link is down  8O :!:
Title: Re: [Mod] Notify sender on received eCard
Post by: mawenzi on January 04, 2007, 10:37:46 PM
@ Yeti, IcZin ...

... I've updated the first post ...
Title: Re: [Mod] Notify sender on received eCard
Post by: CeJay on January 05, 2007, 06:44:43 AM
@ mawenzi
Thanks for doing that!
Title: Re: [Mod] Notify sender on received eCard
Post by: Yeti on January 05, 2007, 04:54:59 PM
Danke für die schnelle Hilfe, Mawenzi!
Title: Re: [Mod] Notify sender on received eCard
Post by: Mirwais on January 14, 2007, 08:55:55 PM
Hello!!
i get error when I send an post card.

Quote
Fatal error: Cannot redeclare class email in /mounted-storage/home27b/sub003/sc17661-ZQKX/dostaan.com/4images/includes/email.php on line 28

Please Help someone

Thanks
Title: Re: [Mod] Notify sender on received eCard
Post by: Mirwais on January 16, 2007, 06:39:07 PM
Please Help some one!!!!!!!
Title: Re: [Mod] Notify sender on received eCard
Post by: mawenzi on January 18, 2007, 10:13:34 AM
@ Mirwais
1. I got no error by sending a post card from your website ... !
2. if you further get the error message ... restore your backup and try to install the mod again ...
3. where is the copyright notice on your gallery on http://dostaan.com/videos/ ... ?
4. you acquired a 4images Copyright-Removal-Licence ... ?
Title: Re: [Mod] Notify sender on received eCard
Post by: jojomart on January 01, 2008, 11:32:40 PM
Hi,

I'd like to use this mod on my site, but I'm running 1.74 and I can't find the following code in postcards.php:

Code: [Select]
if (!$image_row) {
      $msg = $lang['invalid_postcard_id'];
    }
    else {

Can you help me with this?

Thanks,
Joanne
Title: Re: [Mod] Notify sender on received eCard
Post by: thunderstrike on January 01, 2008, 11:40:45 PM
I use 4images v1.74 and I see on line 153 of postcards.php file ...
Title: Re: [Mod] Notify sender on received eCard
Post by: jojomart on January 02, 2008, 12:02:24 AM
I use 4images v1.74 and I see on line 153 of postcards.php file ...

Here's what I have in that section:

Code: [Select]

  if (!$image_row) {
      show_error_page($lang['invalid_postcard_id']);
    }
    else {
      $image = get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, 1);
      $thumbnail = get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode);
      $image_name_link = "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."\">".format_text($image_row['image_name'])."</a>";
      $site_template->register_vars(array(
        "image" => $image,
        "thumbnail" => $thumbnail,
        "image_name_link" => $image_name_link,
        "bg_color" => format_text($image_row['postcard_bg_color'], 2),
        "border_color" => format_text($image_row['postcard_border_color'], 2),
        "font_color" => format_text($image_row['postcard_font_color'], 2),
        "font_face" => format_text($image_row['postcard_font_face'], 2),
        "sender_name" => format_text($image_row['postcard_sender_name'], 2),
        "sender_email" => format_text($image_row['postcard_sender_email'], 2),
        "recipient_name" => format_text($image_row['postcard_recipient_name'], 2),
        "recipient_email" => format_text($image_row['postcard_recipient_email'], 2),
        "headline" => format_text($image_row['postcard_headline']),
        "message" => format_text($image_row['postcard_message'])
      ));

Does all the stuff after:

Code: [Select]
  if (!$image_row) {
      show_error_page($lang['invalid_postcard_id']);
    }
    else {

get replaced by the mod code - or is it added before the other?

Thanks!

NEVER MIND - figured it out for myself
Title: Re: [Mod] Notify sender on received eCard
Post by: surferboy on April 23, 2010, 04:27:37 AM
Hi -

Just installed this MOD.  Using v1.7.7.

Pulling this post. Just realized I uploaded the postcard_confirm.html to the template directory instead of the email directory.

Sorry to take up your time.

Brian
Title: Re: [Mod] Notify sender on received eCard
Post by: zakaria666 on July 31, 2010, 09:07:25 PM
Vano

I cannot find this code

if (!$image_row) {
      $msg = $lang['invalid_postcard_id'];
    }
    else {

inside of postcard.php, and i was wondering then how do i do this mod?? thank u sir
Title: Re: [Mod] Notify sender on received eCard
Post by: V@no on July 31, 2010, 09:28:13 PM
search for
    if (!$image_row) {
      show_error_page($lang['invalid_postcard_id']);
    }
    else {
Title: Re: [Mod] Notify sender on received eCard
Post by: zakaria666 on July 31, 2010, 10:01:15 PM
sorry sir, i just have one question and this is for ALLL of the mods that are made by u and also others.

Whenever i go back in time to look at the MODs and then i want to try them i tend to see alot of syntax not being the same, now a variable here and there are changed, does this mean things have changed and MOD's that are later back in time cannot be integrated with version 1.77. Or does it just mean that certain syntaxs have changed and it doesnt really matter, MODS will still work.

Sorry sir, i thought i should ask this question now instead of keep on asking u everytme i find a syntax not matching the MOD u have made.

God bless u 
Title: Re: [Mod] Notify sender on received eCard
Post by: V@no on July 31, 2010, 10:07:00 PM
Most of the time mods will work fine on newer 4images version. We are trying keep mods up to date with any changes required for newer 4images version, but as you can see not all of them are updated. At the end it's up to users as yourself to tell us if mod is working or not ;)
Title: Re: [Mod] Notify sender on received eCard
Post by: zakaria666 on July 31, 2010, 10:18:24 PM
hello sir

So does this mean that even though the syntax isnt quite the same as the one in the MOD section can i still tweak it?

thanks