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.phpFind:
$recipient_email = un_htmlspecialchars(trim($HTTP_POST_VARS['recipient_email']));
Add after:
$confirm = $HTTP_POST_VARS['confirm'];
1.2Find:
$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:
$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:
$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:
$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 if (!$image_row) {
$msg = $lang['invalid_postcard_id'];
}
else {
4images v1.7.7 or newer if (!$image_row) {
show_error_page($lang['invalid_postcard_id']);
}
else {
Add after:
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:
$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:
"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:
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:
"lang_postcard_confirm" => $lang['postcard_confirm']."?",
Step 2.Open
/lang/<yourlanguage>/main.phpAdd at the end of the file, just before
?> :
$lang['postcard_confirm'] = "Receive confirmation when postcard viewed";
$lang['postcard_confirm_subj'] = "eCard confirmation";
Step 3.Open
/templates/<yourtemplate>/postcard_create.htmlAdd this:
<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.htmlAdd this:
<B>{lang_postcard_confirm}:</B> {postcard_confirm}
and this:
<INPUT type="hidden" name="confirm" value="{confirm}" />
Step 5.Create new template
/lang/<yourlanguage>/email/postcard_confirm.htmlInsert this:
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/postcard7570P.S. sorry for my bad english, if u think of better text for this mod, let me know.