Skip to content

Commit

Permalink
Working on mybb#556 Report Center
Browse files Browse the repository at this point in the history
Added plugin hooks in report.php
  • Loading branch information
Starpaul20 authored and ATofighi committed May 29, 2014
1 parent dede6bf commit c380096
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion report.php
Expand Up @@ -22,6 +22,8 @@
error_no_permission();
}

$plugins->run_hooks("report_start");

$report = array();
$verified = false;
$report_type = 'post';
Expand Down Expand Up @@ -125,7 +127,7 @@
}
}

// Plugin hook?
$plugins->run_hooks("report_type");

// Check for an existing report
if(!empty($report_type_db))
Expand All @@ -151,13 +153,17 @@
{
verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("report_do_report_start");

// Is this an existing report or a new offender?
if(!empty($report))
{
// Existing report, add vote
$report['reporters'][] = $mybb->user['uid'];
update_report($report);

$plugins->run_hooks("report_do_report_end");

eval("\$report_thanks = \"".$templates->get("report_thanks")."\";");
echo $report_thanks;
exit;
Expand Down Expand Up @@ -191,6 +197,8 @@
$new_report['reason'] = $reason;
add_report($new_report, $report_type);

$plugins->run_hooks("report_do_report_end");

eval("\$report_thanks = \"".$templates->get("report_thanks")."\";");
echo $report_thanks;
exit;
Expand Down Expand Up @@ -239,6 +247,8 @@
exit;
}

$plugins->run_hooks("report_end");

eval("\$report = \"".$templates->get("report", 1, 0)."\";");
echo $report;
exit;
Expand Down

0 comments on commit c380096

Please sign in to comment.