• [MOD] - Report a picture (configurable from ACP + over HTML template files) 4 0 5 1
Currently:  

Author Topic: [MOD] - Report a picture (configurable from ACP + over HTML template files)  (Read 156500 times)

0 Members and 1 Guest are viewing this topic.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #45 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.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #46 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 )
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #47 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.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #48 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. ;)

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #49 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)

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #50 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!

Offline sabba

  • Pre-Newbie
  • Posts: 9
    • View Profile
hi,

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

sabba

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
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") : "",
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline sabba

  • Pre-Newbie
  • Posts: 9
    • View Profile
Thanks, but it does not work for me, the link is still shown for guests  :?

sabba

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
maybe u have to check step 2.
i just overfly the code,
but only the registered users the link should shown.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

Offline cookie

  • Newbie
  • *
  • Posts: 29
    • View Profile
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.
« Last Edit: June 12, 2006, 05:32:51 AM by cookie »

Offline cookie

  • Newbie
  • *
  • Posts: 29
    • View Profile
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.

Offline cookie

  • Newbie
  • *
  • Posts: 29
    • View Profile
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>";
}

Offline cookie

  • Newbie
  • *
  • Posts: 29
    • View Profile
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.

Offline TIMT

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
Hi,

I have three questions:

  • what do I have to change, that the user after sending the report is redirected to the detail page of the reportet image instead of the category page?
  • is it possible tho show the thumbnail of the reported image in report_pic_form.html?
  • I habe implemented the security code in contact form. what do I have to do for implementing security code in "report a pic"?


Thanks for helping me.

TIMT
« Last Edit: June 11, 2006, 08:51:44 PM by TIMT »