example::
Code: Select all
public function pm_compose($event)
{
if ($game_report_id = (int) request_var('rid', 0))
{
global $arcade;
$message_subject = $message_text = '';
$arcade->pm_quote('report', $game_report_id, $message_subject, $message_text);
$event['message_subject'] = $message_subject;
$event['message_text'] = $message_text;
}
}
$arcade->pm_quote function
Code: Select all
function pm_quote($mode, $id, &$subject, &$message)
{
global $db, $config, $phpEx;
switch ($mode)
{
case 'report':
$sql = 'SELECT r.game_id, r.report_desc, r.report_desc_uid AS bbcode_uid, g.game_name, u.username AS quote_username, u.user_lang
FROM ' . ARCADE_REPORTS_TABLE . ' r, ' . ARCADE_GAMES_TABLE . ' g, ' . USERS_TABLE . ' u
WHERE r.report_id = ' . (int) $id . '
AND r.game_id = g.game_id
AND r.user_id = u.user_id';
$result = $db->sql_query($sql);
$game_report = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($game_report)
{
$reported_game = $this->message_language($game_report['user_lang'], 'ARCADE_REPORTED_GAME');
if ($config['allow_post_links'])
{
$game_link = "[url=" . generate_board_url() . "/arcade.$phpEx?mode=play&g={$game_report['game_id']}" . $this->gametop . "]{$reported_game}: {$game_report['game_name']}[/url]\n";
}
else
{
$game_link = $reported_game . ': ' . $game_report['game_name'] . " (" . generate_board_url() . "/arcade.$phpEx?mode=play&g={$game_report['game_id']}" . $this->gametop . ")\n";
}
decode_message($game_report['report_desc'], $game_report['bbcode_uid']);
$subject = 'Re: ' . $reported_game . '-' . $game_report['game_name'];
$message = $game_link . (($game_report['report_desc']) ? "\n[quote="{$game_report['quote_username']}"]" . censor_text(trim($game_report['report_desc'])) . "[/quote]\n" : '');
}
break;