'.$cur_error.'';
($hook = get_hook('mi_pre_email_errors')) ? eval($hook) : null;
?>
'.$lang_common['Required'].'') ?>
't.id, t.subject, t.forum_id',
'FROM' => 'posts AS p',
'JOINS' => array(
array(
'INNER JOIN' => 'topics AS t',
'ON' => 't.id=p.topic_id'
)
),
'WHERE' => 'p.id='.$post_id
);
($hook = get_hook('mi_qr_get_report_topic_data')) ? eval($hook) : null;
$result = $pun_db->query_build($query) or error(__FILE__, __LINE__);
if (!$pun_db->num_rows($result))
message($lang_common['Bad request']);
list($topic_id, $subject, $forum_id) = $pun_db->fetch_row($result);
($hook = get_hook('mi_report_pre_reports_sent')) ? eval($hook) : null;
// Should we use the internal report handling?
if ($pun_config['o_report_method'] == 0 || $pun_config['o_report_method'] == 2)
{
$query = array(
'INSERT' => 'post_id, topic_id, forum_id, reported_by, created, message',
'INTO' => 'reports',
'VALUES' => $post_id.', '.$topic_id.', '.$forum_id.', '.$pun_user['id'].', '.time().', \''.$pun_db->escape($reason).'\''
);
($hook = get_hook('mi_add_report')) ? eval($hook) : null;
$pun_db->query_build($query) or error(__FILE__, __LINE__);
}
// Should we e-mail the report?
if ($pun_config['o_report_method'] == 1 || $pun_config['o_report_method'] == 2)
{
// We send it to the complete mailing-list in one swoop
if ($pun_config['o_mailing_list'] != '')
{
$mail_subject = 'Report('.$forum_id.') - \''.$subject.'\'';
$mail_message = 'User \''.$pun_user['username'].'\' has reported the following message:'."\n".pun_link($pun_url['post'], $post_id)."\n\n".'Reason:'."\n".$reason;
require PUN_ROOT.'include/email.php';
pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
}
}
redirect(pun_link($pun_url['post'], $post_id), $lang_misc['Report redirect']);
}
// Setup form
$pun_page['set_count'] = $pun_page['fld_count'] = 0;
$pun_page['form_action'] = pun_link($pun_url['report'], $post_id);
$pun_page['hidden_fields'][] = '