Nuovi argomenti è risposte Forum in mChat versione AllCity

Forum misto con frammenti di codice
Rispondi
Avatar utente
Galandas
Staff phpBB3World
Staff phpBB3World
Messaggi: 792
Iscritto il: 4 nov 2012, 9:18
Località: phpbb3world
Contatta:

Nuovi argomenti è risposte Forum in mChat versione AllCity

Messaggio da Galandas » 13 gen 2014, 19:25

UK_Flag Informer for new topics or replies in mChat.
Italy_Flag Informare per nuovi argomenti o le risposte in mChat.


Apri: includes/functions_posting.php Trova:

Codice: Seleziona tutto

		unset($sql_data[POSTS_TABLE]['sql']);
Aggiungi dopo:

Codice: Seleziona tutto

/* ============= mChat Start Addon ============= */
global $table_prefix;
// Add name for db.
define('MCHAT_TABLE', $table_prefix.'mchat');
  // New post/message.
  if ($post_mode == 'post')
  {
    // For new post
    $mchat_new_data = $user->lang['POST_TOPIC'];
  }
  else
  {
    // For new message
    $mchat_new_data = $user->lang['NEW_MESSAGE'];
  }
  // Data...
  $message = utf8_normalize_nfc($mchat_new_data.': [url='.generate_board_url().'/viewtopic.'.$phpEx.'?p='.$data['post_id'].'#p'.$data['post_id'].']'.$subject.'[/url]');
  // 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(
    '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(),
    'guestname' => ''
  );
  $sql = 'INSERT INTO '.MCHAT_TABLE.' '.$db->sql_build_array('INSERT', $sql_ary);
  $db->sql_query($sql);
/* ============== mChat End Addon ============== */
Oppure se si desidera solo per un nuovo argomento!

Codice: Seleziona tutto

/* ============= mChat Start Addon ============= */
global $table_prefix;
// Add name for db.
define('MCHAT_TABLE', $table_prefix.'mchat');
  // New post only!
  if ($post_mode == 'post')
  {
    // New post lang
    $mchat_new_data = $user->lang['POST_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]');
    // 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(
      '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(),
      'guestname' => ''
    );
    $sql = 'INSERT INTO '.MCHAT_TABLE.' '.$db->sql_build_array('INSERT', $sql_ary);
    $db->sql_query($sql);
  }
/* ============== mChat End Addon ============== */
PRONTO ;) .


Ultimo bump di Galandas effettuato il 13 gen 2014, 19:25.
Menu Forum ha scritto:

Rispondi

Torna a “Snippets”

Chi c’è in linea

Visitano il forum: Nessuno e 3 ospiti