UPneonshares wrote:Hello,
The feature i asked is already available in mchat as we can get the "Who is online on MCHAT" from chat archive page ie http://yoursitename.com/mchat.php
I would like to have that "Who is online on MCHAT" option on the index page attached to mchat box with hide and show button. Its also having high refresh rate of 30 seconds for
Whois refresh:
Number of seconds before whois stats refreshes.
Do not go below 30 seconds.
Better reducing it to 5seconds as like chat refresh rate of 5seconds would be good.
Thanks
New Topic/Reply Notification
This will add a new message inside mchat that will notify users of a new topic or reply. It will be automatically posted under the user name of whoever made the new topic/reply, and it will provide a link to the new topic/reply.
Note: This modification was originally created by AllCity, I have altered it to display a custom, editable text when a new topic or reply is made, rather than "piggybacking" off of existing text already in the system.
Open: /language/en/common.php
As always, make a backup before you proceed.
Find:Add after, on a new blank line:Code: Select all
'MIB' => 'MiB',
Open: /includes/functions_posting.phpCode: Select all
'MCHAT_NEW_TOPIC' => '<strong>System Message - New Topic</strong>', 'MCHAT_NEW_REPLY' => '<strong>System Message - New Reply</strong>',
As always, make a backup before you proceed.
Find:Add after, on a new blank line:Code: Select all
unset($sql_data[POSTS_TABLE]['sql']);
Code: Select all
/* ============= mChat Start ============= */ 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['MCHAT_NEW_TOPIC']; } else { // For new message $mchat_new_data = $user->lang['MCHAT_NEW_REPLY']; } // 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'], 'username' => $user->data['username'], 'user_colour' => $user->data['user_colour'], '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); /* ============== mChat End ============== */
Code: Select all
$sql_ary = array(
'user_id' => $user->data['user_id'],
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_ip' => $user->data['session_ip'],
'message' => $message,
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'bbcode_options' => $options,
'message_time' => time()
Code: Select all
$sql_ary = array(
'forum_id' => 0,
'post_id' => 0,
'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);
Follow your template example.. like the whois online box, or the clock in your portal... use the same example from those...Khamosh-Saya wrote:What About me RMcGirr83 ???
Code: Select all
<!-- INCLUDE simple_header.html -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="18" height="18"><img src="{T_THEME_PATH}/images/tl.png" width="18" height="18" alt="" /></td>
<td height="18" style="background:url('{T_THEME_PATH}/images/tm.png');"></td>
<td width="18" height="18"><img src="{T_THEME_PATH}/images/tr.png" width="18" height="18" alt="" /></td>
</tr>
<tr>
<td width="18" style="background:url('{T_THEME_PATH}/images/ml.png');"></td>
<td>
<table class="tablebg" width="100%" cellspacing="0">
<tr>
<th>{L_WHOIS}</th>
</tr>
<tr>
<td class="row1"><pre>{WHOIS}</pre><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
</tr>
</table>
</td>
<td width="18" style="background:url('{T_THEME_PATH}/images/mr.png');"></td>
</tr>
<tr>
<td width="18" height="18"><img src="{T_THEME_PATH}/images/bl.png" width="18" height="18" alt="" /></td>
<td height="18" style="background:url('{T_THEME_PATH}/images/bm.png');"></td>
<td width="18" height="18"><img src="{T_THEME_PATH}/images/br.png" width="18" height="18" alt="" /></td>
</tr>
</table>
<!-- INCLUDE simple_footer.html -->
Code: Select all
<!-- IF MCHAT_ARCHIVE_MODE or MCHAT_CUSTOM_PAGE -->
<!-- INCLUDE overall_header.html -->
<!-- ENDIF -->
<!-- IF MCHAT_ARCHIVE_MODE -->
<table width="100%" cellspacing="1">
<tr>
<td class="nav" valign="middle" nowrap="nowrap"> <!-- IF MCHAT_PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{MCHAT_PAGE_NUMBER}</a><!-- ELSE -->{MCHAT_PAGE_NUMBER}<!-- ENDIF --><br /></td>
<td class="gensmall" nowrap="nowrap"> [ {MCHAT_TOTAL_MESSAGES} ] </td>
<td class="gensmall" width="100%" align="right" nowrap="nowrap"><!-- IF MCHAT_PAGINATION --><b>{MCHAT_PAGINATION}</b><!-- ELSE --> <!-- ENDIF --></td>
</tr>
</table>
<!-- ENDIF -->
<!-- IF not MCHAT_READ_MODE -->
<!-- IF not S_MCHAT_LOCATION --><br /><!-- ENDIF -->
<table class="tablebg" width="100%" cellspacing="1" style="table-layout: fixed;">
<tr>
<td class="cat"><!-- IF MCHAT_ARCHIVE_MODE --><h4>{L_MCHAT_ARCHIVE_PAGE}</h4><!-- ELSE --><h4>{L_MCHAT_TITLE}</h4><!-- ENDIF --></td>
</tr>
<tr>
<td class="row1" width="100%" valign="middle">
<!-- ENDIF -->
<!-- IF MCHAT_ENABLE -->
<!-- IF not MCHAT_READ_MODE -->
<script type="text/javascript">
// <![CDATA[
// Define mChat setting
var mChatFile = '{MCHAT_FILE_NAME}';
var mChatForumRoot = '{ROOT_PATH}';
<!-- IF not MCHAT_ARCHIVE_MODE -->
var mChatRefresh = '{MCHAT_REFRESH_JS}';
<!-- ELSE -->
var mChatRefresh = false;
<!-- ENDIF -->
var mChatNoMessageInput = '{LA_MCHAT_NOMESSAGEINPUT}';
var mChatNoMessage = '{LA_MCHAT_NOMESSAGE}';
var mChatEditInfo = '{LA_MCHAT_EDITINFO}';
var mChatNoAccess = '{LA_MCHAT_NOACCESS}';
var mChatFlood = '{LA_MCHAT_FLOOD}';
var mChatDelConfirm = '{LA_MCHAT_DELCONFIRM}';
<!-- IF MCHAT_CUSTOM_PAGE_WHOIS and MCHAT_CUSTOM_PAGE-->
var mChatCustomWhois = true;
var mChatWhoisRefresh = '{MCHAT_WHOIS_REFRESH}';
<!-- ELSE -->
var mChatCustomWhois = false;
var mChatWhoisRefresh = false;
<!-- ENDIF -->
<!-- IF MCHAT_ARCHIVE_MODE -->
var mChatArchiveMode = true;
<!-- ELSE -->
var mChatArchiveMode = false;
// Define the bbCode tags
var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','