• [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 156539 times)

0 Members and 1 Guest are viewing this topic.

Offline abokhalel2

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #120 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 ..

Offline __G__

  • Sr. Member
  • ****
  • Posts: 286
    • View Profile
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


Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [MOD] - Report a picture (configurable from ACP + over HTML template files)
« Reply #122 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?
« Last Edit: October 04, 2010, 11:13:52 PM by MrAndrew »