AJAX Chat 2.0 Beta bbcodes and smilies

Misc MOD Downloads for phpBB3 -- Any MOD that does not fit into any other category
Forum rules
Image Please feel free to download any MOD's here, support for each MOD is located it's own thread.

To post your own MOD, please first read the MOD Guidelines

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby primetime33 » 28 Nov 2008, 20:37

Are you using IE or Firefox?.. I have found that the bbcodes in the chat box do not work well in IE.
primetime33
Ensign
Ensign
 
Posts: 70
Joined: 17 Nov 2008, 15:48
Gender: Male
phpBB Knowledge: 4




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby Mercure » 28 Nov 2008, 20:47

i have tryed the chat box with different browser ie7 firefox opera ..etc but nothing , but when i use the code for prosilver that work correctly , the problem is to make modification in the code to make it work on subsilver based theme
thank's
Mercure
Crewman
Crewman
 
Posts: 3
Joined: 28 Nov 2008, 11:14
Gender: Male
phpBB Knowledge: 5

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby primetime33 » 30 Nov 2008, 11:14

I would like to add "font Color" bbcodes to my X-Treme style chat box. Also the font colors choices need to be "hidden" until the bbcode is selected. Is this possible?

My Chat_posting_buttons.html

Spoiler:
Code: Select all
<tr valign="middle" align="{S_CONTENT_FLOW_BEGIN}">
   <td align="center" class="cat nav" width="85%">
      <script type="text/javascript">
      // <![CDATA[
      
      // Define the bbCode tags
      var bbcode = new Array();
      var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
      var imageTag = false;
      
      // Helpline messages
      var help_line = {
         b: '{LA_BBCODE_B_HELP}',
         i: '{LA_BBCODE_I_HELP}',
         u: '{LA_BBCODE_U_HELP}',
         q: '{LA_BBCODE_Q_HELP}',
         c: '{LA_BBCODE_C_HELP}',
         l: '{LA_BBCODE_L_HELP}',
         o: '{LA_BBCODE_O_HELP}',
         p: '{LA_BBCODE_P_HELP}',
         w: '{LA_BBCODE_W_HELP}',
         s: '{LA_BBCODE_S_HELP}',
         f: '{LA_BBCODE_F_HELP}',
         e: '{LA_BBCODE_E_HELP}',
         d: '{LA_BBCODE_D_HELP}',
         t: '{LA_BBCODE_T_HELP}',
         tip: '{L_STYLES_TIP}'
         <!-- BEGIN custom_tags -->
            ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
         <!-- END custom_tags -->
      }

      // ]]>
      </script>
      <script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>

<!-- IF S_BBCODE_ALLOWED -->
      <input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
      <!-- IF S_BBCODE_QUOTE -->
         <input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
      <!-- ENDIF -->
      <input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />   
      <!-- IF S_BBCODE_IMG -->
         <input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
      <!-- ENDIF -->
      <!-- IF S_LINKS_ALLOWED -->
         <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
      <!-- ENDIF -->
      <!-- BEGIN custom_tags -->
         <input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
      <!-- END custom_tags -->
      <span class="genmed nowrap">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')">
         <option value="50">{L_FONT_TINY}</option>
         <option value="85">{L_FONT_SMALL}</option>
         <option value="100" selected="selected">{L_FONT_NORMAL}</option>
         <option value="150">{L_FONT_LARGE}</option>
         <option value="200">{L_FONT_HUGE}</option>
      </select></span>
<!-- ENDIF -->
   </td>
<td align="center" class="cat nav" width="15%">
<a class="nav" href="{U_MORE_SMILIES}" onclick="popup(this.href, 400, 400, '_phpbbsmilies'); return false;">Smilies</a>
</tr>
<!-- IF S_BBCODE_ALLOWED and .custom_tags -->
<!-- ENDIF -->
primetime33
Ensign
Ensign
 
Posts: 70
Joined: 17 Nov 2008, 15:48
Gender: Male
phpBB Knowledge: 4

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby silent_thunder » 16 Dec 2008, 23:30

Hey guys I had installed the mod works well but it would be nice if I had a shoutbox and chat with bbcodes and smilies.

here is how my chat looks now

Image

I tried some of the tips here nothing worked for me I am using a subsilver based style.I can some add a smiley button to the chat??

here is the chat.php
Spoiler:
<?php
/**
*
* @package phpBB3
* @version $Id: chat.php 52 2007-11-04 05:56:17Z Handyman $
* @copyright (c) 2007 StarTrekGuide
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('chat');

define('CHAT_TABLE', $table_prefix . 'chat');
define('CHAT_SESSIONS_TABLE', $table_prefix . 'chat_sessions');

/******************************************/
/******************************************/
/* EDIT these for custom online settings */
/****************************************/
$session_time = 300;
$default_delay = 15;
//set status
$times = array(
'online' => 0, // when you join the chat, delay to appear "online" (green)
'idle' => 300, // delay (since your last post) to appear "idle" (orange)
'offline' => 1800, // delay (sine your last post) to appear "offline" (red)
);
//set delay for each status
$delay = array(
'online' => 10, // when your status is "online", delay to refresh the page
'idle' => 60, // when your status is "idle", delay to refresh the page
'offline' => 300, // when your status is "offline", delay to refresh the page
);
/*****************************************/
/* DO NOT EDIT ANYTHING BELOW THIS LINE */
/***************************************/

$mode = request_var('mode', '');
$last_id = request_var('last_id', 0);
$last_post = request_var('last_post', 0);
$last_time = request_var('last_time', 0);
$get = $init = false;
$count = 0;

switch ($mode)
{
default:
$sql = 'SELECT * FROM ' . CHAT_TABLE . ' ORDER BY message_id DESC';
$result = $db->sql_query_limit($sql, 25);
$rows = $db->sql_fetchrowset($result);

foreach ($rows as $row)
{
if ($count++ == 0)
{
$last_id = $row['message_id'];
}
$template->assign_block_vars('chatrow', array(
'MESSAGE_ID' => $row['message_id'],
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
'TIME' => $user->format_date($row['time']),
'CLASS' => ($row['message_id'] % 2) ? 1 : 2,
));
}
$db->sql_freeresult($result);

if ($user->data['user_type'] == USER_FOUNDER || $user->data['user_type'] == USER_NORMAL)
{
$sql = 'SELECT * FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_id = {$user->data['user_id']}";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

if ($row['user_id'] != $user->data['user_id'])
{
$sql_ary = array(
'user_id' => $user->data['user_id'],
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_login' => time(),
'user_lastupdate' => time(),
);
$sql = 'INSERT INTO ' . CHAT_SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
}
else
{
$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_login' => time(),
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
$db->sql_query($sql);
}
}
whois_online();
$template->assign_vars(array(
'TIME' => time(),
'DELAY' => $default_delay,
));
break;
case 'read':
$sql = 'SELECT * FROM ' . CHAT_TABLE . " WHERE message_id > $last_id ORDER BY message_id DESC";
$result = $db->sql_query_limit($sql, 25);
$rows = $db->sql_fetchrowset($result);

if (!sizeof($rows) && ((time() - 60) < $last_time))
{
exit;
}
foreach ($rows as $row)
{
if ($count++ == 0)
{
$last_id = $row['message_id'];
}
$template->assign_block_vars('chatrow', array(
'MESSAGE_ID' => $row['message_id'],
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
'TIME' => $user->format_date($row['time']),
'CLASS' => ($row['message_id'] % 2) ? 1 : 2,
));
}
$db->sql_freeresult($result);
if ((time() - 60) > $last_time)
{
whois_online();
$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE user_id = {$user->data['user_id']}";
$result = $db->sql_query($sql);
}
$get = true;
break;
case 'add':
if (!$user->data['is_registered'] || $user->data['user_type'] == USER_INACTIVE || $user->data['user_type'] == USER_IGNORE)
{
redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'));
}

$get = true;
$read_interval = request_var('read_interval', 0);
$message = utf8_normalize_nfc(request_var('message', '', true));

if (!$message)
{
break;
}
$message = str_replace('---', '- -', $message);
$uid = $bitfield = $options = '';
$allow_bbcode = $allow_urls = $allow_smilies = true;
generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);

$sql_ary = array(
'chat_id' => 1,
'user_id' => $user->data['user_id'],
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'message' => $message,
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'bbcode_options' => $options,
'time' => time(),
);
$sql = 'INSERT INTO ' . CHAT_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);

$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_lastpost' => time(),
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
$result = $db->sql_query($sql);


$sql = 'SELECT * FROM ' . CHAT_TABLE . " WHERE message_id > $last_id ORDER BY message_id DESC";
$result = $db->sql_query_limit($sql, 25);
$rows = $db->sql_fetchrowset($result);

if (!sizeof($rows) && ((time() - 60) < $last_time))
{
exit;
}
foreach ($rows as $row)
{
if ($count++ == 0)
{
$last_id = $row['message_id'];
}
$template->assign_block_vars('chatrow', array(
'MESSAGE_ID' => $row['message_id'],
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
'TIME' => $user->format_date($row['time']),
'CLASS' => ($row['message_id'] % 2) ? 1 : 2,
));
}
$db->sql_freeresult($result);

if ($read_interval != $delay['online'])
{
whois_online();
}
break;
case 'delete':
$get = true;
$chat_id = request_var('chat_id', 0);

if (!$chat_id)
{
break;
}

if (!$auth->acl_get('a_') && !$auth->acl_get('m_'))
{
break;
}
$sql = 'DELETE FROM ' . CHAT_TABLE . " WHERE message_id = $chat_id";
$db->sql_query($sql);

break;
}

$mode = strtoupper($mode);
$template->assign_vars(array(
'FILENAME' => append_sid("{$phpbb_root_path}chat.$phpEx"),
'LAST_ID' => $last_id,
'S_CHAT' => (!$get) ? true : false,
'S_GET_CHAT' => ($get) ? true : false,
'S_' . $mode => true,
));
page_header($user->lang['PAGE_TITLE']);

$template->set_filenames(array(
'body' => 'chat_body.html')
);

page_footer();

function whois_online()
{
global $db, $template, $user;
global $delay, $last_post, $session_time;

$check_time = time() - $session_time;

$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
$db->sql_query($sql);

$sql = 'DELETE FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_lastupdate < $check_time";
$db->sql_query($sql);

$sql = 'SELECT *
FROM ' . CHAT_SESSIONS_TABLE . "
WHERE user_lastupdate > $check_time
ORDER BY username ASC";
$result = $db->sql_query($sql);

$status_time = time();
while ($row = $db->sql_fetchrow($result))
{
if ($row['user_id'] == $user->data['user_id'])
{
$last_post = $row['user_lastpost'];
$login_time = $row['user_login'];
$status_time = ($last_post > $login_time) ? $last_post : $login_time;
}
$status = get_status($row['user_lastpost']);
$template->assign_block_vars('whoisrow', array(
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'USER_STATUS' => $status,
));
}
$db->sql_freeresult($result);

$template->assign_vars(array(
'DELAY' => ($status_time) ? $delay[get_status($status_time)] : $delay['idle'],
'LAST_TIME' => time(),
'S_WHOISONLINE' => true,
));
return false;
}
function get_status($last)
{
global $times;

$status = 'online';
if ($last < (time() - $times['offline']))
{
$status = 'offline';
}
else if ($last < (time() - $times['idle']))
{
$status = 'idle';
}
return $status;
}
?>


and chat_body.html

Spoiler:
<!-- IF S_GET_CHAT -->
<!-- IF S_READ or S_ADD -->
<!-- BEGIN chatrow -->
<div id="p{chatrow.MESSAGE_ID}">
<table class="tablebg" cellpadding="6" cellspacing="0" width="100%">
<tr class="row{chatrow.CLASS}">
<td>
<!-- IF U_ACP or U_MCP --><a href="javascript:void({chatrow.MESSAGE_ID})" title="{L_DELETE_POST}" onclick="delete_post('{chatrow.MESSAGE_ID}')"><img src="{T_IMAGESET_LANG_PATH}/icon_post_delete.gif" /></a> <!-- ENDIF -->
<b class="postauthor">{chatrow.USERNAME_FULL}</b> « {chatrow.TIME} » &nbsp; <span class="postbody">{chatrow.MESSAGE}</span>
</td>
</tr>

</table>
</div>
<!-- END chatrow -->---{LAST_ID}
<!-- IF S_WHOISONLINE -->---
<!-- BEGIN whoisrow -->
<div><img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> {whoisrow.USERNAME_FULL}</div>
<!-- END whoisrow -->---{LAST_TIME}---{DELAY}---{LAST_POST}
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ELSE -->
<!-- IF S_CHAT -->
<!-- INCLUDE overall_header.html -->
<!-- ENDIF -->
<script type="text/javascript">
<!--
var fieldname = 'chat';
var last_time = 0;
var xmlHttp = http_object();
var last_id = {LAST_ID};
var type = 'receive';
var post_time = {TIME};
var read_interval = 15000;
var interval = setInterval('handle_send("read", last_id);', read_interval);

function handle_send(mode, f)
{
if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
{
indicator_switch('on');
type = 'receive';
param = 'mode=' + mode;
param += '&last_id=' + last_id;
param += '&last_time=' + last_time;
param += '&last_post=' + post_time;
param += '&read_interval=' + read_interval;

if (mode == 'add' && document.text.message.value != '')
{
type = 'send';
for(var i = 0; i < f.elements.length; i++)
{
elem = f.elements[i];
param += '&' + elem.name + '=' + encodeURIComponent(elem.value);
}
document.text.message.value = '';
}
else if (mode == 'delete')
{
type = 'delete';
param += '&chat_id=' + f;
}
xmlHttp.open("POST", '{FILENAME}', true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.onreadystatechange = handle_return;
xmlHttp.send(param);
}
}

function handle_return()
{
if (xmlHttp.readyState == 4)
{
if (type != 'delete')
{
results = xmlHttp.responseText.split('---');
if (results[1])
{
if (last_id == 0)
{
document.getElementById(fieldname).innerHTML = results[0];
}
else
{
document.getElementById(fieldname).innerHTML = results[0] + document.getElementById(fieldname).innerHTML;
}
last_id = results[1];
if (results[2])
{
document.getElementById('whois_online').innerHTML = results[2];
last_time = results[3];
if (results[4] != read_interval * 1000)
{
window.clearInterval(interval);
read_interval = results[4] * 1000;
interval = setInterval('handle_send("read", last_id);', read_interval);
document.getElementById('update_seconds').innerHTML = results[4];
}
post_time = results[5];
}
}
}
indicator_switch('off');
}
}

function delete_post(chatid)
{
document.getElementById('p' + chatid).style.display = 'none';
handle_send('delete', chatid);
}

function indicator_switch(mode)
{
if(document.getElementById("act_indicator"))
{
var img = document.getElementById("act_indicator");
if(img.style.visibility == "hidden" && mode == 'on')
{
img.style.visibility = "visible";
}
else if (mode == 'off')
{
img.style.visibility = "hidden"
}
}
}

function http_object()
{
if (window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
document.getElementById('p_status').innerHTML = 'Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.';
}
}
-->
</script>
<style type="text/css">
<!--
.box
{
width: 95%;
margin-left: auto;
margin-right: auto;
}
.shouts {
width: 100%;
height:300px;
overflow:auto;
}
#chat {
width: 100%;
text-align:left;
}
#message {
width: 65%;
}
#whois_online{
vertical-align:text-top;
text-align:left;
}
.online_img {
vertical-align:middle;
}
#act_indicator {
visibility:hidden;
}
-->
</style>
<div class="box">
<table class="tablebg" cellspacing="1" width="100%">
<tr>
<th align="center" colspan="2">{SITENAME} {L_CHAT}</th>
</tr>
<!-- IF S_USER_LOGGED_IN -->
<tr>
<td align="center" class="cat nav" width="85%">
<form name="text" id="text" method="post" action="javascript:void(0);" onsubmit="handle_send('add', this)" autocomplete="off">{L_MESSAGE}:
<input type="text" tabindex="1" name="message" id="message" class="inputbox" size="28" />
<input class="button1" type="submit" name="submit" value="{L_SUBMIT}" />
</form>
</td>
<td align="center" class="cat nav" width="15%">{L_ONLINE_LIST}</td>
<!-- ENDIF -->
<tr>
<td class="row3" style="text-align:left;" height="220">
<div class="shouts">
<div id="chat">
<!-- BEGIN chatrow -->
<div id="p{chatrow.MESSAGE_ID}">
<table class="tablebg" cellpadding="6" cellspacing="0" width="100%">
<tr class="row{chatrow.CLASS}">
<td>
<!-- IF U_ACP or U_MCP -->
<a href="javascript:void({chatrow.MESSAGE_ID})" title="{L_DELETE_POST}" onclick="delete_post('{chatrow.MESSAGE_ID}')">
<img src="{T_IMAGESET_LANG_PATH}/icon_post_delete.gif" />
</a>
<!-- ENDIF -->
<b class="postauthor">{chatrow.USERNAME_FULL}</b> « {chatrow.TIME} » &nbsp; <span class="postbody">{chatrow.MESSAGE}</span>
</td>
</tr>

</table>
</div>
<!-- END chatrow -->
</div>
</div>
</td>
<td class="row1" nowrap="nowrap">
<div class="shouts">
<div id="whois_online">
<!-- BEGIN whoisrow -->
<div><img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> {whoisrow.USERNAME_FULL}</div>
<!-- END whoisrow -->
</div>
</div>
</td>
</tr>
<tr>
<td class="cat" colspan="2" align="center">
{L_DETAILS}
<img src="{T_IMAGESET_PATH}/act_indicator.gif" id="act_indicator" />
<strong>â?¢ {L_UPDATES} <span id="update_seconds">{DELAY}</span> {L_UNIT}</strong>
</td>
</tr>
</table>
</div>
<!-- IF S_CHAT -->
<!-- INCLUDE overall_footer.html -->
<!-- ENDIF -->
<!-- ENDIF -->
silent_thunder    
Cadet II
Cadet II
 
Posts: 24
Joined: 12 Aug 2008, 09:01
Gender: Male
phpBB Knowledge: 3

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby primetime33 » 23 Dec 2008, 00:54

silent_thunder wrote:Hey guys I had installed the mod works well but it would be nice if I had a shoutbox and chat with bbcodes and smilies.

here is how my chat looks now

Image

I tried some of the tips here nothing worked for me I am using a subsilver based style.I can some add a smiley button to the chat??

here is the chat.php
Spoiler:
<?php
/**
*
* @package phpBB3
* @version $Id: chat.php 52 2007-11-04 05:56:17Z Handyman $
* @copyright (c) 2007 StarTrekGuide
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('chat');

define('CHAT_TABLE', $table_prefix . 'chat');
define('CHAT_SESSIONS_TABLE', $table_prefix . 'chat_sessions');

/******************************************/
/******************************************/
/* EDIT these for custom online settings */
/****************************************/
$session_time = 300;
$default_delay = 15;
//set status
$times = array(
'online' => 0, // when you join the chat, delay to appear "online" (green)
'idle' => 300, // delay (since your last post) to appear "idle" (orange)
'offline' => 1800, // delay (sine your last post) to appear "offline" (red)
);
//set delay for each status
$delay = array(
'online' => 10, // when your status is "online", delay to refresh the page
'idle' => 60, // when your status is "idle", delay to refresh the page
'offline' => 300, // when your status is "offline", delay to refresh the page
);
/*****************************************/
/* DO NOT EDIT ANYTHING BELOW THIS LINE */
/***************************************/

$mode = request_var('mode', '');
$last_id = request_var('last_id', 0);
$last_post = request_var('last_post', 0);
$last_time = request_var('last_time', 0);
$get = $init = false;
$count = 0;

switch ($mode)
{
default:
$sql = 'SELECT * FROM ' . CHAT_TABLE . ' ORDER BY message_id DESC';
$result = $db->sql_query_limit($sql, 25);
$rows = $db->sql_fetchrowset($result);

foreach ($rows as $row)
{
if ($count++ == 0)
{
$last_id = $row['message_id'];
}
$template->assign_block_vars('chatrow', array(
'MESSAGE_ID' => $row['message_id'],
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
'TIME' => $user->format_date($row['time']),
'CLASS' => ($row['message_id'] % 2) ? 1 : 2,
));
}
$db->sql_freeresult($result);

if ($user->data['user_type'] == USER_FOUNDER || $user->data['user_type'] == USER_NORMAL)
{
$sql = 'SELECT * FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_id = {$user->data['user_id']}";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

if ($row['user_id'] != $user->data['user_id'])
{
$sql_ary = array(
'user_id' => $user->data['user_id'],
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_login' => time(),
'user_lastupdate' => time(),
);
$sql = 'INSERT INTO ' . CHAT_SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
}
else
{
$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_login' => time(),
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
$db->sql_query($sql);
}
}
whois_online();
$template->assign_vars(array(
'TIME' => time(),
'DELAY' => $default_delay,
));
break;
case 'read':
$sql = 'SELECT * FROM ' . CHAT_TABLE . " WHERE message_id > $last_id ORDER BY message_id DESC";
$result = $db->sql_query_limit($sql, 25);
$rows = $db->sql_fetchrowset($result);

if (!sizeof($rows) && ((time() - 60) < $last_time))
{
exit;
}
foreach ($rows as $row)
{
if ($count++ == 0)
{
$last_id = $row['message_id'];
}
$template->assign_block_vars('chatrow', array(
'MESSAGE_ID' => $row['message_id'],
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
'TIME' => $user->format_date($row['time']),
'CLASS' => ($row['message_id'] % 2) ? 1 : 2,
));
}
$db->sql_freeresult($result);
if ((time() - 60) > $last_time)
{
whois_online();
$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE user_id = {$user->data['user_id']}";
$result = $db->sql_query($sql);
}
$get = true;
break;
case 'add':
if (!$user->data['is_registered'] || $user->data['user_type'] == USER_INACTIVE || $user->data['user_type'] == USER_IGNORE)
{
redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'));
}

$get = true;
$read_interval = request_var('read_interval', 0);
$message = utf8_normalize_nfc(request_var('message', '', true));

if (!$message)
{
break;
}
$message = str_replace('---', '- -', $message);
$uid = $bitfield = $options = '';
$allow_bbcode = $allow_urls = $allow_smilies = true;
generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);

$sql_ary = array(
'chat_id' => 1,
'user_id' => $user->data['user_id'],
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'message' => $message,
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'bbcode_options' => $options,
'time' => time(),
);
$sql = 'INSERT INTO ' . CHAT_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);

$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_lastpost' => time(),
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
$result = $db->sql_query($sql);


$sql = 'SELECT * FROM ' . CHAT_TABLE . " WHERE message_id > $last_id ORDER BY message_id DESC";
$result = $db->sql_query_limit($sql, 25);
$rows = $db->sql_fetchrowset($result);

if (!sizeof($rows) && ((time() - 60) < $last_time))
{
exit;
}
foreach ($rows as $row)
{
if ($count++ == 0)
{
$last_id = $row['message_id'];
}
$template->assign_block_vars('chatrow', array(
'MESSAGE_ID' => $row['message_id'],
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
'TIME' => $user->format_date($row['time']),
'CLASS' => ($row['message_id'] % 2) ? 1 : 2,
));
}
$db->sql_freeresult($result);

if ($read_interval != $delay['online'])
{
whois_online();
}
break;
case 'delete':
$get = true;
$chat_id = request_var('chat_id', 0);

if (!$chat_id)
{
break;
}

if (!$auth->acl_get('a_') && !$auth->acl_get('m_'))
{
break;
}
$sql = 'DELETE FROM ' . CHAT_TABLE . " WHERE message_id = $chat_id";
$db->sql_query($sql);

break;
}

$mode = strtoupper($mode);
$template->assign_vars(array(
'FILENAME' => append_sid("{$phpbb_root_path}chat.$phpEx"),
'LAST_ID' => $last_id,
'S_CHAT' => (!$get) ? true : false,
'S_GET_CHAT' => ($get) ? true : false,
'S_' . $mode => true,
));
page_header($user->lang['PAGE_TITLE']);

$template->set_filenames(array(
'body' => 'chat_body.html')
);

page_footer();

function whois_online()
{
global $db, $template, $user;
global $delay, $last_post, $session_time;

$check_time = time() - $session_time;

$sql_ary = array(
'username' => $user->data['username'],
'user_colour' => $user->data['user_colour'],
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
$db->sql_query($sql);

$sql = 'DELETE FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_lastupdate < $check_time";
$db->sql_query($sql);

$sql = 'SELECT *
FROM ' . CHAT_SESSIONS_TABLE . "
WHERE user_lastupdate > $check_time
ORDER BY username ASC";
$result = $db->sql_query($sql);

$status_time = time();
while ($row = $db->sql_fetchrow($result))
{
if ($row['user_id'] == $user->data['user_id'])
{
$last_post = $row['user_lastpost'];
$login_time = $row['user_login'];
$status_time = ($last_post > $login_time) ? $last_post : $login_time;
}
$status = get_status($row['user_lastpost']);
$template->assign_block_vars('whoisrow', array(
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
'USER_STATUS' => $status,
));
}
$db->sql_freeresult($result);

$template->assign_vars(array(
'DELAY' => ($status_time) ? $delay[get_status($status_time)] : $delay['idle'],
'LAST_TIME' => time(),
'S_WHOISONLINE' => true,
));
return false;
}
function get_status($last)
{
global $times;

$status = 'online';
if ($last < (time() - $times['offline']))
{
$status = 'offline';
}
else if ($last < (time() - $times['idle']))
{
$status = 'idle';
}
return $status;
}
?>


and chat_body.html

Spoiler:
<!-- IF S_GET_CHAT -->
<!-- IF S_READ or S_ADD -->
<!-- BEGIN chatrow -->
<div id="p{chatrow.MESSAGE_ID}">
<table class="tablebg" cellpadding="6" cellspacing="0" width="100%">
<tr class="row{chatrow.CLASS}">
<td>
<!-- IF U_ACP or U_MCP --><a href="javascript:void({chatrow.MESSAGE_ID})" title="{L_DELETE_POST}" onclick="delete_post('{chatrow.MESSAGE_ID}')"><img src="{T_IMAGESET_LANG_PATH}/icon_post_delete.gif" /></a> <!-- ENDIF -->
<b class="postauthor">{chatrow.USERNAME_FULL}</b> « {chatrow.TIME} » &nbsp; <span class="postbody">{chatrow.MESSAGE}</span>
</td>
</tr>

</table>
</div>
<!-- END chatrow -->---{LAST_ID}
<!-- IF S_WHOISONLINE -->---
<!-- BEGIN whoisrow -->
<div><img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> {whoisrow.USERNAME_FULL}</div>
<!-- END whoisrow -->---{LAST_TIME}---{DELAY}---{LAST_POST}
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ELSE -->
<!-- IF S_CHAT -->
<!-- INCLUDE overall_header.html -->
<!-- ENDIF -->
<script type="text/javascript">
<!--
var fieldname = 'chat';
var last_time = 0;
var xmlHttp = http_object();
var last_id = {LAST_ID};
var type = 'receive';
var post_time = {TIME};
var read_interval = 15000;
var interval = setInterval('handle_send("read", last_id);', read_interval);

function handle_send(mode, f)
{
if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
{
indicator_switch('on');
type = 'receive';
param = 'mode=' + mode;
param += '&last_id=' + last_id;
param += '&last_time=' + last_time;
param += '&last_post=' + post_time;
param += '&read_interval=' + read_interval;

if (mode == 'add' && document.text.message.value != '')
{
type = 'send';
for(var i = 0; i < f.elements.length; i++)
{
elem = f.elements[i];
param += '&' + elem.name + '=' + encodeURIComponent(elem.value);
}
document.text.message.value = '';
}
else if (mode == 'delete')
{
type = 'delete';
param += '&chat_id=' + f;
}
xmlHttp.open("POST", '{FILENAME}', true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.onreadystatechange = handle_return;
xmlHttp.send(param);
}
}

function handle_return()
{
if (xmlHttp.readyState == 4)
{
if (type != 'delete')
{
results = xmlHttp.responseText.split('---');
if (results[1])
{
if (last_id == 0)
{
document.getElementById(fieldname).innerHTML = results[0];
}
else
{
document.getElementById(fieldname).innerHTML = results[0] + document.getElementById(fieldname).innerHTML;
}
last_id = results[1];
if (results[2])
{
document.getElementById('whois_online').innerHTML = results[2];
last_time = results[3];
if (results[4] != read_interval * 1000)
{
window.clearInterval(interval);
read_interval = results[4] * 1000;
interval = setInterval('handle_send("read", last_id);', read_interval);
document.getElementById('update_seconds').innerHTML = results[4];
}
post_time = results[5];
}
}
}
indicator_switch('off');
}
}

function delete_post(chatid)
{
document.getElementById('p' + chatid).style.display = 'none';
handle_send('delete', chatid);
}

function indicator_switch(mode)
{
if(document.getElementById("act_indicator"))
{
var img = document.getElementById("act_indicator");
if(img.style.visibility == "hidden" && mode == 'on')
{
img.style.visibility = "visible";
}
else if (mode == 'off')
{
img.style.visibility = "hidden"
}
}
}

function http_object()
{
if (window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
document.getElementById('p_status').innerHTML = 'Status: Cound not create XmlHttpRequest Object. Consider upgrading your browser.';
}
}
-->
</script>
<style type="text/css">
<!--
.box
{
width: 95%;
margin-left: auto;
margin-right: auto;
}
.shouts {
width: 100%;
height:300px;
overflow:auto;
}
#chat {
width: 100%;
text-align:left;
}
#message {
width: 65%;
}
#whois_online{
vertical-align:text-top;
text-align:left;
}
.online_img {
vertical-align:middle;
}
#act_indicator {
visibility:hidden;
}
-->
</style>
<div class="box">
<table class="tablebg" cellspacing="1" width="100%">
<tr>
<th align="center" colspan="2">{SITENAME} {L_CHAT}</th>
</tr>
<!-- IF S_USER_LOGGED_IN -->
<tr>
<td align="center" class="cat nav" width="85%">
<form name="text" id="text" method="post" action="javascript:void(0);" onsubmit="handle_send('add', this)" autocomplete="off">{L_MESSAGE}:
<input type="text" tabindex="1" name="message" id="message" class="inputbox" size="28" />
<input class="button1" type="submit" name="submit" value="{L_SUBMIT}" />
</form>
</td>
<td align="center" class="cat nav" width="15%">{L_ONLINE_LIST}</td>
<!-- ENDIF -->
<tr>
<td class="row3" style="text-align:left;" height="220">
<div class="shouts">
<div id="chat">
<!-- BEGIN chatrow -->
<div id="p{chatrow.MESSAGE_ID}">
<table class="tablebg" cellpadding="6" cellspacing="0" width="100%">
<tr class="row{chatrow.CLASS}">
<td>
<!-- IF U_ACP or U_MCP -->
<a href="javascript:void({chatrow.MESSAGE_ID})" title="{L_DELETE_POST}" onclick="delete_post('{chatrow.MESSAGE_ID}')">
<img src="{T_IMAGESET_LANG_PATH}/icon_post_delete.gif" />
</a>
<!-- ENDIF -->
<b class="postauthor">{chatrow.USERNAME_FULL}</b> « {chatrow.TIME} » &nbsp; <span class="postbody">{chatrow.MESSAGE}</span>
</td>
</tr>

</table>
</div>
<!-- END chatrow -->
</div>
</div>
</td>
<td class="row1" nowrap="nowrap">
<div class="shouts">
<div id="whois_online">
<!-- BEGIN whoisrow -->
<div><img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> {whoisrow.USERNAME_FULL}</div>
<!-- END whoisrow -->
</div>
</div>
</td>
</tr>
<tr>
<td class="cat" colspan="2" align="center">
{L_DETAILS}
<img src="{T_IMAGESET_PATH}/act_indicator.gif" id="act_indicator" />
<strong>â?¢ {L_UPDATES} <span id="update_seconds">{DELAY}</span> {L_UNIT}</strong>
</td>
</tr>
</table>
</div>
<!-- IF S_CHAT -->
<!-- INCLUDE overall_footer.html -->
<!-- ENDIF -->
<!-- ENDIF -->


I don't see the chat posting buttons in you chat body...

do the following maybe..

find the below line..
Code: Select all
<!-- IF S_USER_LOGGED_IN -->


place the following after the above line..
Code: Select all
<!-- INCLUDE chat_posting_buttons.html -->


to end up with this...
Spoiler:
Code: Select all
<!-- IF S_USER_LOGGED_IN -->
  <!-- INCLUDE chat_posting_buttons.html -->


You will need to upload the chat_posting_buttons.html to your styles/template directory, which should be part of the download in this forum.

Here is mine if you cant find the original.
Spoiler:
Code: Select all
<tr valign="middle" align="{S_CONTENT_FLOW_BEGIN}">
   <td align="center" class="cat nav" width="85%">
      <script type="text/javascript">
      // <![CDATA[
      
      // Define the bbCode tags
      var bbcode = new Array();
      var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
      var imageTag = false;
      
      // Helpline messages
      var help_line = {
         b: '{LA_BBCODE_B_HELP}',
         i: '{LA_BBCODE_I_HELP}',
         u: '{LA_BBCODE_U_HELP}',
         q: '{LA_BBCODE_Q_HELP}',
         c: '{LA_BBCODE_C_HELP}',
         l: '{LA_BBCODE_L_HELP}',
         o: '{LA_BBCODE_O_HELP}',
         p: '{LA_BBCODE_P_HELP}',
         w: '{LA_BBCODE_W_HELP}',
         s: '{LA_BBCODE_S_HELP}',
         f: '{LA_BBCODE_F_HELP}',
         e: '{LA_BBCODE_E_HELP}',
         d: '{LA_BBCODE_D_HELP}',
         t: '{LA_BBCODE_T_HELP}',
         tip: '{L_STYLES_TIP}'
         <!-- BEGIN custom_tags -->
            ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
         <!-- END custom_tags -->
      }

      // ]]>
      </script>
      <script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>

<!-- IF S_BBCODE_ALLOWED -->
      <input type="button" class="btnbbcode" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
      <!-- IF S_BBCODE_QUOTE -->
         <input type="button" class="btnbbcode" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
      <!-- ENDIF -->
      <input type="button" class="btnbbcode" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
      <input type="button" class="btnbbcode" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />            
      <!-- IF S_BBCODE_IMG -->
         <input type="button" class="btnbbcode" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
      <!-- ENDIF -->
      <!-- IF S_LINKS_ALLOWED -->
         <input type="button" class="btnbbcode" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
      <!-- ENDIF -->
      <!-- BEGIN custom_tags -->
         <input type="button" class="btnbbcode" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
      <!-- END custom_tags -->
      <span class="genmed nowrap">{L_FONT_SIZE}: <select class="gensmall" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')">
         <option value="50">{L_FONT_TINY}</option>
         <option value="85">{L_FONT_SMALL}</option>
         <option value="100" selected="selected">{L_FONT_NORMAL}</option>
         <option value="150">{L_FONT_LARGE}</option>
         <option value="200">{L_FONT_HUGE}</option>
      </select></span>
<!-- ENDIF -->
   </td>
<td align="center" class="cat nav" width="15%">
<a class="nav" href="{U_MORE_SMILIES}" onclick="popup(this.href, 400, 400, '_phpbbsmilies'); return false;">Smilies</a>
</tr>
<!-- IF S_BBCODE_ALLOWED and .custom_tags -->
<!-- ENDIF -->
primetime33
Ensign
Ensign
 
Posts: 70
Joined: 17 Nov 2008, 15:48
Gender: Male
phpBB Knowledge: 4

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby terryzx » 23 Dec 2008, 04:09

I finally got everything looking ok and I have my BBcodes and smiles link showing properly, but clicking a smile does nothing and the BBcodes can not be clicked at all.

I can add a smile code into the chat and it works, but the BBcodes do nothing but disappear.

Please give me an idea what to do to fix this

Thanx In Advance!!!
terryzx    
Supporter
Supporter
 
Posts: 164
Joined: 09 Aug 2008, 21:26
Gender: Male
phpBB Knowledge: 4

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby casperghost » 24 Dec 2008, 21:05

well i've installed the Ajax Chat 2.0.0B8 and i want to install smilies and BBCode buttons on there..

2 questions:

- in the 1st post of this thread i see 4 zipped files, wich one of them i must to download to include similies and buttons on the Chat Box??!!..

- i read all this thread and i think just 1 person have success to install smilies and buttons on Prosilver style, now i ask is it save to install this on the Chat Box or i gonna messe up all the Chat??!!.. (i've got my doubts about if this gonna work fine but who knows??!!)..
User avatar
casperghost
Cadet I
Cadet I
 
Posts: 16
Joined: 08 Sep 2008, 07:51
Location: Portugal
Gender: Male

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby popmart68 » 26 Dec 2008, 18:32

i once found this but i lost it again, :confused:
what is the code again for getting the enter button to work in the shoutbox, now people have to push the submit button ...................

tnx
danny
popmart68
Crewman
Crewman
 
Posts: 1
Joined: 30 Nov 2008, 00:45
Gender: Male

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby Cromosoma24 » 04 Jan 2009, 08:37

How can I do this?
http://img408.imageshack.us/img408/1319/linejw0.jpg

Smilies the right of the chat?

Tranks
Cromosoma24
Crewman
Crewman
 
Posts: 6
Joined: 20 Dec 2008, 15:02
Gender: Male

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby primetime33 » 12 Jan 2009, 09:53

Has anyone figured out how to get the bbcodes to work in IE? :banghead:
primetime33
Ensign
Ensign
 
Posts: 70
Joined: 17 Nov 2008, 15:48
Gender: Male
phpBB Knowledge: 4

PreviousNext

Return to Miscellaneous MODs, Hacks and Downloads

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 12 guests

cron