Hi,
This MOD is for notify comment previous user for reply in details. Stats include for admin - see how user clicked in certain time.
1 - Make backup of gallery
2 - Here is MOD - (test in 4images v1.7.4):
// Step 1
In details.php file,
find:
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
add after:
// MOD: Notify comments by email.
if (function_exists('get_comments_notify_by_email')) {
get_comments_notify_by_email($user_info['user_id'], 'check_table');
}
// End of MOD: Notify comments by email.
Find:
unset($comments);
add after:
// MOD: Notify comments by email.
$sql = "SELECT cn.field_id, cn.comment_notify_status
FROM " . COMMENTS_NOTIFY_TABLE . " cn
LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = cn.user_id)
WHERE cn.image_id = " . $image_id . " AND cn.user_id = " . $user_info['user_id'] . " AND " . get_user_table_field("u.", "user_level") . " >= '" . USER . "'";
$result1 = $site_db->query($sql);
while ($notify_row = $site_db->fetch_array($result1)) {
$field_id = $notify_row['field_id'];
$comment_notify_status = $notify_row['comment_notify_status'];
}
Find:
update_comment_count($id, $user_info['user_id']);
add after:
// MOD: Comments notify by email.
if (function_exists('get_comments_notify_by_email')) {
get_comments_notify_by_email($user_info['user_id'], 'notify');
$msg = preg_replace("/" . $site_template->start . "user_name" . $site_template->end . "/siU", format_text(stripslashes($user_info['user_name']), 2), $lang['comments_notify_reply_message_email_sent']);
}
// End of MOD: Comments notify by email.
Find:
unset($row);
unset($spam_row);
}
add after:
// MOD: Comments notify by email.
//-----------------------------------------------------
//--- Update Comments Notify by Email -----------------
//-----------------------------------------------------
if ($action == "update_comment_notify_email") {
$field_id = (isset($HTTP_POST_VARS['field_id'])) ? intval(trim($HTTP_POST_VARS['field_id'])) : 0;
$notify_status = (isset($HTTP_POST_VARS['notify_status'])) ? intval(trim($HTTP_POST_VARS['notify_status'])) : "";
if (!isset($field_id) || (isset($field_id) && empty($field_id))) {
redirect($url);
}
$date = date('Y-m-d');
$time = date('H:i:s');
$microtime = time();
if (isset($notify_status) && $notify_status == 1) {
$sql = "UPDATE " . COMMENTS_NOTIFY_TABLE . " SET comment_notify_status = comment_notify_status - 1, comment_notify_date = '" . $date . "', comment_notify_time = '" . $time . "', comment_notify_microtime = '" . $microtime . "' WHERE field_id = " . $field_id;
} elseif (isset($notify_status) && $notify_status == 0) {
$sql = "UPDATE " . COMMENTS_NOTIFY_TABLE . " SET comment_notify_status = comment_notify_status + 1, comment_notify_date = '" . $date . "', comment_notify_time = '" . $time . "', comment_notify_microtime = '" . $microtime . "' WHERE field_id = " . $field_id;
}
$result = $site_db->query($sql);
if ($notify_status == 0) {
$msg = preg_replace("/" . $site_template->start . "user_name" . $site_template->end . "/siU", format_text(stripslashes($user_info['user_name']), 2), $lang['comments_notify_update_notification_uncheck_message']);
} elseif ($notify_status == 1) {
$msg = preg_replace("/" . $site_template->start . "user_name" . $site_template->end . "/siU", format_text(stripslashes($user_info['user_name']), 2), $lang['comments_notify_update_notification_check_message']);
}
if (preg_match("/comments_notify.php/", $url)) {
redirect("comments_notify.php");
} else {
redirect("details.php?image_id=" . $image_id);
}
}
// End of MOD: Comments notify by email.
Find:
"lang_file_size" => $lang['file_size']
Replace:
// MOD: Notify comments by email.
"lang_file_size" => $lang['file_size'],
"comment_notify_button" => (isset($comment_notify_status) && $comment_notify_status == 1) ? get_gallery_image("notify_check.gif") : get_gallery_image("notify_uncheck.gif"),
"comment_notify_value" => (isset($comment_notify_status) && $comment_notify_status == 1) ? 1 : 0,
"field_id" => (isset($field_id)) ? (int)$field_id : 0,
"url_comment_notify_email" => $site_sess->url(ROOT_PATH . "details.php")
// End of MOD: Notify comments by email.
// Step 2
In includes/constants.php file,
top of ?> - add:
// MOD: Comments notify by email.
// Comments notify by email.
define('COMMENTS_NOTIFY_DEBUG_ID', false); // Set true for debug comments reply to your current User ID.
define('COMMENTS_NOTIFY_OVERWRITE_BUTTON_STATUS', true); // Set true for remove each SQL content status from comments_notify.php file (NO RECOVER !). If set false, user can use button again.
// Comments notify by email - statistics
define('COMMENTS_NOTIFY_STATS_TIME_GLOBAL', true); // Activate = true / De-activate = false.
define('COMMENTS_NOTIFY_STATS_TIME', 7); // Set number of day before send stats email to you.
// End of MOD: Comments notify by email.
// Step 3
In includes/functions.php file,
top of ?> - add:
// MOD: Comments notify by email.
function get_comments_notify_by_email($user_id = -1, $status = "") {
global $site_db, $lang, $msg, $user_info, $config, $site_template, $additional_user_fields, $additional_image_fields;
global $image_id, $id, $table_prefix, $user_table_fields, $script_url;
if (!isset($user_id) || $user_id == -1) {
return;
}
if (!isset($status) || $status == "") {
return;
}
if (isset($user_id) && $user_id > 0) {
$user_id = preg_replace("/[^0-9]+/is", "", $user_id);
if ($user_row = get_user_info($user_id)) {
if ($user_id != $user_row[$user_table_fields['user_id']]) {
return;
}
unset ($user_row);
}
$status = preg_replace("/[^A-Za-z0-9\_]+/is", "", $status);
$date = date('Y-m-d');
$time = date('H:i:s');
$microtime = time();
switch($status) {
case 'check_table' :
if (!defined('COMMENTS_NOTIFY_TABLE')) {
define('COMMENTS_NOTIFY_TABLE', $table_prefix . "comments_notify");
}
$sql = "
CREATE TABLE IF NOT EXISTS " . COMMENTS_NOTIFY_TABLE . " (
field_id INT(11) NOT NULL AUTO_INCREMENT,
user_id VARCHAR(32) NOT NULL DEFAULT '0',
image_id INT(11) NOT NULL DEFAULT '0',
comment_notify_date VARCHAR(48) NOT NULL DEFAULT '0000-00-00',
comment_notify_time VARCHAR(48) NOT NULL DEFAULT '00:00:00',
comment_notify_microtime VARCHAR(255) NOT NULL DEFAULT '0',
comment_notify_status INT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (field_id)
) TYPE=MyISAM;
";
$result = $site_db->query($sql);
$sql = "SELECT user_id, image_id FROM " . COMMENTS_NOTIFY_TABLE . " WHERE user_id = " . $user_id . " AND image_id = " . $image_id;
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (isset($num_rows) && $num_rows <= 0) {
$sql1 = "
INSERT INTO " . COMMENTS_NOTIFY_TABLE . "
(field_id, user_id, image_id, comment_notify_date, comment_notify_time, comment_notify_microtime, comment_notify_status)
VALUES (NULL, '" . $user_id . "', '" . $image_id . "', '" . $date . "', '" . $time . "', '" . $microtime . "', '1')
";
$result = $site_db->query($sql1);
}
return $user_id;
break;
case 'notify' :
$additional_user_sql = "";
$additional_user_sql_array = array();
if (isset($additional_user_fields) && is_array($additional_user_fields) && !empty($additional_user_fields)) {
foreach ($additional_user_fields as $key => $val) {
$additional_user_sql .= ", u." . $key;
$additional_user_sql_array[] = $key;
}
}
$additional_image_sql = "";
$additional_image_sql_array = array();
if (isset($additional_image_fields) && is_array($additional_image_fields) && !empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_image_sql .= ", i." . $key;
$additional_image_sql_array[] = $key;
}
}
$debug_id = (defined('COMMENTS_NOTIFY_DEBUG_ID') && COMMENTS_NOTIFY_DEBUG_ID == true && isset($user_id) && $user_info['user_level'] == ADMIN) ? "AND cn.user_id = " . $user_info['user_id'] : "";
$sql = "
SELECT c.comment_headline" . get_user_table_field(", u.", "user_name") . get_user_table_field(", u.", "user_email") . $additional_user_sql . $additional_image_sql . "
FROM (" . IMAGES_TABLE . " i, " . COMMENTS_TABLE . " c, " . COMMENTS_NOTIFY_TABLE . " cn)
LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = cn.user_id)
WHERE cn.image_id = " . $id . " AND c.user_id = " . $user_id . " AND cn.user_id <> " . $user_id . ((isset($debug_id)) ? trim($debug_id) : "") . " AND " . get_user_table_field("u.", "user_level") . " >= '" . USER . "' AND cn.comment_notify_status = 1
ORDER BY cn.comment_notify_date, cn.comment_notify_time ASC";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);
if (isset($num_rows) && $num_rows > 0) {
$subject_counter = 0;
while ($notify_row = $site_db->fetch_array($result)) {
$subject_counter++;
$user_name = $notify_row[$user_table_fields['user_name']];
$user_email = $notify_row[$user_table_fields['user_email']];
$reply_subject = $notify_row['comment_headline'];
}
if (isset($site_email) && !empty($site_email)) {
unset ($site_email);
}
@include_once(ROOT_PATH . "includes/email.php");
$site_email = new Email();
$site_email->set_to(stripslashes($user_email));
$site_email->set_from(stripslashes($config['site_email']));
$site_email->set_subject(str_replace(array("{site_name}", "{reply_subject}", "{subject_counter}"), array(format_text(stripslashes($config['site_name']), 2), ((isset($reply_subject)) ? stripslashes($reply_subject) : ""), intval(trim($subject_counter))), $lang['comments_notify_new_reply_message_email_subject_title']));
$site_email->register_vars(array(
"user_name" => format_text(stripslashes($user_name), 2),
"comments_notify_url" => format_url($script_url . "/details.php?image_id=" . $id),
"comment_user_name" => format_text(stripslashes($user_info['user_name']), 2),
"site_name" => format_text(stripslashes($config['site_name']), 2),
"site_email" => stripslashes($config['site_email'])
));
if (isset($additional_user_sql_array) && is_array($additional_user_sql_array) && !empty($additional_user_sql_array)) {
foreach ($additional_user_sql_array as $key => $val) {
if ($val == $notify_row[$val]) {
$site_email->register_vars($val, $notify_row[$val]);
}
}
}
if (isset($additional_image_sql_array) && is_array($additional_image_sql_array) && !empty($additional_image_sql_array)) {
foreach ($additional_image_sql_array as $key => $val) {
if ($val == $notify_row[$val]) {
$site_email->register_vars($val, $notify_row[$val]);
}
}
}
$site_email->set_body("comments_notify_new_reply_message", $config['language_dir_default']);
$site_email->send_email();
unset ($additional_user_sql);
unset ($additional_user_sql_array);
unset ($additional_image_sql);
unset ($additional_image_sql_array);
unset ($subject_counter);
return $user_id;
}
break;
case 'comments_notify_statistics' :
if (defined('COMMENTS_NOTIFY_STATS_TIME_GLOBAL') && COMMENTS_NOTIFY_STATS_TIME_GLOBAL == true) {
$stats_time = time() - 60 * 60 * 24 * (defined('COMMENTS_NOTIFY_STATS_TIME_GLOBAL') && COMMENTS_NOTIFY_STATS_TIME_GLOBAL == true && defined('COMMENTS_NOTIFY_STATS_TIME') && (int)COMMENTS_NOTIFY_STATS_TIME > 0) ? " AND comment_notify_microtime < " . COMMENTS_NOTIFY_STATS_TIME : "";
$sql = "SELECT COUNT(comment_notify_status) AS total_notify
FROM " . COMMENT_NOTIFY_TABLE . "
WHERE comment_notify_status = 1" . $stats_time;
$row = $site_db->query_firstrow($sql);
$check_notify = (isset($row['total_notify'])) ? $row['total_notify'] : 0;
$sql = "
SELECT " . get_user_table_field("", "user_name") . get_user_table_field(", ", "user_email") . "
FROM " . USERS_TABLE . "
WHERE " . get_user_table_field("", "user_id") . " = '1'";
$get_webmaster_info = $site_db->query_firstrow($sql);
if (isset($site_email) && !empty($site_email)) {
unset ($site_email);
}
@include_once(ROOT_PATH . "includes/email.php");
$site_email = new Email();
$site_email->set_to(stripslashes($get_webmaster_info[$user_table_fields['user_email']]));
$site_email->set_from(stripslashes($config['site_email']));
$site_email->set_subject(preg_replace("/" . $site_template->start . "site_name" . $site_template->end . "/siU", format_text(stripslashes($config['site_name']), 2), $lang['comments_notify_statistic_report_email_subject']));
$site_email->register_vars(array(
"admin_name" => format_text(trim($get_webmaster_info[$user_table_fields['user_name']]), 2),
"stats_value" => (isset($check_notify) && $check_notify > 0) ? (int)$check_notify : 0,
"site_name" => format_text(trim($config['site_name']), 2)
));
$site_email->set_body("comments_notify_statistic_message", $config['language_dir_default']);
$site_email->send_email();
return $user_id;
}
} // End switch.
}
}
// End of MOD: Comments notify by email.
// Step 4
In includes/page_header.php file,
find:
//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image", $random_image);
unset($random_image);
add after:
// MOD: Comments notify by email.
//-----------------------------------------------------
//--- Comments notify by email - statistic ------------
//-----------------------------------------------------
if ($user_info['user_id'] == 1 && defined('COMMENTS_NOTIFY_STATS_TIME_GLOBAL') && COMMENTS_NOTIFY_STATS_TIME_GLOBAL == true && defined('COMMENTS_NOTIFY_STATS_TIME') && (int)COMMENTS_NOTIFY_STATS_TIME > 0 && function_exists('get_comment_notify_by_email')) {
get_comment_notify_by_email($user_info['user_id'], 'comments_notify_statistics');
}
// End of MOD: Comments notify by email.
// Step 5
In lang/english/main.php file,
add top of ?>:
// MOD: Comments notify by email.
//-----------------------------------------------------
//--- Comments notify by email ------------------------
//-----------------------------------------------------
$lang['comments_notify_undefined_table'] = "{table_name} table is NOT defined in includes/constants.php file.";
$lang['comments_notify_email_subject_welcome_message'] = "{site_name} - New feature: Comments notify by email.";
$lang['comments_notify_new_reply_message_email_subject_title'] = "{site_name} - Reply notification: {reply_subject} on post: {subject_counter}.";
$lang['comments_notify_reply_message_email_sent'] = "Thanks {user_name}. Notification reply by email has just been sent to users who wishes to be notified.";
$lang['comments_notify_update_notification_uncheck_message'] = "Thanks {user_name}. Notification has been unchecked for these comments.";
$lang['comments_notify_update_notification_check_message'] = "Thanks {user_name}. Notification has just been checked for these comments.";
$lang['comments_notify_statistic_report_email_subject'] = "{site_name} - Latest statistics.";
// End of MOD: Comments notify by email.
// Step 6
In lang/english/email,
create 3 files:
comments_notify_new_reply_message.html,
comments_notify_statistic_message.html .
Content per order:
Dear {user_name},
{comment_user_name} has just replied to your message.
Comment URL: {comments_notify_url}
Note:
This is an automated message reply system. If you see this message,
it's because you chosed the 'Notify by Email' button option from one
(or many) images you visited in our gallery.
{site_name} does NOT send out email messages on purpose. Emails are
being sent as per users preferences.
Best wishes.
{site_name}
2nd:
Dear {admin_name},
You are receiving this email message since you activated
the statistics for the comments notify by email.
Here are the latest stats of all users that checked
the 'Notify by email' button: {stats_value}
Best wishes.
{site_name} .
// Step 7
In templates/your_template/details.html file,
find:
<td valign="top" class="head1">{lang_comment}</td>
add after:
{if is_admin}<! -- Comment notify by email foreach user -- >{endif is_admin}
{if user_loggedin}{if comment_num_rows}{if comment_notify_button}<td valign="top" class="head1">
<form method="post" action="{url_comment_notify_email}">
<input type="hidden" name="action" value="update_comment_notify_email">
<input type="hidden" name="field_id" value="{field_id}">
<input type="hidden" name="notify_status" value="{comment_notify_value}">
<input type="hidden" name="image_id" value="{image_id}">
<input type="image" src="{comment_notify_button}">
</form>
</td>{endif comment_notify_button}{endif comment_num_rows}{endif user_loggedin}
{if is_admin}<! -- End comment notify by email foreach user -- >{endif is_admin}
// Step 8
In includes/constants.php file,
find:
define('COMMENTS_TABLE, $table_prefix.'comments');
add after:
define('COMMENTS_NOTIFY_TABLE', $table_prefix.'comments_notify');
Must keep
comments_notify at end.
Is all. Thank to Mawenzi for button:
http://www.4homepages.de/forum/index.php?topic=18491.msg99168#msg99168Upload in templates/your_template/images_english folder. Should all work.
And thank to
Mr_Lovalove for test on server.
================================================================
==== New Version == 08-29-2007 ========================================
===============================================================
Upgrade from before (must use 1st version for 2nd).// Step 1
In details.php file,
// MOD: Notify comments by email.
"comment_notify_button" => (isset($comment_notify_status) && $comment_notify_status == 1) ? get_gallery_image("notify_check.gif") : get_gallery_image("notify_uncheck.gif"),
"comment_notify_value" => (isset($comment_notify_status) && $comment_notify_status == 1) ? 1 : 0,
"url_comment_notify_email" => $site_sess->url(ROOT_PATH . "details.php")
// End of MOD: Notify comments by email.
add before:
"comments_notify_go_back" => (preg_match("/comments_notify.php/", $url)) ? preg_replace("/" . $site_template->start. "go_back" . $site_template->end . "/siU", $site_sess->url(ROOT_PATH . "comments_notify.php"), $lang['comments_notify_go_back']) : "",
Find:
redirect("details.php?image_id=" . $image_id);
replace:
if (preg_match("/comments_notify.php/", $url)) {
redirect("comments_notify.php");
} else {
redirect("details.php?image_id=" . $image_id);
}
// Step 2 [
09/14/2007]
In member.php file,
find:
"lang_edit_profile_msg" => $edit_profile_msg,
add after:
"lang_comments_notify_ask_question" => $lang['comments_notify_ask_question'],
"lang_comments_notify_ask_question_url_name" => preg_replace("/" . $site_template->start . "click_here" . $site_template->end . "/siU", $site_sess->url(ROOT_PATH . "comments_notify.php"), $lang['comments_notify_ask_question_url_name']),
// Step 3
In lang/english/main.php file,
find:
$lang['comments_notify_statistic_report_email_subject'] = "{site_name} - Latest statistics.";
add after:
$lang['comments_notify_clickstream_title'] = "Comments notify";
$lang['comments_notify_no_content'] = "No comments notify.";
$lang['comments_notify_title'] = "Comments notify";
$lang['comments_notify_go_back'] = "<a href=\"{go_back}\"><span class=\"smalltext\">[ Go back ]</span></a>";
$lang['comments_notify_image_uploader'] = "Image uploader";
$lang['comments_notify_image_name'] = "Image name";
$lang['comments_notify_comment_status'] = "Notify status";
$lang['comments_notify_date_n_time'] = "Date & time";
$lang['comments_notify_ask_question'] = "Configure my comment notify list:";
$lang['comments_notify_ask_question_url_name'] = "<a href=\"{click_here}\">[ Click here ]</a>";
// Step 4
In templates/your_template/details.html file,
find:
<b class="title"><br />{image_name}</b>{if image_is_new} <sup class="new">{lang_new}</sup>{endif
replace:
<b class="title">{if comments_notify_go_back}{comments_notify_go_back}{endif comments_notify_go_back}<br /><br />{image_name}</b>{if image_is_new} <sup class="new">{lang_new}</sup>{endif
// Step 5
In ROOT_PATH, create new file:
comments_notify.php .
Add:
<?php
$main_template = "comment_notify";
define('ROOT_PATH', './');
include(ROOT_PATH . 'global.php');
require(ROOT_PATH . 'includes/sessions.php');
include(ROOT_PATH . 'includes/page_header.php');
if ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) {
redirect($url);
}
if ($action == "") {
$action = "show_comments_notify";
}
if ($action == "show_comments_notify") {
$comments_notify_overwrite_button_status = (defined('COMMENTS_NOTIFY_OVERWRITE_BUTTON_STATUS') && COMMENTS_NOTIFY_OVERWRITE_BUTTON_STATUS == true) ? "cn.comment_notify_status = 1 AND " : "";
$additional_user_sql = "";
$additional_user_sql_array = array();
if (isset($additional_user_fields) && is_array($additional_user_fields) && !empty($additional_user_fields)) {
foreach ($additional_user_fields as $key => $val) {
$additional_user_sql .= ", u." . $key;
$additional_user_sql_array[] = $key;
}
}
$additional_image_sql = "";
$additional_image_sql_array = array();
if (isset($additional_image_fields) && is_array($additional_image_fields) && !empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_image_sql .= ", i." . $key;
$additional_image_sql_array[] = $key;
}
}
$sql = "
SELECT i.user_id, i.cat_id, i.image_id, i.image_name, i.image_active, i.image_allow_comments, cn.field_id, cn.comment_notify_status, cn.comment_notify_date, cn.comment_notify_time" . get_user_table_field(", u.", "user_name") . $additional_user_sql . $additional_image_sql . "
FROM (" . IMAGES_TABLE . " i, " . COMMENTS_NOTIFY_TABLE . " cn)
LEFT JOIN " . USERS_TABLE . " u ON (" . get_user_table_field("u.", "user_id") . " = i.user_id)
WHERE " . ((isset($comments_notify_overwrite_button_status)) ? trim($comments_notify_overwrite_button_status) : "") . " i.image_id = cn.image_id AND cn.user_id = " . $user_info['user_id'];
$result = $site_db->query($sql);
$notify_num_rows = $site_db->get_numrows($result);
if (isset($notify_num_rows) && $notify_num_rows <= 0) {
$msg = $lang['comments_notify_no_content'];
} elseif (isset($notify_num_rows) && $notify_num_rows > 0) {
$comments_notify_template = "";
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)) {
$row_count = ($bgcounter++ % 2 == 0) ? 1 : 2;
$user_id = $image_row['user_id'];
$image_id = $image_row['image_id'];
$field_id = $image_row['field_id'];
$image_name = $image_row['image_name'];
$image_active = $image_row['image_active'];
$image_allow_comments = $image_row['image_allow_comments'];
$user_name = $image_row[$user_table_fields['user_name']];
$cat_id = $image_row['cat_id'];
$comment_notify_status = $image_row['comment_notify_status'];
$comment_notify_date = $image_row['comment_notify_date'];
$comment_notify_time = $image_row['comment_notify_time'];
$site_template->register_vars(array(
"user_id" => (isset($user_id)) ? (int)$user_id : 0,
"image_id" => (isset($image_id)) ? (int)$image_id : 0,
"field_id" => (isset($field_id)) ? (int)$field_id : 0,
"uploader_user_url" => (isset($user_id) && isset($user_name)) ? $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . $user_id) : "",
"url_comment_notify_email" => $site_sess->url(ROOT_PATH . "details.php"),
"uploader_user_name" => (isset($user_name)) ? format_text(stripslashes($user_name), 2) : "",
"image_active" => (isset($image_active) && $image_active == 1) ? true : false,
"allow_comments" => (isset($image_allow_comments) && $image_allow_comments == 1) ? true : false,
"image_name" => format_text(stripslashes($image_name), 2),
"comment_notify_button" => (isset($comment_notify_status) && $comment_notify_status == 1) ? get_gallery_image("notify_check.gif") : get_gallery_image("notify_uncheck.gif"),
"comment_notify_value" => (isset($comment_notify_status) && $comment_notify_status == 1) ? 1 : 0,
"comment_notify_date" => (isset($comment_notify_date)) ? trim($comment_notify_date) : "",
"comment_notify_time" => (isset($comment_notify_time)) ? trim($comment_notify_time) : "",
"row_count" => (isset($row_count) && $row_count > 0) ? true : false,
"image_url" => (isset($image_id)) ? $site_sess->url(ROOT_PATH . "details.php?" . URL_IMAGE_ID . "=" . $image_id) : format_text(stripslashes($image_name), 2)
));
if (isset($additional_user_sql_array) && is_array($additional_user_sql_array) && !empty($additional_user_sql_array)) {
foreach ($additional_user_sql_array as $key => $val) {
if ($val == $image_row[$val]) {
$site_template->register_vars($val, $image_row[$val]);
}
}
}
if (isset($additional_image_sql_array) && is_array($additional_image_sql_array) && !empty($additional_image_sql_array)) {
foreach ($additional_image_sql_array as $key => $val) {
if ($val == $image_row[$val]) {
$site_template->register_vars($val, $image_row[$val]);
}
}
}
$comments_notify_template .= $site_template->parse_template("comment_notify_content");
}
}
}
$clickstream = "<a href=\"" . $site_sess->url(ROOT_PATH . "index.php") . "\">" . $lang['home'] . "</a>" . $config['category_separator'] . $lang['comments_notify_clickstream_title'];
$site_template->register_vars(array(
"clickstream" => trim($clickstream),
"msg" => trim($msg),
"comments_notify_template" => trim($comments_notify_template),
"num_rows" => (isset($notify_num_rows) && $notify_num_rows > 0) ? true : false,
"lang_comments_notify_title" => $lang['comments_notify_title'],
"lang_comments_notify_image_uploader" => $lang['comments_notify_image_uploader'],
"lang_comments_notify_image_name" => $lang['comments_notify_image_name'],
"lang_comments_notify_comment_status" => $lang['comments_notify_comment_status'],
"lang_comments_notify_date_n_time" => $lang['comments_notify_date_n_time']
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH . 'includes/page_footer.php');
?>
// Step 6
No place post here so attach file and upload in templates/your_template folder.
- User can selek / no selek notify button and see headline from. No more run for notify button foreach detail page.
- Image active and allow comment - auto-detek. Image active off:
2 link off. Allow comment (with image active on) - 1 link off.
Thank to
Mr_Lovalove for test on server.
Screenshot - see attach.