4images Modifications / Modifikationen > Mods & Plugins (Releases & Support)

[MOD] - Report a picture (configurable from ACP + over HTML template files)

(1/25) > >>

TheOracle:
// Report a picture - v1.0 (Final release & patched version)
// Introduction

Responding for this topic: http://www.4homepages.de/forum/index.php?topic=9389.0

This MOD has been expected for quite some time now. However, as promised - fortunitely, I have successfully coded & completed this feature over a testing e-mail server and reported total success.

Update: Please take note that (as part of 4images's core), it is hardly you can use this MOD if you intend to send / receive reports by using Hotmail, Yahoo, Gmail ect . . .

// Change log

[Fix-Update] - 02-15-2006

- There was some unusual errors with the header command. It has now been modified to read as Meta Redirection instead.
- Some actions were conditionned with header redirection over the same file (which was totally unnecesarry after all). The actions are now being forwarded without the need to redirect from now on.

For users who already installed this MOD, you will need to redo step 11 only.

// Beta tester - Thanks note

My thanks goes to trez for accepting my evaluations as his patience was (and still is) a huge appreciation for the task and the time it required in order to achieve this goalm.

// Features

As you may already know, this MOD lets your users / admins to send a report, from the details page, to the webmaster / owner of the gallery for 'x' reasons towards a specific image.

// Restrictions

For security saighs, this page is / will & shall be loaded only from the details page and nowhere else (and I made sure of that). In the mean time, only registered users may see this page.

// Restrictions - Why such implementations ?

The reason why these security inputs has been added into the report image's core file is to avoid spamming from GUESTs users and bots.

Secondly, in order to avoid flooded e-mails from your mailbox (and also to avoid your e-mail to be added into your web hosting service's SPAM filter), all link infos must be tracked before entering the report page "as well" as the comment box must be filled.

That said, since om5acw posted a MOD about avoiding SPAMs within 4images lately, my personal thanks on this one as you can see his publishing from here :

http://www.4homepages.de/forum/index.php?action=profile;u=11153

Meaning, I strongly recommend you install this MOD within your 4images copy after installing mine.

// Secure code - compatible with other MODs ?

Absolutely. As we can see here :

http://www.4homepages.de/forum/index.php?topic=8987.msg59688#msg59688

it has been done within the contact form MOD (which apparently was a complete success as well).

// Affected files


- admin/settings.php
- includes/functions.php
- includes/page_header.php (02-16-2006)
- lang/english/admin.php
- lang/english/main.php
- templates/<your_template>/details.html
- SETTINGS_TABLE


// New files


- report_pic.php
- lang/english/email/image_report_message.html
- templates/<your_template>/report_pic_form.html
- templates/<your_template>/report_pic_failed.html
- templates/<your_template>/report_pic_success.html


// Step 1

In your admin/settings.php file,

find :


--- Code: ---function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0) {
  global $config, $setting;
  $config_value = ($htmlspecialchars) ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];
  $setting[$setting_name] = replace_url($setting[$setting_name]);
  if ($value_option == "") {
    show_input_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  elseif ($value_option == "textarea") {
    show_textarea_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value, "", 6);
  }
  elseif ($value_option == "radio") {
    show_radio_row($setting[$setting_name], "setting_item[".$setting_name."]", $config_value);
  }
  else {
    echo "<tr class=\"".get_row_bg()."\">\n<td valign=\"top\"><p class=\"rowtitle\">".$setting[$setting_name]."</p></td>\n";
    echo "<td><p>";
    $value_option($setting_name, $config_value);
    echo "</p></td>\n</tr>\n";
  }
}

--- End code ---

add below :


--- Code: ---
function show_report_image_select($setting_name, $setting_value) {
  global $report_image_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($report_image_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}


--- End code ---

Then, find :


--- Quote ---
show_table_separator($setting_group[7], 2, "#setting_group_7");
show_setting_row("user_edit_image", "radio");
show_setting_row("user_delete_image", "radio");
show_setting_row("user_edit_comments", "radio");
show_setting_row("user_delete_comments", "radio");
show_setting_row("account_activation", "show_account_activation_options");
show_setting_row("activation_time");
show_setting_row("session_timeout");
show_setting_row("display_whosonline", "radio");
show_setting_row("highlight_admin", "radio");


--- End quote ---

add below :


--- Code: ---
show_table_separator($setting_group[X], 2, "#setting_group_X");
show_setting_row("report_image_status", "show_report_image_select");


--- End code ---

Note: Replace the 'Xs' with your latest value number on the list.

// Step 2 (Updated: 02-07-2006)

In your includes/functions.php file,

find :


--- Quote ---
$lightbox_url = $self_url;
$lightbox_url .= (!empty($mode)) ? ((strpos($lightbox_url, '?') !== false) ? "&amp;" : "?")."mode=".$mode : "";
$lightbox_url .= strpos($lightbox_url, '?') !== false ? "&amp;" : "?";


--- End quote ---

add above :


--- Code: ---
$report_url = ($config['report_image_status'] == 0 && $user_info['user_level'] >= USER) ? $site_sess->url(ROOT_PATH."report_pic.php?".URL_CAT_ID."=".$image_row['cat_id']."&cat_name=".$image_row['cat_name']."&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&image_name=".$image_row['image_name']) : "";


--- End code ---

Then, find (updated - thanks to Mawenzi):


--- Quote ---
"image_file_name" => $image_row['image_media_file'],


--- End quote ---

add below :


--- Code: ---
"report_image_url" => $report_url,
"lang_report_pic" => $lang['report_pic_title'],


--- End code ---

// Step 3

In your lang/english/admin.php file,

add above the '?>' tag (Updated - Thanks to Mawenzi):


--- Code: ---
/*-- Setting-Group X --*/
$setting_group[X] = "Report Image";
$setting['report_image_status'] = "Would you like to activate the report image feature within your details page ?";
$report_image_optionlist = array(
  "0" => "Yes",
  "1" => "No"
);


--- End code ---

Note: Remember the 'Xs' rule. ;)

// Step 4

In your lang/english/main.php file,

add above the '?>' tag :


--- Code: ---
//-----------------------------------------
// Report a picture -----------------------
//-----------------------------------------
$lang['report_image_name'] = "Image name:";
$lang['report_user_name'] = "User name:";
$lang['report_success'] = "<span class=\"smalltext\">Email sent successfully. Please wait, redirecting to the categories page . . .</span>";
$lang['report_failed_comments'] = "<span class=\"smalltext\">Either you did not filled up the comments table 'or' you're trying to access this page without viewing the details page. On either case, please login and click on the ' Report a picture ' link from the details page.<br /><br />&nbsp;&nbsp;Please wait, redirecting . . .</span>";
$lang['report_pic_title'] = "<span class=\"smalltext\">Report a Picture</span>";
$lang['image_url'] = "Image URL:";
$lang['reporting_comments'] = "<span class=\"smalltext\">Please state the reason for reporting this image:</span>";
$lang['report_email_subject'] = "Report a picture";
$lang['send_report_image'] = "Send my report";


--- End code ---

// Step 5

In your templates/<your_template>/details.html file,

add the following link where you wish to see it appear from your details page :


--- Code: ---
{if report_image_url}<a href="{report_image_url}" class="smalltext">{lang_report_pic}</a><br /><br />{endif report_image_url}


--- End code ---

// Step 6

Update : [ 02-04-2006 - Login as ADMIN before executing the file ].

Create a new file called : install_report_image.php. This will add a new field within your SETTINGS_TABLE.


--- Code: ---
<?php

define ('ROOT_PATH', './');
include (ROOT_PATH."global.php");
require (ROOT_PATH."includes/sessions.php");
$user_access = get_permission();

if ($user_info['user_level'] == ADMIN) {

$sql = "INSERT INTO ".SETTINGS_TABLE."
      (setting_name, setting_value)
      VALUES ('report_image_status', '0')

";

$result = $site_db->query($sql);

if ($result) {

echo "Installation successful.";

} else {

echo "Installation failed.";

} ####### End of if statement.

} else {

show_error_page($lang['no_permission']);

} ####### End of if statement.
?>


--- End code ---

Once created, and saved, upload it to your root path of the gallery and execute it. Once executed, and successfully added into your SETTINGS_TABLE, you may delete this file.

// Step 7

In your lang/english/email folder, create a new file called : image_report_message.html.


--- Code: ---
Greetings webmaster,

User profile: {user_name_link}

Image URL: {destination_url}

The user name: "{user_name}" has just reported a comment over one of your images named: "{image_name}"

for the following reason below:

=============================================

{report_comments}

=============================================

If you wish to reply to this user, here's his e-mail address: {user_email}

(Note: The specified e-mail address above may not / may no longer be a true e-mail. You have been warned !)

Regards.

{site_name}.


--- End code ---

Note: If you don't like the way it's been coded from this template, you may personalize it the way you feel is right. ;)

// Step 8

In your templates/<your_template> folder, create a new file called : report_pic_form.html.

Now, the following codings may, of course, be customized but - for now - I have decided to design it on my own and show the  results to you. Again, if you don't like the way the form is currently presented below, you may personalize it the way you feel is right for your gallery.


--- Code: ---
{header}
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1">

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{lang_report_pic}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="navbar"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1">&nbsp;</td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right">{lang_report_user_name}</td>
<td class="row1" width="50%" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{user_name}</td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /></td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right">{lang_report_image_name}</td>
<td class="row1" width="50%" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{image_name}</td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /></td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right">{lang_image_url}</td>
<td class="row1" width="50%" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" /><a href="{image_url}" target="_blank">{image_name}</a></td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1">&nbsp;</td>
</tr>
</table>

<center><table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="row1" width="50%" align="right" valign="top">{lang_reporting_comments}</td>
<td class="row1" width="50%" align="left">
<form method="post" action="{url_report_image}"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />
<input type="hidden" name="image_id" value="{image_id}">
<input type="hidden" name="image_name" value="{image_name}">
<input type="hidden" name="user_name" value="{user_name}">
<textarea name="report_comments" cols="40" rows="12" wrap="VIRTUAL" class="textarea"></textarea>
<br /><br />
<img src="{template_url}/images/spacer.gif" width="8" height="4" alt="" />
<input type="submit" name="send_image_report" value="{lang_send_report_image}">
<img src="{template_url}/images/spacer.gif" width="8" height="4" alt="" />
<input type="reset" value="{lang_reset}">
</form></td>
</tr>
</table></center>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />&nbsp;</td>
</tr>
</table>

</td>
</tr>
</table>
{footer}


--- End code ---

2nd note: This is the place where the Secure Code MOD should be considered. ;)

// Step 9 (Updated: 02-07-2006)

In your templates/<your_template> folder, create a new file called : report_pic_failed.html (please read the condition from the template file above - it also applys through here).


--- Code: ---
{header}
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left">&nbsp;&nbsp;{lang_report_title}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;&nbsp;{msg}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />&nbsp;</td>
</tr>
</table>

</td>
</tr>
</table>
{footer}


--- End code ---

// Step 10 (Updated: 02-07-2006)

In your templates/<your_template> folder, create a new file called : report_pic_success.html (please read the condition from the two template above as it also applys through this one).


--- Code: ---
{header}
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%">

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left">&nbsp;&nbsp;{lang_report_title}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;&nbsp;{msg}</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="row1" align="left">&nbsp;</td>
</tr>
</table>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="head1" align="left"><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />&nbsp;</td>
</tr>
</table>

</td>
</tr>
</table>
{footer}


--- End code ---

// Step 11 (Updated: 02-15-2006)

And, finally, the routines that has been mostly expected for this MOD, create a new file called : report_pic.php on your root path.


--- Code: ---
<?php

$main_template = "report_pic_form";

define ('GET_CACHES', 1);
define ('ROOT_PATH', './');
include (ROOT_PATH.'global.php');
require (ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include (ROOT_PATH.'includes/page_header.php');

if ($config['report_image_status'] == 1) {
$redirect = "<meta http-equiv=\"refresh\" content=\"0; url=".$site_sess->url(ROOT_PATH."index.php", "&")."\">";
echo $redirect;
unset ($redirect);
} ###### End of if statement.

if ($user_info['user_level'] == GUEST && !ereg("details.php", $url)) {
$msg = ($lang['report_failed_comments']) ? $lang['report_failed_comments'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."index.php", "&")."\">";
echo $redirect;
unset ($redirect);
exit;
} ###### End of if statement.

if ($action == "") {
$action = "view_report";
} ###### End of if statement.

if ($action == "view_report") {

$cat_id = (isset($HTTP_GET_VARS['cat_id']) && $HTTP_GET_VARS['cat_id'] != 0) ? intval($HTTP_GET_VARS['cat_id']) : 0;
$cat_name = (isset($HTTP_GET_VARS['cat_name']) && $HTTP_GET_VARS['cat_name'] != "") ? (stripslashes(trim($HTTP_GET_VARS['cat_name']))) : $lang['no_categories'];
$image_id = (isset($HTTP_GET_VARS['image_id']) && $HTTP_GET_VARS['image_id'] != 0) ? intval($HTTP_GET_VARS['image_id']) : 0;
$image_name = (isset($HTTP_GET_VARS['image_name']) && $HTTP_GET_VARS['image_name'] != "") ? (stripslashes(trim($HTTP_GET_VARS['image_name']))) : $lang['no_images'];
$image_url = $site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id);

if (!$cat_id || !$cat_name || !$image_id || !$image_name || !$image_url) {
$msg = ($lang['report_failed_comments']) ? $lang['report_failed_comments'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."index.php", "&")."\">";
echo $redirect;
unset ($redirect);
exit;
} ###### End of if statement.

$sql = "

SELECT ".get_user_table_field("", "user_id"). get_user_table_field(",", "user_name"). get_user_table_field(",", "user_level")."
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id']." AND ".get_user_table_field("", "user_level")." >= '".USER."'

";

$result = $site_db->query($sql);

while ($user_row = $site_db->fetch_array($result)) {
$user_name = $user_row['user_name'];
} ###### End of while statement.

$site_template->register_vars(array(
"image_id" => intval($image_id),
"lang_report_image_name" => $lang['report_image_name'],
"image_name" => stripslashes($image_name),
"lang_image_url" => $lang['image_url'],
"image_url" => stripslashes($image_url),
"lang_report_pic" => $lang['report_pic_title'],
"lang_reporting_comments" => $lang['reporting_comments'],
"lang_report_user_name" => $lang['report_user_name'],
"user_name" => stripslashes($user_name),
"lang_submit" => $lang['submit'],
"lang_reset" => $lang['reset'],
"lang_send_report_image" => $lang['send_report_image']
));

$clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".($cat_id))."\">".($cat_name)."</a>".$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\">".$image_name."</a>".$config['category_separator']. str_replace("_", " ", ucfirst($main_template));
$site_template->register_vars("clickstream", $clickstream);
$site_template->print_template($site_template->parse_template($main_template));
} ###### End of if statement.

if ($action == "send_image_report") {

$image_id = (isset($HTTP_POST_VARS['image_id']) && $HTTP_POST_VARS['image_id'] != 0) ? intval($HTTP_POST_VARS['image_id']) : 0;
$image_name = (isset($HTTP_POST_VARS['image_name']) && $HTTP_POST_VARS['image_name'] != "") ? (stripslashes(trim($HTTP_POST_VARS['image_name']))) : $lang['no_images'];
$report_comments = (isset($HTTP_POST_VARS['report_comments'])) ? (un_htmlspecialchars(trim($HTTP_POST_VARS['report_comments']))) : "";
$user_name = $user_info['user_name'];
$user_name_link = $script_url."/member.php?action=showprofile&".URL_USER_ID."=".$user_info['user_id'];
$user_email = $user_info['user_email'];
$destination_url = $script_url."/details.php?".URL_IMAGE_ID."=".$image_id;

if (!isset($HTTP_POST_VARS['image_id']) || $image_id == "") {
$msg = ($lang['report_failed_image_id']) ? $lang['report_failed_image_id'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".(isset($image_id)), "&")."\">";
echo $redirect;
unset ($redirect);
exit;

} elseif (!isset($HTTP_POST_VARS['image_name']) || $image_name == "") {
$msg = ($lang['report_failed_image_name']) ? $lang['report_failed_image_name'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".(isset($image_id)), "&")."\">";
echo $redirect;
unset ($redirect);
exit;

} elseif (!isset($HTTP_POST_VARS['report_comments']) || $report_comments == "") {
$msg = ($lang['report_failed_comments']) ? $lang['report_failed_comments'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_failed"));

$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".(isset($image_id)), "&")."\">";
echo $redirect;
unset ($redirect);
exit;
} ###### End of if statement.

if (!empty($site_email) || $site_email != "") {
unset ($site_email);
} ###### End of if statement.

@include_once(ROOT_PATH.'includes/email.php');

$site_email = new Email();

if (!$site_email->reset()) {
$site_email->reset();
} ###### End of if statement.

$site_email->set_to(stripslashes($config['site_email']));
$site_email->set_from(stripslashes($config['site_email']), stripslashes($user_name));
$site_email->set_subject($lang['report_email_subject']);

$site_email->register_vars(array(
"image_id" => intval($image_id),
"image_name" => stripslashes($image_name),
"report_comments" => stripslashes($report_comments),
"destination_url" => stripslashes($destination_url),
"user_name" => stripslashes($user_name),
"user_email" => stripslashes($user_email),
"user_name_link" => stripslashes($user_name_link),
"site_name" => trim($config['site_name'])
));

$site_email->set_body("image_report_message", $config['language_dir']);
$site_email->send_email();

$action = "report_success";
} ###### End of if statement.

if ($action == "report_success") {

$msg = ($lang['report_success']) ? $lang['report_success'] : "";

$site_template->register_vars(array(
"lang_report_title" => ($lang['report_pic_title']) ? $lang['report_pic_title'] : "",
"msg" => $msg
));
$site_template->print_template($site_template->parse_template("report_pic_success"));

$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".(isset($cat_id)), "&")."\">";
echo $redirect;
unset ($redirect);
} ###### End of if statement.

unset ($cat_id);
unset ($cat_name);
unset ($image_id);
unset ($image_name);
unset ($image_url);
unset ($report_comments);
unset ($user_name);
unset ($user_email);
unset ($user_name_link);
unset ($destination_url);
unset ($msg);

include (ROOT_PATH.'includes/page_footer.php');
?>


--- End code ---

// Step 11.1 (Created: 02-07-2006)

In your lang/english/main.php file,

add the following statement in the same paragraph as your previous pasting of the report image :


--- Code: ---
$lang['report_failed_image_id'] = "<span class=\"smalltext\">Your image ID could not be sent to the webmaster (probably due to email restriction levels from the site's web hosting service). Please wait. Redirecting . . .</span>";
$lang['report_failed_image_name'] = "<span class=\"smalltext\">Your image name could not be sent to the webmaster (probably due to email restriction levels from the site's web hosting service). Please wait. Redirecting . . .</span>";


--- End code ---

// Step 11.2 (Created on: 02-16-2006)

In your includes/page_header.php file,

find :


--- Quote ---
"url_categories" => $site_sess->url(ROOT_PATH."categories.php"),


--- End quote ---

add below (this is it):


--- Code: ---
"url_report_image" => $site_sess->url(ROOT_PATH."report_pic.php?action=send_image_report"),


--- End code ---

// Installation completed

This completes the installation of this MOD. From now on, you should be able to configure from your ACP's configuration page (down below). You can, either, select ' yes ' or ' no ' to activate / deactivate this feature from your details page - as simple as that. ;)

// Questions & support

If you have any questions or request additional support for this MOD, please state them here. Do NOT start a new topic.

// Screenshots

I almost forgot, here's a screenshot for this amazing MOD :



;)

Update: [ 02-05-2006 ] - Successful screenshot page from report a picture (e-mail does send from my end + received) :



And this is the part when the e-mail has been received :


--- Quote ---
Greetings webmaster,

User profile:
http://www.mysite.com/mygallery/member.php?action=showprofile&user_id=myuserid

http://www.mysite.com/mygallery/details.php?image_id=myimageid

The user name: "oracle" has just reported a comment over one of your images
named: "Test picture"

for the following reason below:

=============================================

This is a test for the forum to see if it works.

TheOracle.

=============================================

If you wish to reply to this user, here's his e-mail address:
myemail@myserver.com

(Note: The specified e-mail address above may not / may no longer be a true
e-mail. You have been warned !)

Regards.

oracles test gallery.


--- End quote ---

;)

Note: URLs and e-mail address has, of course, been modified for users privacy. ;)

// Personal inputs

Finally, I can code up with the $site_email class name !!! ;)

Good luck and PLEASE GIVE ME YOUR INPUTS !!! 8)

TheOracle:
Update: A slight mistake was corrected above from step 11. Please re-implement it. ;)

JensF:
Yeah, Great. I will test it in 2 hours :)

Now i will look a DVD ;)

mawenzi:
... I miss something ...  :?
... after Step 2 in functions.php ...

--- Code: ---$site_template->register_vars(array(
...
"report_image_url" => $report_url,
...

--- End code ---

... and I cant found in funcitions.php or details.php ... for details.html ...

--- Code: ---$site_template->register_vars(array(
...
"lang_report_pic" => $lang['report_pic_title'],
...

--- End code ---

TheOracle:
Yes, right. Thanks for reporting this. I have just updated my post above.  :oops:

As for this one :


--- Quote ---
$lang['lang_report_pic'] = "Report Image";


--- End quote ---

that's your mistake since it is not part of the instructions above. ;)

Navigation

[0] Message Index

[#] Next page

Go to full version