mchat version 1.2.17
Display users avatar in the chat.
[spoiler]
You can change the value 25 : (25 to bigger if you wish to display a larger avatar.RMcGirr83 » 11 Jan 2010, 02:15 wrote:
OPEN
mchat.php
find:add after:Code: Select all
include($phpbb_root_path . 'includes/functions_mchat.' . $phpEx);
FINDCode: Select all
// avatar if (!function_exists('get_user_avatar')) { include($phpbb_root_path . 'includes/functions_display.' . $phpEx); }
IN LINE FINDCode: Select all
$sql = 'SELECT m.*, u.username, u.user_colour
IN LINE AFTER ADDCode: Select all
u.user_colour
FINDCode: Select all
, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height
AFTER ADDCode: Select all
'MCHAT_MESSAGE_ID' => $row['message_id'],
FINDCode: Select all
'MCHAT_USER_AVATAR' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '',
IN LINE FINDCode: Select all
$sql = 'SELECT m.*, u.username, u.user_colour
IN LINE AFTER ADDCode: Select all
u.user_colour
FINDCode: Select all
, u.user_id as userid, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height
AFTER ADDCode: Select all
'MCHAT_MESSAGE_ID' => $row['message_id'],
FINDCode: Select all
'MCHAT_USER_AVATAR' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '', 'MCHAT_PADDING' => !empty($row['user_avatar']) ? ($row['user_avatar_width'] > $row['user_avatar_height'] ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width']) : '',
IN LINE FINDCode: Select all
$sql = 'SELECT m.*, u.username, u.user_colour, u.user_id as userid
IN LINE AFTER ADDCode: Select all
userid
FINDCode: Select all
, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height
AFTER ADDCode: Select all
'MCHAT_MESSAGE_ID' => $row['message_id'],
FINDCode: Select all
'MCHAT_USER_AVATAR' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '',
IN LINE FINDCode: Select all
$sql = 'SELECT m.*, u.username, u.user_colour
IN LINE AFTER ADDCode: Select all
u.user_colour
FINDCode: Select all
, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height
AFTER ADDCode: Select all
'MCHAT_MESSAGE_ID' => $row['message_id'],
Code: Select all
'MCHAT_USER_AVATAR' => ($row['user_avatar']) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], ($row['user_avatar_width'] > $row['user_avatar_height']) ? 25 : (25 / $row['user_avatar_height']) * $row['user_avatar_width'], ($row['user_avatar_height'] > $row['user_avatar_width']) ? 25 : (25 / $row['user_avatar_width']) * $row['user_avatar_height']) : '',
Open mchat/mchat_prosilver.css
find:
Code: Select all
div.mChatBG2 {
background-color: #FFFFFF;
padding: 5px 5px 5px 15px;
border-bottom: 1px dotted #DDDDDD;
overflow: hidden;
}
Code: Select all
.chat_profile {
float:left;
border-right: solid 1px gray;
text-align: center;
margin-right: 5px;
padding-right: 3px;
}
find:
Code: Select all
div.mChatBG2 {
background-color: #FFFFFF;
padding: 5px 5px 5px 15px;
border-bottom: 1px dotted #DDDDDD;
overflow: hidden;
}
Code: Select all
.chat_profile {
float:left;
border-right: solid 1px gray;
text-align: center;
margin-right: 5px;
padding-right: 3px;
}
find:
Code: Select all
<!-- BEGIN mchatrow -->
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover"><span style="float:left;">{mchatrow.MCHAT_USERNAME_FULL}<!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --> <a href="javascript://" onclick="insert_text('[b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);">|<b style="color: {mchatrow.MCHAT_USERNAME_COLOR}">X</b>|</a><!-- ELSE --> <a href="javascript://" onclick="insert_text('[b]{mchatrow.MCHAT_USERNAME}[/b], ', false);">|<b>X</b>|</a><!-- ENDIF --><!-- ELSE --> <a href="javascript://" onclick="insert_text('{mchatrow.MCHAT_USERNAME}, ', false);">|X|</a><!-- ENDIF --><!-- ENDIF --> - {mchatrow.MCHAT_TIME}</span><span style="float:right;"><!-- IF MCHAT_ALLOW_IP --><b>{L_MCHAT_IP}</b> <a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{mchatrow.MCHAT_USER_IP}</a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{ROOT_PATH}mchat/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" style="vertical-align: middle;" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="javascript://" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" style="vertical-align: middle;" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="javascript://" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" style="vertical-align: middle;" /></a><!-- ENDIF --></span><br /><div style="padding: 3px; font-size:12px;">{mchatrow.MCHAT_MESSAGE}</div></div>
<!-- END mchatrow -->
Code: Select all
<!-- BEGIN mchatrow -->
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover"><span class="chat_profile"><!-- IF USER_AVATAR -->{mchatrow.MCHAT_USER_AVATAR} <!-- ENDIF --><br />{mchatrow.MCHAT_USERNAME_FULL}<!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --> <a href="javascript://" onclick="insert_text('[b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);">|<b style="color: {mchatrow.MCHAT_USERNAME_COLOR}">X</b>|</a><!-- ELSE --> <a href="javascript://" onclick="insert_text('[b]{mchatrow.MCHAT_USERNAME}[/b], ', false);">|<b>X</b>|</a><!-- ENDIF --><!-- ELSE --> <a href="javascript://" onclick="insert_text('{mchatrow.MCHAT_USERNAME}, ', false);">|X|</a><!-- ENDIF --><!-- ENDIF --> <br /> {mchatrow.MCHAT_TIME}</span><span style="float:right;"><!-- IF MCHAT_ALLOW_IP --><b>{L_MCHAT_IP}</b> <a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{mchatrow.MCHAT_USER_IP}</a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{ROOT_PATH}mchat/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" style="vertical-align: middle;" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="javascript://" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" style="vertical-align: middle;" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="javascript://" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" style="vertical-align: middle;" /></a><!-- ENDIF --></span><br /><div style="padding: 3px;font-size:12px;">{mchatrow.MCHAT_MESSAGE}</div></div>
<!-- END mchatrow -->
Open styles/subsilver2/template/mchat_body.html
find:
Code: Select all
<!-- BEGIN mchatrow -->
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover"><span style="float:left;">{mchatrow.MCHAT_USERNAME_FULL}<!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --> <a href="javascript://" onclick="insert_text('[b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);">|<b style="color: {mchatrow.MCHAT_USERNAME_COLOR}">X</b>|</a><!-- ELSE --> <a href="javascript://" onclick="insert_text('[b]{mchatrow.MCHAT_USERNAME}[/b], ', false);">|<b>X</b>|</a><!-- ENDIF --><!-- ELSE --> <a href="javascript://" onclick="insert_text('{mchatrow.MCHAT_USERNAME}, ', false);">|X|</a><!-- ENDIF --><!-- ENDIF --> - {mchatrow.MCHAT_TIME}</span><span style="float:right;"><!-- IF MCHAT_ALLOW_IP --><b>{L_MCHAT_IP}</b> <a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{mchatrow.MCHAT_USER_IP}</a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{ROOT_PATH}mchat/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" style="vertical-align: middle;" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="javascript://" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" style="vertical-align: middle;" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="javascript://" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" style="vertical-align: middle;" /></a><!-- ENDIF --></span><br /><div style="padding: 3px; font-size:12px;">{mchatrow.MCHAT_MESSAGE}</div></div>
<!-- END mchatrow -->
Code: Select all
<!-- BEGIN mchatrow -->
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover"><span class="chat_profile"><!-- IF USER_AVATAR -->{mchatrow.MCHAT_USER_AVATAR} <!-- ENDIF --><br />{mchatrow.MCHAT_USERNAME_FULL}<!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --> <a href="javascript://" onclick="insert_text('[b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);">|<b style="color: {mchatrow.MCHAT_USERNAME_COLOR}">X</b>|</a><!-- ELSE --> <a href="javascript://" onclick="insert_text('[b]{mchatrow.MCHAT_USERNAME}[/b], ', false);">|<b>X</b>|</a><!-- ENDIF --><!-- ELSE --> <a href="javascript://" onclick="insert_text('{mchatrow.MCHAT_USERNAME}, ', false);">|X|</a><!-- ENDIF --><!-- ENDIF --> <br /> {mchatrow.MCHAT_TIME}</span><span style="float:right;"><!-- IF MCHAT_ALLOW_IP --><b>{L_MCHAT_IP}</b> <a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{mchatrow.MCHAT_USER_IP}</a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{ROOT_PATH}mchat/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" style="vertical-align: middle;" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="javascript://" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" style="vertical-align: middle;" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="javascript://" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}mchat/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" style="vertical-align: middle;" /></a><!-- ENDIF --></span><br /><div style="padding: 3px;font-size:12px;">{mchatrow.MCHAT_MESSAGE}</div></div>
<!-- END mchatrow -->
pic: Who is chatting at the right side of the chat box,only works on the custom page.
[spoiler]Open styles/prosilver/template/mchat_body.html
find:
Code: Select all
<div class="postbody mChatBodyFix">
Code: Select all
<!-- IF MCHAT_CUSTOM_PAGE -->
<table width="100%" >
<tr>
<td>
<!-- ENDIF -->
Code: Select all
<div style="text-align:center;">{L_MCHAT_COPYRIGHT}</div>
Code: Select all
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_CUSTOM_PAGE_WHOIS -->
</td>
<td style="width: 20%; border-left: solid 1px black;padding:2px;" valign="top">
<h3>{L_WHO_IS_CHATTING}</h3>
<div id="mChatStats" style="display:block"><p>{MCHAT_TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})
<br />{MCHAT_LOGGED_IN_USER_LIST}</p></div>
<p><span id="mChatRefresh">{MCHAT_WHOIS_REFRESH_EXPLAIN}</span><span id="mChatRefreshN" style="display: none;">{L_WHO_IS_REFRESHING}</span>
<!-- IF LEGEND --><br /><em>{L_LEGEND}:<br /> {LEGEND}</em><!-- ENDIF --></p>
</td></tr></table>
<!-- ENDIF -->
Code: Select all
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_CUSTOM_PAGE_WHOIS -->
<h3>{L_WHO_IS_CHATTING}</h3>
<div id="mChatStats" style="display:block"><p>{MCHAT_TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN}) <br />{MCHAT_LOGGED_IN_USER_LIST}</p></div>
<p><span id="mChatRefresh">{MCHAT_WHOIS_REFRESH_EXPLAIN}</span><span id="mChatRefreshN" style="display: none;">{L_WHO_IS_REFRESHING}</span>
<!-- IF LEGEND --><br /><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></p>
<!-- ENDIF -->
pic: Subsilver2 later i have the html sorted but messed the if statements up so not displaying online ....
pic: Smilies in a scroll box handy if you have 100,s of smilies allowed on the posting page.
[spoiler]Open styles/prosilver/template/mchat_body.html
find:
Code: Select all
<!-- BEGIN mchatsmilerow -->
<a href="javascript://" onclick="insert_text('{mchatsmilerow.MCHAT_SMILE_CODE}', true);"><img src="{mchatsmilerow.MCHAT_SMILE_IMG}" width="{mchatsmilerow.MCHAT_SMILE_WIDTH}" height="{mchatsmilerow.MCHAT_SMILE_HEIGHT}" alt="{mchatsmilerow.MCHAT_SMILE_CODE}" title="{mchatsmilerow.MCHAT_SMILE_EMOTION}" /></a>
<!-- END mchatsmilerow -->
Code: Select all
<div style="width:100%; height:80px;border: solid 1px gray; overflow:auto;">
<!-- BEGIN mchatsmilerow -->
<a href="javascript://" onclick="insert_text('{mchatsmilerow.MCHAT_SMILE_CODE}', true);"><img src="{mchatsmilerow.MCHAT_SMILE_IMG}" width="{mchatsmilerow.MCHAT_SMILE_WIDTH}" height="{mchatsmilerow.MCHAT_SMILE_HEIGHT}" alt="{mchatsmilerow.MCHAT_SMILE_CODE}" title="{mchatsmilerow.MCHAT_SMILE_EMOTION}" /></a>
<!-- END mchatsmilerow -->
</div>
Open styles/subsilver2/template/mchat_body.html
find:
Code: Select all
<!-- BEGIN mchatsmilerow -->
<a href="javascript://" onclick="insert_text('{mchatsmilerow.MCHAT_SMILE_CODE}', true);"><img src="{mchatsmilerow.MCHAT_SMILE_IMG}" width="{mchatsmilerow.MCHAT_SMILE_WIDTH}" height="{mchatsmilerow.MCHAT_SMILE_HEIGHT}" alt="{mchatsmilerow.MCHAT_SMILE_CODE}" title="{mchatsmilerow.MCHAT_SMILE_EMOTION}" /></a>
<!-- END mchatsmilerow -->
Code: Select all
<div style="width:100%; height:80px;border: solid 1px gray; overflow:auto;">
<!-- BEGIN mchatsmilerow -->
<a href="javascript://" onclick="insert_text('{mchatsmilerow.MCHAT_SMILE_CODE}', true);"><img src="{mchatsmilerow.MCHAT_SMILE_IMG}" width="{mchatsmilerow.MCHAT_SMILE_WIDTH}" height="{mchatsmilerow.MCHAT_SMILE_HEIGHT}" alt="{mchatsmilerow.MCHAT_SMILE_CODE}" title="{mchatsmilerow.MCHAT_SMILE_EMOTION}" /></a>
<!-- END mchatsmilerow -->
</div>