Image to Post - report
This commit is contained in:
parent
13ad9d3b6d
commit
93259db601
@ -5,10 +5,10 @@ class ReportImageInfo extends ExtensionInfo
|
|||||||
public const KEY = "report_image";
|
public const KEY = "report_image";
|
||||||
|
|
||||||
public $key = self::KEY;
|
public $key = self::KEY;
|
||||||
public $name = "Report Images";
|
public $name = "Report Posts";
|
||||||
public $url = "http://atravelinggeek.com/";
|
public $url = "http://atravelinggeek.com/";
|
||||||
public $authors = ["ATravelingGeek"=>"atg@atravelinggeek.com"];
|
public $authors = ["ATravelingGeek"=>"atg@atravelinggeek.com"];
|
||||||
public $license = self::LICENSE_GPLV2;
|
public $license = self::LICENSE_GPLV2;
|
||||||
public $description = "Report images as dupes/illegal/etc";
|
public $description = "Report posts as dupes/illegal/etc";
|
||||||
public $version = "0.3a";
|
public $version = "0.3a";
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ class ReportImage extends Extension
|
|||||||
$page->set_mode(PageMode::REDIRECT);
|
$page->set_mode(PageMode::REDIRECT);
|
||||||
$page->set_redirect(make_link("post/view/$image_id"));
|
$page->set_redirect(make_link("post/view/$image_id"));
|
||||||
} else {
|
} else {
|
||||||
$this->theme->display_error(500, "Missing input", "Missing image ID or report reason");
|
$this->theme->display_error(500, "Missing input", "Missing post ID or report reason");
|
||||||
}
|
}
|
||||||
} elseif ($event->get_arg(0) == "remove") {
|
} elseif ($event->get_arg(0) == "remove") {
|
||||||
if (!empty($_POST['id'])) {
|
if (!empty($_POST['id'])) {
|
||||||
@ -67,7 +67,7 @@ class ReportImage extends Extension
|
|||||||
$page->set_redirect(make_link("image_report/list"));
|
$page->set_redirect(make_link("image_report/list"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->theme->display_error(500, "Missing input", "Missing image ID");
|
$this->theme->display_error(500, "Missing input", "Missing post ID");
|
||||||
}
|
}
|
||||||
} elseif ($event->get_arg(0) == "remove_reports_by" && $user->check_auth_token()) {
|
} elseif ($event->get_arg(0) == "remove_reports_by" && $user->check_auth_token()) {
|
||||||
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
|
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
|
||||||
@ -128,7 +128,7 @@ class ReportImage extends Extension
|
|||||||
$count = $this->count_reported_images();
|
$count = $this->count_reported_images();
|
||||||
$h_count = $count > 0 ? " ($count)" : "";
|
$h_count = $count > 0 ? " ($count)" : "";
|
||||||
|
|
||||||
$event->add_nav_link("image_report", new Link('image_report/list'), "Reported Images$h_count");
|
$event->add_nav_link("image_report", new Link('image_report/list'), "Reported Posts$h_count");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ class ReportImage extends Extension
|
|||||||
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
|
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
|
||||||
$count = $this->count_reported_images();
|
$count = $this->count_reported_images();
|
||||||
$h_count = $count > 0 ? " ($count)" : "";
|
$h_count = $count > 0 ? " ($count)" : "";
|
||||||
$event->add_link("Reported Images$h_count", make_link("image_report/list"));
|
$event->add_link("Reported Posts$h_count", make_link("image_report/list"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ class ReportImage extends Extension
|
|||||||
|
|
||||||
public function onSetupBuilding(SetupBuildingEvent $event)
|
public function onSetupBuilding(SetupBuildingEvent $event)
|
||||||
{
|
{
|
||||||
$sb = new SetupBlock("Image Reports");
|
$sb = new SetupBlock("Post Reports");
|
||||||
|
|
||||||
$opts = [
|
$opts = [
|
||||||
"Reporter Only" => "user",
|
"Reporter Only" => "user",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user