4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: TheOracle on February 02, 2006, 10:49:56 PM

Title: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 02, 2006, 10:49:56 PM
// 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: [Select]
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";
  }
}

add below :

Code: [Select]

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>";
}


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");


add below :

Code: [Select]

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


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;" : "?";


add above :

Code: [Select]

$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']) : "";


Then, find (updated - thanks to Mawenzi):

Quote

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


add below :

Code: [Select]

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


// Step 3

In your lang/english/admin.php file,

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

Code: [Select]

/*-- 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"
);


Note: Remember the 'Xs' rule. ;)

// Step 4

In your lang/english/main.php file,

add above the '?>' tag :

Code: [Select]

//-----------------------------------------
// 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";


// 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: [Select]

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


// 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: [Select]

<?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.
?>



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: [Select]

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}.


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: [Select]

{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}


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: [Select]

{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}


// 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: [Select]

{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}


// 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: [Select]

<?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');
?>



// 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: [Select]

$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>";


// 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"),


add below (this is it):

Code: [Select]

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


// 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 :

(http://img349.imageshack.us/img349/5679/reportimage1bn.th.png) (http://img349.imageshack.us/my.php?image=reportimage1bn.png)

;)

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

(http://img390.imageshack.us/img390/8671/reportpicturesuccess5tu.png) (http://imageshack.us)

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.



;)

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)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 02, 2006, 11:00:15 PM
Update: A slight mistake was corrected above from step 11. Please re-implement it. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: JensF on February 03, 2006, 12:02:03 AM
Yeah, Great. I will test it in 2 hours :)

Now i will look a DVD ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: mawenzi on February 03, 2006, 01:59:19 AM
... I miss something ...  :?
... after Step 2 in functions.php ...
Code: [Select]
$site_template->register_vars(array(
...
"report_image_url" => $report_url,
...

... and I cant found in funcitions.php or details.php ... for details.html ...
Code: [Select]
$site_template->register_vars(array(
...
"lang_report_pic" => $lang['report_pic_title'],
...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 02:01:53 AM
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";


that's your mistake since it is not part of the instructions above. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: JensF on February 03, 2006, 02:10:25 AM
Hi,

i have install it and i have a problem...blank page...

test it here -> http://www.terraristik-galerie.de/details.php?image_id=1747

look under the pic.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: mawenzi on February 03, 2006, 02:12:44 AM
... I miss in Step 3 ... 
Code: [Select]
$setting_group[XX]="Report Images";
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 02:43:05 AM
Quote

i have install it and i have a problem...blank page...


I think ... it is not the first time you encounter a blank page by installing a MOD. Am I right ? ;)

... I miss in Step 3 ... 
Code: [Select]
$setting_group[XX]="Report Images";

Ah ! I see. I'm glad you figured it out since all the steps are there and fully working. However, I'm glad you updated this since it's a big MOD. ;)

[EDIT]

I just understood what you meant about the $setting_group ... it wasn't even in mine and just noticed it was missing...  :oops:

First post updated.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: mawenzi on February 03, 2006, 02:50:21 AM
Quote from: TheOracle
PLEASE GIVE ME YOUR INPUTS

... or I understood you there wrongly ... ?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 02:51:19 AM
Quote

or I understood you there wrongly


Nope, you understood clairly. Greatly appreciated. In fact, I added your user name in the updates from my first post. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: JensF on February 03, 2006, 02:52:10 AM
Quote
I think ... it is not the first time you encounter a blank page by installing a MOD. Am I right ?

hhmm, you´re right but why?

At all Mods where i have this Problem i (or a User of this Board) found the Error. Now by the Cache Mod no one found the error.

Can you found the error for this Mod???
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 02:53:20 AM
Quote

Can you found the error for this Mod???


Well ... I could if there were one actually. If you take a look at my screenshot, you will notice it is working fine. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: JensF on February 03, 2006, 03:06:18 AM
I have upload the report_pic.php new and now i can see the site to report the pic but when i will send it then the blank page comes....

I think i must deinstall the Mod...

I don´t now why i have this problems :(
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 03:07:41 AM
Quote

I don´t now why i have this problems


You know what ? Since no one else reported this problem before, PM me. I will assist you for a little diagnostic tool investigation. This way, the answer should be more definitive. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 04:08:39 AM
Update:

Diagnostic completed. JensF's gallery is currently unstable and this blank page issue situation is about a MOD he must of had implemented in the past and affected his gallery somehow. This MOD works perfectly as all routines are fully calibrated (even more since mawenzi's report above).

That said, this MOD is a success ! ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: JensF on February 03, 2006, 11:42:04 AM
Hallo Oracle,

a last thing :)

I have a clean site called http://www.jensfunk.de. On this site i have now the Mod sitemap.

When i install the Report Mod on this i can report but i dont´t become a mail and i redirect to the index page. No message that the report was sent....

Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: trez on February 03, 2006, 03:28:18 PM
installed the MOD on my regular page, - its working, thanks Oracle ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 04:29:02 PM
@JensF:

Quote

I have a clean site


Yeah, you have a clean site with restricted access !

How am I supposed to verify your errors if you're going to post your site by blocking the way through the details page ???  :?

Come on man, this is unbelievable.

Another thing, could you please install the english language pack as well since I can't understand a word that's on your site right now.

You're asking for help, then please open some doors so that I can walk through them.

Thanks.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 04:47:14 PM
Quote

installed the MOD on my regular page, - its working, thanks Oracle


Thanks for your evaluating confirmation message again trez. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: JensF on February 03, 2006, 05:12:59 PM
Quote
Yeah, you have a clean site with restricted access !

Sorry :)

Now you can go direct to this one -> http://www.jensfunk.de/galerie/details.php?image_id=253

Under the Pic you see the Text - Report a Picture -

The Rest that you can see it´s now in englisch....

You can send the report but i don´t become a mail and you will redirect direct to the index. No error message, no OK you can see.

*edit* as guest you can see the link but it has no effect....i don´t now what it is....it brings me back to the image....

it don´t work at my sites...i delete it and good....

Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 05:33:07 PM
Quote

Under the Pic you see the Text - Report a Picture -


Where's the test account info so that I could also log in to view the page ? (Since GUESTs level are not allowed to view this page. Please read the features section of my first post) :roll:
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: JensF on February 03, 2006, 05:35:45 PM
The link i have write in my last post works for guests....
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 05:37:35 PM
Quote

The link i have write in my last post works for guests....


Correction - the details page works for GUEST level but NOT the Report a picture page (which is alright). Althought, you did not provided me any test account in order to see the page. Otherwise, it is obvious you will be redirected to the index page.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 03, 2006, 06:23:41 PM
Update:

Problem solved for JensF. It would seems the issue his site currently has is related to a custom template error(133) (which is covered in the FAQ as it has been discussed many times on the forum already). ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 04, 2006, 04:40:42 AM
So ... anyone else likes this MOD ? Today, I went into some 4images gallery to see how efficient this was but it seems no users are using it. If it's not the case, please correct me if I'm wrong.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Olphi on February 04, 2006, 01:34:17 PM
Hi @TheOracle

This mod is very efficient and it really needs time, until people have time to install it! You have to wait a few months or more and then you will see the results  :!:

Greets  :wink:

PS: If you really need applause, you can start a poll...   or are you only an impatient person?  :mrgreen:
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Loda on February 04, 2006, 03:18:40 PM
hi,
Quote
So ... anyone else likes this MOD ?
yes, i like this mod, but i don't get any email if anybody report a picture...
i don't find the mistake.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 04, 2006, 04:11:17 PM
Hi @TheOracle

This mod is very efficient and it really needs time, until people have time to install it! You have to wait a few months or more and then you will see the results  :!:

Greets  :wink:

PS: If you really need applause, you can start a poll...   or are you only an impatient person?  :mrgreen:

I don't mind to wait a while but a couple of months without inputs kinds of disgards the fact that users needed this MOD urgently from the request & discussions section of the forum don't you agree ? ;)

As for the poll, yes - you are right. This suggestion has been considered for my next releases from now on. Thanks for your inputs on this. ;)

hi,
Quote
So ... anyone else likes this MOD ?
yes, i like this mod, but i don't get any email if anybody report a picture...
i don't find the mistake.

Please PM me for more instructions on this. I did so with JensF yesterday and the problem was discovered in no time. ;)

In the mean time, would it be possible to post your URL ? (If not in here, your decision is understandable - you may do so over PM if you wish).
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: mawenzi on February 04, 2006, 04:59:24 PM
@ The Oracle,
Quote from: TheOracle
PLEASE GIVE ME YOUR INPUTS

... ok ...  :wink:
... I think you should create a version of the "Report a picture" ...
... In my opinion the report-page should be open in a small popup window ...
... with the detail-page in the background ...
... and after reporting ... and the receipt of a thank message ... the popup should be closed ...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: trez on February 04, 2006, 05:12:56 PM
Just a small tip:

If you wondering why you cant see the settings in the admin panel, put the code in step one after the SECOND     }  Then everything is fine. Dont understand?

 :arrow: It has to look like this
Code: [Select]
echo "</p></td>\n</tr>\n";
  }
}

function show_report_image_select($setting_name, $setting_value) {


not like this:
Code: [Select]
echo "</p></td>\n</tr>\n";
  }

function show_report_image_select($setting_name, $setting_value) {
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 04, 2006, 05:21:19 PM
Quote

In my opinion the report-page should be open in a small popup window


@mawenzi:

To be honnest, your suggestion has been strongly thought before I published this MOD regarding a popup possibillity. Althought, I had to change my mind right before since some users might be using a popup-blocker.

// So what ? Just disabled it.

Yes, that's what we hear a lot around here ain't it ? ;)

// Popup blocker from Internet Service Provider.

Althought, what most of online users might not be aware already, some ISPs (especially in CAN) are using a filter "from their server" to block popups for their customers in order to avoid spywares.

To conclude, on either case, your suggestion could not be considered due to these protections. Even if I could had the possibillity to add this, there wouldn't be a way for me to test this out properly "but" your suggestion is still greatly appreciated.

If Firefox can, providers can.  :D

Quote

with the detail-page in the background


As said from my instructions (and topic title), the HTML template is fully customizable with the report a picture MOD. Meaning, you can integrate your site header page without any problems. For instance, if you could see Loda's web site - she has done so. ;)

Althought, since her domain name has not been published in here, I'd rather wait for her conscent.

Quote

nd after reporting ... and the receipt of a thank message ... the popup should be closed ...


Fortunitely, even if it's not in a popup window, I have already set a successful and failed template page in order for users to, also, be able to customize them at their will. ;)

Quote

PLEASE GIVE ME YOUR INPUTS


Just a little note here. You don't have to quote this up each times since I'm already aware of my own text. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 04, 2006, 05:25:16 PM
@trez:

Quote

If you wondering why you cant see the settings in the admin panel, put the code in step one after the SECOND     }  Then everything is fine. Dont understand?


Actually ... even by checking your codes, I'm still confused about the post since everything works well from my end as it wasn't required to remove this bracket ... perhaps you implemented something before that amended this bracket to be removed (or is being left there as too much information for your case) since I can really assure mine works well with these two brackets already. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: trez on February 04, 2006, 05:41:37 PM
@ oracle

Yes, its maybe because i installed many MODs, and there was somewhere an opening comand which was not closed, youre right. Everything works now, great MOD
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: glitzer on February 04, 2006, 11:43:39 PM
Hello
i had the same problem with this code
Code: [Select]
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>";
}

After this a cant see my admin settings no more...
When i give the second   } away, it doesnt works to...

i get the message  Parse error: parse error, unexpected $ in /www/htdocs/test/pics/admin/settings.php on line 352

I do all right and step by step.

Please help!
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 04, 2006, 11:47:41 PM
Quote

i get the message  Parse error: parse error, unexpected $ in /www/htdocs/test/pics/admin/settings.php on line 352


Replace the } on the final line.

Did you installed a MOD before this one ? This is the 2nd report for the same issue (which I really can't get since this is the exact paragraph that I have right now and all works fine).

[ EDIT ]

To avoid growing this topic with this problem, please PM me by posting me your codes from admin/settings.php file. I will test your file myself. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: glitzer on February 05, 2006, 12:04:33 AM
Hi, i think i have it.
I put the code after my Profile code
Code: [Select]
}
function show_profile_hits_options($setting_name, $setting_value) {
  global $set_profile_hits_optionlist;
  echo "<select name=\"setting_item[".$setting_name."]\">";
  foreach ($set_profile_hits_optionlist as $key => $val) {
    echo "<option value=\"$key\"";
    if ($setting_value == $key) {
      echo " selected=\"selected\"";
    }
    echo ">".$val."</option>";
  }
  echo "</select>";
}

Now it works Thank you!
 :)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: glitzer on February 05, 2006, 12:12:35 AM
Sorryyy
me once more..but this mod doesnt work!
I have many Problemes..

FIRST:
I cant make a table with this..i does not work..i get only a white screen

Code: [Select]
<?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.
####### End of if statement.
?>

Now i have do it myself in my database.

SECOND:
When i fill out the Report form..and klick send..it doesnt show me any confirm as report send is ok or not ok..it replays to the index page and i DONT get any mail.

Now ..what is the error?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 05, 2006, 12:44:23 AM
Quote

I cant make a table with this..i does not work..i get only a white screen


Well, it is not a table but a "row". If you're having difficulties to install this row, simply add it from your phpmyadmin inside your SETTINGS_TABLE. ;)

In fact ... I never encountered any problems with the installation file itself.

Quote

When i fill out the Report form..and klick send..it doesnt show me any confirm as report send is ok or not ok..it replays to the index page and i DONT get any mail.


And what does your web error logs and mail error logs say about this ? Please provide more details. I'm not in front of your monitor as I do not have these reported errors. More specifications would be amended. (You may PM me if you don't want to post these kinds of infos here).
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 05, 2006, 02:48:04 AM
@glitzer:

Quote

i get only a white screen


Problem solved. The reason why you were getting a blank page is because you were not logged in under your ADMIN account to make the modifications ( a little security procedure for protecting your site against unwanted GUESTs). ;)

However, I have modified my first post regarding the installation file you posted and as, from now on, an error page message will appear in case you'll forget to log in in the future. ;)

From there, if you did not went into your phpmyadmin to add the field : "report_image_status", then it is not too late. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 05, 2006, 06:50:30 PM
Update: My first post has been updated from the Screenshots section.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Nova on February 05, 2006, 09:08:31 PM
I'm glad a MOD like this has been created. Thanks for your hard work. Sometimes I don't think people appreciate the effort coders put into their work. Well done.  :)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 05, 2006, 09:51:23 PM
I'm glad a MOD like this has been created. Thanks for your hard work. Sometimes I don't think people appreciate the effort coders put into their work. Well done.  :)

I think I'll start to cry if I keep reading this input above. 8)

Best thanks to you Nova. ;)

By the way, nice template here :

http://www.tarporley.com/4images/details.php?image_id=47

;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 07, 2006, 05:21:09 PM
Update:

Step 9, Step 10, Step 11 has been updated today. For those who were unable to send e-mails since the beginning of the released date, you may try again. ;)

Also, you might want to know there's a new step to fill out - which is Step 11.1.

[ EDIT ]

A small security issue has just been fixed on Step 11. Please redo this step in the mean time for those who already read my update in this post. My apologize for such an instant notice.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 07, 2006, 06:56:22 PM
I'm about to post the most unusual update of all. 10 mins ago, report_pic.php was working perfectly for me and, since I updated, I could finally see the redirecting to index page - without error message issue.  8O

That said, I have immediately updated Step 11. My sincere apologize for this error. Of course, those who still has any errors after this is not from this MOD's end. ;)

[ EDIT ]

URIKA !!

I found where the problem was. I forgot to state an if statement to check if the tracking information "were NOT tracked". You may officially redo Step 11 and this time FOR GOOD !!! 8)

It's really not my day it would seems.  :mrgreen:

In details, the problem was here :

Quote

$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);


forgot to add this below :

Quote



if (!$cat_id || !$cat_name || !$image_id || !$image_name || !$image_url) {
header ("Location: ".$site_sess->url(ROOT_PATH."report_pic.php?action=report_failed_comments", "&"));
exit;
} ###### End of if statement.




;)

Feel so bad for those who tryied to implemented this MOD many times without success already.  :oops:
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 07, 2006, 09:18:27 PM
Last update:

Since it is not my day, I have discovered another "small & tiny" security issue (not on same file at least. ;)).

However, please redo Step 2 since it was reported to me today that GUESTs what still able to get in. :| (but not anymore. ;)).
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 16, 2006, 05:18:53 AM
Fix-Update:

Some updates were done on step 11. For more information on these modifications, please read the change log paragraph from the first post. All should work correctly now.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: mawenzi on February 17, 2006, 01:30:01 AM
Code: [Select]
show_table_separator($setting_group[X], 2, "#setting_group_X");
show_setting_row("report_image_status", "show_report_image_select");

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


... that is not correct and is wrongly understood ...
... therefore I already received PMs ...
... it should be better ...

Quote
Note: Replace the 'Xs' with your latest setting number 'X' + 1 on the list.
( e.g. your latest setting number = 8 ; your setting number for "Report a picture"  = 9 )
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 17, 2006, 01:33:07 AM
Quote

therefore I already received PMs


And how odd I didn't received these inputs on this topic. :?

The + 1 signifies the earlier number you currently have and add the next number to it. That's all it means. ;)

Anyway. I recently noticed some slight bugs that are still on it as I will correct them shortly.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 17, 2006, 04:57:48 AM
OMG !!!  8O 8O 8O - I FOUND THE PROBLEM !!!

The reason why I was able to post a report and others couldn't is because I COMPLETELY FORGOT to post an instruction from my first post !!!

Step 11.2 has just been created. The problem was that the HTML Form had no destination action point (of course not, I didn't post it !!!).

My sincere apologize for this important step as I hope, in the future, NOT to make any mistakes like that again.  :oops: :oops: :oops:

In the mean time, I have spent numerous hours to re-type the report_pic.php file since, from different servers's results, it would seems there was several bugs left behind. I guess my test server was too easily configured or something.  :|

Now, everything should be fine as everybody should be able to use it without "any problems" and I can guarantee it. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TheOracle on February 17, 2006, 05:01:33 AM
Update:

Creation of Step 11.2 and update of Step 11 has been completed now. ;)

Good lucK ! 8)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Loda on February 17, 2006, 11:57:43 PM
hi,
i've install the mod today again and now it works!!!
thank you very much for this mod!
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: sabba on March 28, 2006, 11:14:42 PM
hi,

is there a way to hide the report image link for guests? The link is shown for guests but linked to index.

sabba
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: IcEcReaM on March 29, 2006, 12:18:30 AM
in includes/page_header.php file
change this
Code: [Select]
"url_report_image" => $site_sess->url(ROOT_PATH."report_pic.php?action=send_image_report"),to
Code: [Select]
"url_report_image" => ($user_info['user_level']>GUEST) ? $site_sess->url(ROOT_PATH."report_pic.php?action=send_image_report") : "",
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: sabba on March 29, 2006, 10:06:08 AM
Thanks, but it does not work for me, the link is still shown for guests  :?

sabba
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: IcEcReaM on March 29, 2006, 04:05:27 PM
maybe u have to check step 2.
i just overfly the code,
but only the registered users the link should shown.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: cookie on May 25, 2006, 11:40:21 PM
This MOD is nice.  It does work for me, but when I click on report a picture, I am re-directed to the report_pic.php (and the form is displayed).

however, above my header, I get this error message.


Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/test/public_html/report_pic.php:2) in /home/test/public_html/includes/sessions.php on line 86

This a brand new install of 1.7.2, that I've added 4 or 5 mods to other than this one.

EDIT: I was able to fix this issue.  I searched the PHP error on google and found that having an extra space "whitespace" at the beginning or end of a .php file can cause this.  Sure enough report_pic.php had a blank space at the beginning AND end of the file.  Not sure if the distribution was like that or it was my editor that added it.  All is fixed now.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: cookie on May 27, 2006, 03:07:50 PM
I've installed your MOD and it works great.  Thanks for this!

I have a question regarding security.  You mention this in your instructions:

Quote
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.

I looked at that users profile and found a MOD about antispam.  It seems that this MOD is geared towards Comments and Guestbook.

I require registration before comments are allowed to be posted, so I don't need this mod.

How will the report a picture mod open up a security hole for Spammers to use the script for their own bad purposes?  What is there to protect them from using it to send email?  What precautions should I take, or which specific mods should I install?

Kind Regards.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: cookie on May 30, 2006, 06:57:34 PM
I too had the problem where only a couple of lines were showing in the admin/settings section.  I found the problem to be a closing }

your instructions say find:
Quote
function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0) {
  global $config, $setting;
   $config_value = $config[$setting_name];
  //$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";
  }

add below
Code: [Select]
/* Added these lines for Report a bad pic MOD */
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>";
}

Maybe they should state:

find:

Quote
function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0) {
  global $config, $setting;
   $config_value = $config[$setting_name];
  //$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";
  }
}      <------- notice the second trailing closing bracket

Add below:

Code: [Select]
/* Added these lines for Report a bad pic MOD */
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>";
}
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: cookie on May 31, 2006, 12:24:39 AM
If you would like to re-direct Guests to an error page that lets them know that they need to login to Report a Pic.

Currently, when a guest clicks on the link, they are just re-directed to the image detail page without any errors or warnings.
In the first section of Step 2 in the installation instructions, you can use the following IF statement and place it under the lightbox section of includes/functions.php.

Code: [Select]
if ($user_info['user_level'] != GUEST) {

$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']) : "";
  }
  else {
   $report_url = "".$site_sess->url(ROOT_PATH."index.php?template=must_login")."";
}

You must then create a must_login.html file in your /public_html/templates/<templatename>/ folder

You should create the must_login.html based off of error.html, so that you get all the navigation, header, and footer for this page.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: TIMT on June 11, 2006, 07:54:11 PM
Hi,

I have three questions:



Thanks for helping me.

TIMT
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tdkpaul on July 29, 2006, 12:27:13 AM
this mod is just aussum
thaaaaaaaaaaaaaaaannnnnnnxxxxxxxxx

Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: jafori on August 08, 2006, 09:02:21 PM
Im just beeing so stupid...
tell me what do you mean with "Note: Replace the 'Xs' with your latest value number on the list."
I know what Xs are but how do i find the value number on the list... i dont even know what list you are talking about...
Haha yea yea you can laugh at me.. im a photoshoper, not a php-freak =)

Thanks for the Mod.. seems cool
 :mrgreen:
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: mawenzi on August 08, 2006, 10:45:18 PM
@ jafori

... try this -> http://www.4homepages.de/forum/index.php?topic=11447.msg61565#msg61565
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: jafori on August 17, 2006, 12:09:26 AM
hello.. im a little bit stupid.. :P

I want to add the following function to report_pic_form.html
{lang_uploader} and {uploader}
i mean the first one is a text like "uploader:" and the second tag is actually the name of the uploader "jafori" for instance...
Sounds simple.. but I´ve never succeeded to put a new lang function in the lang/main.php...
so once and for all.. tell me how I get ride of my problem :D :D :D

thanks a lot guys


*edited*
well one more question.. i want a picture to show up instead of "report a picture" link in the details page.. i want it to be a lang button.. I mean a button wich you can switch by changing lang in the controlpanell.. how do I do that =(.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tdkpaul on August 18, 2006, 11:14:27 PM


*edited*
well one more question.. i want a picture to show up instead of "report a picture" link in the details page.. i want it to be a lang button.. I mean a button wich you can switch by changing lang in the controlpanell.. how do I do that =(.

just edit the details.html  !!  :lol:

{if report_image_url}<a href="{report_image_url}" class="smalltext"><img src="http://www.youdomain.com/4images/yourtemplate/images/report a picture" alt="report a picture"></a><br /><br />{endif report_image_url}
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: jafori on August 18, 2006, 11:29:09 PM
Quote
{if report_image_url}<a href="{report_image_url}" class="smalltext"><img src="http://www.youdomain.com/4images/yourtemplate/images/report a picture" alt="report a picture"></a><br /><br />{endif report_image_url}
i´ve already done that.. but i want two different pictures to occure depending on what language settings i have.. if i have swedish it will show picture X and if i have english language settings it will show Y picture =(
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: V@no on August 19, 2006, 06:12:17 AM
[qcode]{if report_image_url}<a href="{report_image_url}" class="smalltext"><img src="{template_lang_image_url}/report_a_picture.gif" alt="report a picture"></a><br /><br />{endif report_image_url}[/qcode]
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: jafori on August 19, 2006, 11:15:32 PM
Vano, you solved one of my biggest mysteries in my life :) thaaaanks a lot.. i REALLY thank you for your help =)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on August 26, 2006, 04:03:23 PM
I don't want to send this Report to the webmaster Emailaddress but to another Mailadress - how do I fix this?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: V@no on August 26, 2006, 07:08:02 PM
In report_pic.php replace
Code: [Select]
$site_email->set_to(stripslashes($config['site_email']));
With:[qcode]$site_email->set_to("your@email.com");
[/qcode]
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: BartAfterDark on August 26, 2006, 09:54:33 PM
I also need a way to allow guests to report images.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tdkpaul on August 27, 2006, 09:11:56 AM
yes
this would be nice

i want this option, too
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on August 27, 2006, 09:19:50 PM
Thank you, v@no...

Also I'd like to redirect the User to the Detailpage of the foto they made a report to, not to the categories-site...

Error:
After uploading the "admin/settings.php" I see under "General->settings" only the first two rows (site name & admin email),
the rest dieappeared...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tdkpaul on September 01, 2006, 04:35:42 PM
come on
it must be possible to report a picture as a guest and not only a User/ Member.



Thx for the solution
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tdkpaul on September 08, 2006, 08:04:48 PM
What i have to change, that it is possible for guests reporting a picture ?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on October 29, 2006, 03:44:31 PM
I get a blank page after sending the report (named correction form) and I don't know why...

http://www.bos-fahrzeuge.info
Name: test
PW: testtest

Could be a problem with the new Version of 4images.

Is anybody here who has installed 1.7.4 with a workind MOD?

I've got it on a new 1.7.4 without other MODs on the server too and I get a blank page after sending the report-message
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on November 03, 2006, 09:46:05 AM
No longer support for this MOD? It's very important for us... Can anybody please help?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Acidgod on November 03, 2006, 09:54:44 AM
Also ich bitte dich, muss man sich 3 mal selber antworten?

Ich denke es bleibt dir nur die Möglichkeit auf einen Testsystem diesen Mod unter 1.7.4 zu installieren und dann zu testen...
Wenn es dann Fehler oder Probleme gibt kannst Du dich hier wieder zu Wort melden...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on November 03, 2006, 10:31:53 AM
Habe ich ja, mit Wechsel zu 1.7.4 tritt der Fehler auf... (2 Beiträge gelöscht)

Ist halt etwas dringlich, weil wir eine wichtige Funktion damit betreiben...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Acidgod on November 03, 2006, 10:47:07 AM
Wo kann man sich das denn anschauen?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on November 03, 2006, 02:23:33 PM
http://www.brianpeschke.de/4images/index.php
Das ist die Testgalerie, da war vorher 1.7.3 installiert plus dem MOD - alles funzte.
Nach dem Update auf 1.7.4 bekomme ich die weiße Seite nach Absenden des Reports

Name: test
PW: test
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Acidgod on November 03, 2006, 02:49:44 PM
Wie haste denn das Update gemacht?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on November 03, 2006, 03:09:11 PM
Wenn ich das richtig erinnere, die Änderungen einzeln eingefügt.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Acidgod on November 03, 2006, 03:15:00 PM
Prüfe nochmal die nötigen Schritte für diesen Mod, ggf hast Du was geändert was Du nicht hättest ändern dürfen...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on November 03, 2006, 03:45:40 PM
Hast du ihn auch installiert, funzt es bei dir mit 1.7.4? Vielleicht hat sich ja auch was durch die Änderungen grundlegend für diesen MOD verändert. Deswegen ja meine Frage nach einem Erfahrungsbericht, ich habe es jetzt in zwei Systemen upgedatet, in beiden funzt es danach nicht mehr.

Sonst werde ich die Dateien auf dem Testserver noch einmal komplett überschreiben und den MOD noch einmal einbauen.

Gibt es denn von Seiten von TheOracle noch Support, laut Profil war er ja länger nicht online...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Acidgod on November 03, 2006, 03:55:54 PM
also er wird hier wohl keinen support mehr geben... )o:
am besten machste es echt mal und testes es mit einer frischen installation...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on November 03, 2006, 04:36:15 PM
So, habe alle php-Dateien mit den Originalen von 1.7.4 ersetzt, den MOD neu eingebaut und wieder nach dem Versenden eine weiße Seite und keine Mail wurde versand...

Eigentlich muss es was mit den Änderungen durch 1.7.4 zu tun haben, denn mit 1.7.3 hat es ja funktioniert. Bleibt mir denn nur, alles Änderungen einzeln zu testen? Welche dann die weiße Seite verursacht?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Acidgod on November 03, 2006, 04:56:29 PM
Könnte es mir ggf am Montag mal anschauen...
Bräuchte dann aber einen FTP Zugang...

Kannste ja überlegen und mir sonst per PN mitteilen...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: tansamalaja on November 03, 2006, 05:24:34 PM
Das wäre toll, wann MO? Schreib sonst mal ne PN, dann bekommst du die Daten...
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on November 08, 2006, 02:59:59 AM
Hi in setting i just see this

Settings
[General settings] 
   [Category settings] 
   [Image settings] 
   [Upload settings] 
[Comment settings] 
   [Page and Nav settings] 
   [Session and User Settings] 
   [Ban] 
[Report Image] 
General settings

Site name
   

Admin email
   

i dont see any other thing after admin email and when i click on buttons nothin happens and i get a blank page on reporting an image can someone please help me
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Alonso on April 29, 2007, 10:25:07 PM
Nabend ich möchte das Gäste den "Report a Picture" Link nicht sehen.

Wie kann ich das ändern ?

Danke schonmal vorab
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Alonso on April 29, 2007, 11:05:16 PM
Zudem hab ich grade noch ein Fehler entdeckt

Wenn ich als Gast auf Neue Bilder klicken erscheint oben der Fehler

Notice: Undefined variable: report_url in /www/htdocs/xxxxxx/includes/functions.php on line 430


functions.php on line 430 ist das hier

 "report_image_url" => $report_url,

Jemand ne Idee
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: ccsakuweb on May 12, 2007, 10:28:40 PM
Hi ! I don't understand why but i don't receive any report, i tested it with a normal user and i didn't receive any email. I have PM installed and I receive notifications from the site about new pm.
  My gallery don't have any error, i use 1.7.3 version. The url: http://www.myart.es could someone help me please?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: sargent on August 01, 2007, 12:43:24 PM
This is a great mod but after installing it i am getting an error on the new images page for a guest but i dont get this if you are a member logged in this is what im getting i have ver 7.4 installed any help would be great the mod works well registered users can send email for pics just want to get rid of this error

http://www.incrediheaven.com/search.php?search_new_images=1

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431

Notice: Undefined variable: report_url in /home/incredih/public_html/includes/functions.php on line 431
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: thunderstrike on August 01, 2007, 01:42:20 PM
Try with:

Quote
"report_image_url" => (isset($report_url)) ? $report_url : "",

from includes/functions.php file.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: sargent on August 01, 2007, 02:49:30 PM
Yep that did it thanks heaps
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Darkness2001 on August 02, 2007, 01:44:08 AM
Hi at @ll....

sehr guter MOD work's perfekt...

Greetings darkness  :mrgreen:
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: ccsakuweb on August 09, 2007, 11:09:06 PM
Hi! I installed this great mod. But i dont receive the email  :roll: so i modified the mod and now i receive a pm when someone report a picture with the same text that the email. if you want it you will need pmv2 installed. here is the addon:

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


add after:
Code: [Select]
$pm_to = 1;    //Here your ID like admin
$pm_from = $user_info['user_id'];
$pm_type = 5;
$pm_bbcode = 1;
$pm_smiles = 1;

$pm_message = "Querido webmaster,\n\nPerfil: ".$user_name_link."\n\nImagen URL: ".$destination_url."\n\nEl usuario: \"".$user_name."\" ha reclamado la imagen llamada: \"".$image_name."\"\n\nPor la siguiente razon:\n\n
=============================================\n\n".$report_comments."\n\n=============================================\n\nSi deseas contestar a este usuario, aqui tienes su direccion de e-amil: ".$user_email."
\n\nQue te vaya bien.\n\n".$site_name;
$pm_subject = "\"".$user_info['user_name']."\" ha reclamado la imagen: ".$image_name;

$sql = "INSERT INTO ".PM_TABLE."
(pm_date, pm_to, pm_from, pm_subject, pm_type, pm_text, pm_bbcode, pm_html, pm_ip, pm_smiles)
VALUES
('".time()."', $pm_to, $pm_from, '".$pm_subject."', $pm_type, '".$pm_message."', $pm_bbcode, 0, '".$session_info['session_ip']."', $pm_smiles)";
$site_db->query($sql);
Replace $pm_to number with your ID

 :wink:
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: thunderstrike on August 09, 2007, 11:22:06 PM
What PM do with report picture ?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: ccsakuweb on August 09, 2007, 11:35:52 PM
i don't receive report pic in email so i need a solution. this is a solution, if someone have the same problem that me and have installed pmv2 this addon will help him. so i write this addon here.

$pm_message  is the text from the pm. Replace this with the image_report_message.html and {variable} to ".$variable."
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: thunderstrike on August 09, 2007, 11:51:56 PM
Quote
$site_email->set_from(stripslashes($config['site_email']), stripslashes($user_name));

From first post ... do no why is there but should:

Quote
$site_email->set_from(stripslashes($config['site_email']));

Template email file need exist from lang/your_template/email.

To replace with email:

Quote
$site_email->set_to(stripslashes("your_email@your_domain.com"));

Replace your_email@your_domain.com with email. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: ccsakuweb on August 10, 2007, 11:20:56 AM
wow thank you!!! The last time none help me. thank you very much, it works rigt ^o^
now i wont need pm ^^
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: thunderstrike on August 10, 2007, 01:09:20 PM
includes/email.php there for that. ;)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: fotopolis on March 16, 2008, 03:35:48 PM
Can anyone help me to include Secure Code to this mod?

These are the posts, but I am not sure how to do it or the steps to integrate it.

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

Thanks!
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Sunny C. on June 13, 2008, 12:04:03 PM
Ist das eine Mod mit dem man Bilder melden kann?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: newuser222 on December 16, 2008, 09:32:33 PM
If you have categories in different non-latain characters language and want to reporting add this MOD,then you'll face a problem with the link characters, since the link will include non-latain characters of the category name and/or the uploaded image name.

the original code in includes/functions.php file:
Code: [Select]
$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']) : "";
must be change into this:
Code: [Select]
$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=".urlencode($image_row['cat_name'])."&amp;".URL_IMAGE_ID."=".$image_row['image_id']."&image_name=".urlencode($image_row['image_name'])) : "";
that's it!!
If there are any modifications ur welcome guys! :wink:
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on February 02, 2009, 04:04:45 PM
Im having problems installing this mod i will pay 20 USD Who ever can install this mod for me :D PM ME  :D if someone can install this mof for me im runing 4images 1.74
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: V@no on February 02, 2009, 04:06:23 PM
What is the problem?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on February 02, 2009, 04:10:02 PM
Hi bro when i click setting nothin shows up
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: V@no on February 02, 2009, 04:45:00 PM
in step 2 and 3 did you replace X with needed number?
to find the correct number, scroll up the code in the file and find the last instance of similar line with number, then add 1 to that number = that is the number you need
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on February 02, 2009, 04:48:52 PM
bro on my orignal file setting.php the code is like this

Code: [Select]
MOD RECYCLE BIN FOR IMAGES
  END REPLACE
*/
  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");

  /*
    MOD BAN
    START INSERT
  */
    show_table_separator($setting_group[7], 2, "#setting_group_7");
    show_setting_row("look_hostname", "radio");
  /*

So i put 8 on the X is that rite ?
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: V@no on February 03, 2009, 03:03:04 AM
If what you showed is the last piece, then yes, 8 would be the correct number
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on February 03, 2009, 04:26:37 AM
i installed the mod now the form comes everything comes but when i try to report the image send the email it redirects to this link

http://www.mysite.com/report_pic.php?action=send_image_report  ( WITH A BLANK WHITE PAGE) anyone knows what could be the problem ??
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: V@no on February 03, 2009, 05:09:07 AM
When you do what exactly? (click a link, fill up the form and press submit button, etc)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on February 03, 2009, 06:01:25 AM
when i fill the form and click "send the report" button than white page comes up bro i sent u a link of my site in your pm bro if u wanna see what i mean
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on February 06, 2009, 03:05:04 AM
Im still waiting on someone to help me out here :( please ... . i really need this mod im running 4 images 1.7.4
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: arabcine on December 16, 2009, 01:43:33 PM
wow it's work fine on 1.7.7,

but how i can show only this for members "Report a Picture"

and it's not support arabic lang,

tell me how i can?

Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Kurman on December 18, 2009, 07:13:20 AM
Can somebody change this MOD in way to report a lightbox as well as a picture? (or just lightbox only)
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: V@no on December 18, 2009, 07:17:35 AM
report a lightbox?/me confused
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: Kurman on December 22, 2009, 09:49:36 PM
Yes, V@no, not exactly "report" ))) but to increase funtionality of this MOD, so we could send to admin all picture names which are in lightbox with a message, just like this MOD does for a certain picture. Then we could use this MOD as well to report a single picture, or several at once, if we had such a button in lightbox.

P.S. Here is another MOD "send lightbox to admin", but it is too complicated.  :? but this MOD, "report a picture" is the nice one.
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: abokhalel2 on December 28, 2009, 04:43:17 AM
That's Great ! It works with 1.7.7 quit well  :) !

many thanks to TheOracle 8) ..

I've seen some people asking about some stuff in this MOD , and I've not seen answers !

So, I decide to register here and help them :wink: ..

I don't have much of experience in PHP , but I'm gonna do my best ..

First matter, how can I make the [MOD] go back to the same image after reporting instead of going to the category?

That's a good question, because going back to the category doesn't make sense to me :? .. I think it is better if it comes back to the same image.

Here is the way how we can do that ..

Open this file : report_pic.php , then find :
Code: [Select]
$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".(isset($cat_id)), "&")."\">";
Replace it with:

Code: [Select]
$redirect = "<meta http-equiv=\"refresh\" content=\"2; url=".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id , "&")."\">";
That's it  :wink:


One more thing .. and I've seen this question in this thread many times .. with no answer  :(

How can I make guests report images as well ?!

this is how we make it .. and by the way .. I'm not quit sure if this is the perfect way to do it .. I've told u that I'm not that good with PHP :P ..

anyway .. this works fine with me .. so try it and tell me if it works with u :)

Open report_pic.php file .. now find :

Code: [Select]
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;
}

Delete it all ..

Yes I'm sure .. Delete it all :P .. this IF statement restrict guest ability to report images ..

Now open includes/functions.php , find:

Code: [Select]
$lightbox_button = "<img src=\"".get_gallery_image("lightbox_off.gif")."\" border=\"0\" alt=\"\" />";
  }

Below this, add:
Code: [Select]
if ($user_info['user_level'] != GUEST) {

$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']) : "";
  }
  else {
$report_url = "".$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']."";
}

That's it :wink: ..

Note : allowing guests to report could cause spamming emails from guests and bots. so, be careful.

I hope I helped a little .. and keep up guys the good work ..
Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: __G__ on August 11, 2010, 02:19:52 AM
Notice: Undefined variable: report_url in /mounted-storage/home139/sub014/sc75725-AETA/mywebsite.com/includes/functions.php on line 519


The mod is http://www.4homepages.de/forum/index.php?topic=11447.0


and my functions.php i am attaching if anyone knows the solution please let me know will appreciate it

If i am logged in an account then i get no error if i do search as a GUEST i do get error

Title: Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
Post by: MrAndrew on October 03, 2010, 10:34:34 PM
___G___, try this in function.php

Code: [Select]
"report_image_url" => (isset($report_url)) ? $report_url : "",
My question... Please help me to show, one of my additional image field info... How to do this?