Questa Modifica è una variante della mChat Add-on: Notifications of New Topics, che oltre ad annunciare un nuovo Topic , annuncia anche le successive risposte senza la necessita di installare il BOT in quanto la nostra variante utilizza al posto del BOT l utente che ha creato o risposto al topic, per eseguirla dovete ovviamente aver installato la mchat e il suo contributo Notifications of New Topics che trovate nella cartella contrib della Modifica MChat
Apri: includes/functions_posting.php
Codice: Seleziona tutto
// BEGIN mChat Mod
// only trigger if mode is post
if ($post_mode == 'post' && $post_approval && !empty($config['mchat_enable']) && !empty($config['mchat_new_posts']))
{
$user->add_lang('mods/mchat_lang');
$mchat_new_data = $user->lang['MCHAT_NEW_TOPIC'];
// Data...
$message = utf8_normalize_nfc($mchat_new_data . ': [url=' . generate_board_url() . '/viewtopic.' . $phpEx . '?p=' . $data['post_id'] . '#p' . $data['post_id'] . ']' . $subject . '[/url]', true);
// Add function part code from http://wiki.phpbb.com/Parsing_text
$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage
generate_text_for_storage($message, $uid, $bitfield, $options, true, false, false);
$sql_ary = array(
'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
'post_id' => $data['post_id'],
'user_id' => $user->data['user_id'],
'user_ip' => $user->data['session_ip'],
'message' => $message,
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'bbcode_options' => $options,
'message_time' => time()
);
$sql = 'INSERT INTO ' . MCHAT_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
}
// BEGIN mChat Mod
Codice: Seleziona tutto
// BEGIN mChat Add-on: Notifications of New Topics
// only trigger if mode is post
if ($post_approval && ($post_mode == 'post' || $post_mode == 'reply') && !empty($config['mchat_enable']) && !empty($config['mchat_new_posts']))
{
$user->add_lang('mods/mchat_lang');
if ($post_mode == 'post')
{
$mchat_new_data = $user->lang['MCHAT_NEW_TOPIC'];
}
else
{
$mchat_new_data = $user->lang['MCHAT_NEW_REPLY'];
}
$mchat_poster = (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']) : '');
// Data...
$message = utf8_normalize_nfc($mchat_new_data . ' [url=' . generate_board_url() . '/viewtopic.' . $phpEx . '?p=' . $data['post_id'] . '#p' . $data['post_id'] . ']' . $subject . '[/url] [b]nella Sezione[/b] [url=' . generate_board_url() . '/viewforum.' . $phpEx . '?f=' . $data['forum_id'] . ']' . $data['forum_name'] . ' [/url] ' , true);
// Add function part code from http://wiki.phpbb.com/Parsing_text
$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage
generate_text_for_storage($message, $uid, $bitfield, $options, true, false, false);
$sql_ary = array(
'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
'post_id' => $data['post_id'],
'user_id' => $user->data['user_id'],
'user_ip' => $user->data['session_ip'],
'message' => $message,
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'bbcode_options' => $options,
'message_time' => time()
);
$sql = 'INSERT INTO ' . MCHAT_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
}
// END mChat Add-on: Notifications of New Topics