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 duesmandella » 18 Jan 2011, 14:58

my smilies wont open in a new window :(
www.allsentra.com
you can see it right there
duesmandella    
Supporter
Supporter
 
Posts: 97
Joined: 27 Sep 2009, 11:22
Gender: Male
phpBB Knowledge: 2


Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby spaceace » 19 Jan 2011, 08:07

just to let everyone know that was helping duesmandella, the issue is resolved ;)
User avatar
spaceace
Supporter
Supporter
 
Posts: 264
Joined: 14 Feb 2008, 20:44
Location: Ontario, Canada
Gender: Male
phpBB Knowledge: 5

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby blkout » 29 Jan 2011, 09:22

Hey everyone. I want to add the smileys to my chat box...I want to make absolutely sure I'm doing it right before I get started first.

I'm using acid tech red for a style, it's a subsilver based template.

Here are a few questions I have for now.

1. Does this change the database at all?
2. Is this a simple copy and paste/replacement of original chat code?

This is a really cool mod and I hope to get it going soon :)

Thanks!
blkout    
Crewman
Crewman
 
Posts: 1
Joined: 19 Dec 2009, 12:09
Gender: Male
phpBB Knowledge: 3

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby xtodaimand » 01 Feb 2011, 14:07

hello,

what can i do that the chatbody run under subsilver2?
it`s run but i have no the subsilver grafiks :-(

thanks.

p.s.: sorry for my broken english
xtodaimand
Crewman
Crewman
 
Posts: 1
Joined: 01 Feb 2011, 14:04
Gender: Male

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby spaceace » 01 Feb 2011, 16:57

xtodaimand wrote:hello,

what can i do that the chatbody run under subsilver2?
it`s run but i have no the subsilver grafiks :-(

thanks.

p.s.: sorry for my broken english


install the original version from here viewtopic.php?f=127&t=8675

this is only for prosilver based styles.
User avatar
spaceace
Supporter
Supporter
 
Posts: 264
Joined: 14 Feb 2008, 20:44
Location: Ontario, Canada
Gender: Male
phpBB Knowledge: 5

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby duesmandella » 01 Feb 2011, 18:24

spaceace wrote:just to let everyone know that was helping duesmandella, the issue is resolved ;)


Yes thank you to spaceace for noticing i was completely missing some code in the overall header
duesmandella    
Supporter
Supporter
 
Posts: 97
Joined: 27 Sep 2009, 11:22
Gender: Male
phpBB Knowledge: 2

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby Amylittlehands » 09 Aug 2011, 17:21

For some reason the sound add-on doesn't work, I replaced the files with the ones from the folder, added the sound files and purged cache/styles. No luck?

www.mouldingminefield.com
Forum Information:
PHPBB - 3.0.10
URL - http://www.mouldingminefield.com
Theme - Commun [Modified]
Template - Prosilver
User avatar
Amylittlehands    
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 181
Joined: 06 Aug 2008, 20:16
Location: Cardiff, UK
Gender: Female
phpBB Knowledge: 4

Re: AJAX Chat 2.0 Beta bbcodes and smilies

Postby Portugas » 31 Aug 2012, 11:37

Hi, my problem is no solved.

my smilies work fine, but the BBCodes, NOT WORKing...... no have solution?

My chat.php:

Spoiler:
Code: Select all
<?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);

include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

include($phpbb_root_path . 'includes/functions_display.' . $phpEx);





// Start session management

$user->session_begin();

$auth->acl($user->data);

$user->setup('chat');

$user->add_lang('posting');



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,

   'idle'      => 300,

   'offline'   => 1800,

);

//set delay for each status

$delay = array(

   'online'   => 5,

   'idle'      => 60,

   'offline'   => 300,

);

/*****************************************/

/* 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, 75);

      $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, 75);

      $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, 75);

      $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 'smilies':

       if (!$auth->acl_get('u_as_smilies'))

       {

           as_error($user->lang['NO_SMILIE_PERM']);

      }



      $sql = 'SELECT *

         FROM ' . SMILIES_TABLE .

            ' WHERE display_on_posting = 1

         ORDER BY smiley_order';

      $result = $db->sql_query($sql);

      if ($result)

      {

         $num_smilies = 0;

         $rowset = array();

         $last_url = '';

         

         while ($row = $db->sql_fetchrow($result))

         {

            if ($row['smiley_url'] !== $last_url)

            {

               echo "<smilies>\n

                  <code>" . xml($row['code']) . "</code>\n

                  <img>" . xml($phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url']) . "</img>\n

                  <alt>" . xml($row['emotion']) . "</alt>\n

                  </smilies>";

            }

            $last_url = $row['smiley_url'];

         }

         echo '</xml>';

         exit;

      }   

      else

      {

         as_sql_error($sql, __LINE__, __FILE__);

      }

   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;

}



   //Get the status of the following features

   $bbcode_status   = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false;

   $smilies_status   = ($config['allow_smilies'] && $config['auth_smilies_pm'] && $auth->acl_get('u_pm_smilies')) ? true : false;

   $img_status      = ($config['auth_img_pm'] && $auth->acl_get('u_pm_img')) ? true : false;

   $flash_status   = ($config['auth_flash_pm'] && $auth->acl_get('u_pm_flash')) ? true : false;

   $url_status      = ($config['allow_post_links']) ? true : false;



   // Generate smiley listing

   generate_smilies('inline', 0);



   //Assign the features template variable

   $template->assign_vars(array(

      'BBCODE_STATUS'         => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),

      'IMG_STATUS'         => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],

      'FLASH_STATUS'         => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],

      'SMILIES_STATUS'      => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],

      'URL_STATUS'         => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],            

      'S_COMPOSE_PM'         => true,

      'S_BBCODE_ALLOWED'      => $bbcode_status,

      'S_SMILIES_ALLOWED'      => $smilies_status,

      'S_BBCODE_IMG'         => $img_status,

      'S_BBCODE_FLASH'      => $flash_status,

      'S_BBCODE_QUOTE'      => false,

      'S_BBCODE_URL'         => $url_status,

   ));



   // Build custom bbcodes array

   display_custom_bbcodes();



$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;

}

?>


My chat_body.html:

Spoiler:
Code: Select all
<!-- IF S_GET_CHAT -->
<!-- IF S_READ or S_ADD -->
<!-- BEGIN chatrow -->

<div id="p{chatrow.MESSAGE_ID}" class="post bg{chatrow.CLASS}">
  <div class="inner"><span class="corners-top"><span></span></span>
   <div class="postbody">
    <div class="content">{chatrow.MESSAGE}</div>
   </div>
     <dl class="postprofile" id="profile{postrow.POST_ID}">
       <p class="author">&nbsp;{chatrow.USERNAME_FULL}&nbsp;-&nbsp;{chatrow.TIME} </p>
     </dl>

<!-- IF U_ACP or U_MCP -->
     <a href="javascript:delete_post('{chatrow.MESSAGE_ID}')" title="{L_DELETE_POST}"><input type="image" src="http://eliteportugas.com/images/close.gif"></a>
<!-- <a href="javascript:void({chatrow.MESSAGE_ID})" title="{L_DELETE_POST}" onClick="delete_post('{chatrow.MESSAGE_ID}')"><span>{L_DELETE_POST}</span></a>
     <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 -->
<span class="corners-bottom"><span></span></span>
  </div>
</div>
<!-- END chatrow -->---{LAST_ID}
<!-- IF S_WHOISONLINE -->---
<!-- BEGIN whoisrow -->
<div>
<div class="inner">
<div class="user"><img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> : {whoisrow.USERNAME_FULL}</div>
</div>
</div>
<!-- END whoisrow -->---{LAST_TIME}---{DELAY}---{LAST_POST}
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ELSE -->
<!-- IF S_CHAT -->
<!-- INCLUDE overall_header.html -->
<!-- ENDIF -->
<script type="text/javascript">
// <![CDATA[
var form_name = 'postform';
var text_name = 'message';
// ]]>
<!--
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.postform.message.value != '')
{
type = 'send';
for(var i = 0; i < f.elements.length; i++)
{
elem = f.elements[i];
param += '&' + elem.name + '=' + encodeURIComponent(elem.value);
}
document.postform.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.';
}
}
function addText(instext)
{
var mess = document.getElementById('message');
//IE support
if (document.selection)
{
mess.focus();
sel = document.selection.createRange();
sel.text = instext;
document.message.focus();
}
//MOZILLA/NETSCAPE support
else if (mess.selectionStart || mess.selectionStart == "0")
{
var startPos = mess.selectionStart;
var endPos = mess.selectionEnd;
var chaine = mess.value;
mess.value = chaine.substring(0, startPos) + instext + chaine.substring(endPos, chaine.length);
mess.selectionStart = startPos + instext.length;
mess.selectionEnd = endPos + instext.length;
mess.focus();
}
else
{
mess.value += instext;
mess.focus();
}
}
-->
</script>
<style type="text/css">
<!--
#act_indicator {
visibility:hidden;
}
.shouts {
width: 85%;
height:200px;
overflow:auto;
float:left;
}
#chat {
width: 100%;
text-align:left;
}
#chat * {
margin:0px;
padding:0px;
min-height:0px;


}
.postprofile {
min-height: 5px !important;
}
.chatform {
width: 90%;
text-align:center;
}
.onlinelist {
width: 14.5%;
overflow:auto;
height:200px;
}
.users {
width: 90%;
text-align: left;
text-indent: 5px;
margin-left:auto;
margin-right:auto;
}
.user {
width: 95%;
font-size: 1.1em;
font-family:Verdana, Arial, Helvetica, sans-serif;
line-height: 1.4em;
}
#act_indicator {
visibility: hidden;
}
.chatinput {width: 80% !important;}
.online_img {
vertical-align:right;
}
-->
</style>

<div class="forabg">
    <div class="inner"><span class="corners-top"><span></span></span>
         <ul class="topiclist">
            <li class="header">
               <dl class="icon">
               <div style="text-align:center; color: white;"><h4><!-- IF not S_CHAT --><a href="{U_CHAT}">{SITENAME} {L_CHAT_EXPLAIN}</a><!-- ELSE -->{SITENAME} {L_CHAT_EXPLAIN}<!-- ENDIF --></h4></div>
         <br />
               </dl>
            </li>
         </ul>
         <ul class="topiclist forums">

   
               <div style="text-align: center">


<table width="100%" height="" cellpadding="0" cellspacing="4" border="0">
<tr><td align="center">

<!-- IF S_USER_LOGGED_IN -->

<div class="chatform" align="center">

<!-- INCLUDE posting_buttons_chat.html -->

<!-- IF S_SMILIES_ALLOWED and .smiley -->
<!-- BEGIN smiley -->
<!--  <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a> -->
<!-- END smiley -->
<!-- ENDIF -->

<!-- IF S_SMILIES_ALLOWED and .smiley -->
<a href="./posting.php?mode=smilies&amp;f=2" onclick="popup(this.href, 800, 220, '_phpbbsmilies'); return false;"><font color="#800000">View More Smileys</font></a>
<!-- ENDIF -->

<form name="postform" id="postform" method="post" action="javascript:void(0);" onsubmit="handle_send('add', this)" autocomplete="off">
<strong style="color: red;">{L_MESSAGE}:<!--*Feel free to join the chat.*--></strong> <input type="text" tabindex="1" name="message" id="message" class="inputbox chatinput" />
<input type="submit" class="button1" value="{L_SUBMIT}" name="submit" tabindex="6" accesskey="s"/><br />
</div>
</form>

<!-- ENDIF -->

<br />

<div class="shouts">
<div id="chat">
<!-- BEGIN chatrow -->
<div id="p{chatrow.MESSAGE_ID}" class="post bg{chatrow.CLASS}">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="postbody">
<div class="content">{chatrow.MESSAGE}</div>
</div>
<dl class="postprofile" id="profile{postrow.POST_ID}">
<p class="author">&nbsp;{chatrow.USERNAME_FULL}&nbsp;-&nbsp;{chatrow.TIME} </p>
</dl>
<!-- IF U_ACP or U_MCP -->
<!-- <ul class="profile-icons postprofile">
<li class="delete-icon"><a href="javascript:void({chatrow.MESSAGE_ID})" title="{L_DELETE_POST}" onclick="delete_post('{chatrow.MESSAGE_ID}')"></a>
</li>
</ul>
<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> -->
<a href="javascript:delete_post('{chatrow.MESSAGE_ID}')" title="{L_DELETE_POST}"><input type="image" src="http://eliteportugas.com/images/close.gif"></a>

<!-- ENDIF -->
<span class="corners-bottom"><span></span></span>
</div>
</div>
<!-- END chatrow -->
</div>
</div>
<div class="onlinelist bg1">
<div class="users" id="whois_online">
<!-- BEGIN whoisrow -->
<div>
<div class="inner">
<div class="user"><img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> {whoisrow.USERNAME_FULL}</div>
</div>
</div>
<!-- END whoisrow -->
</div>
</div>

</td></tr></table>
              </div>
         </ul>
         <span class="corners-bottom"><span></span></span>
    </div>
</div>

<!-- <div class="forabg" align="center">
<div class="inner">
<span class="corners-top"><span></span></span>
<div class="post">
<div id="author">{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>
</div>
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div> -->
<br />
<!-- IF S_CHAT -->
<!-- INCLUDE overall_footer.html -->
<!-- ENDIF -->
<!-- ENDIF -->


My shout.php:

Spoiler:
Code: Select all
<?php

/**

*

* @package phpBB3

* @version $Id: shout.php 52 2007-11-04 05:56:17Z Handyman $

* @copyright (c) 2006 StarTrekGuide Group

* @license http://opensource.org/licenses/gpl-license.php GNU Public License

*

*/



/**

* @ignore

*/

if (!defined('IN_PHPBB'))

{

   exit;

}



include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

$user->add_lang('posting');



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,

   'idle'      => 300,

   'offline'   => 1800,

);

//set delay for each status

$delay = array(

   'online'   => 5,

   'idle'      => 60,

   'offline'   => 300,

);

/*****************************************/

/* DO NOT EDIT ANYTHING BELOW THIS LINE */

/***************************************/

$user->add_lang('chat');

$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, 75);

      $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_lastupdate'   => time(),

               'user_login'      => 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(),

      ));

   break;

}



//Get the status of the following features

   $bbcode_status   = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false;

   $smilies_status   = ($config['allow_smilies'] && $config['auth_smilies_pm'] && $auth->acl_get('u_pm_smilies')) ? true : false;

   $img_status      = ($config['auth_img_pm'] && $auth->acl_get('u_pm_img')) ? true : false;

   $flash_status   = ($config['auth_flash_pm'] && $auth->acl_get('u_pm_flash')) ? true : false;

   $url_status      = ($config['allow_post_links']) ? true : false;



   // Generate smiley listing

   generate_smilies('inline', 0);



   //Assign the features template variable

   $template->assign_vars(array(

      'BBCODE_STATUS'         => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),

      'IMG_STATUS'         => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],

      'FLASH_STATUS'         => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],

      'SMILIES_STATUS'      => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],

      'URL_STATUS'         => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],            

      'S_COMPOSE_PM'         => true,

      'S_BBCODE_ALLOWED'      => $bbcode_status,

      'S_SMILIES_ALLOWED'      => $smilies_status,

      'S_BBCODE_IMG'         => $img_status,

      'S_BBCODE_FLASH'      => $flash_status,

      'S_BBCODE_QUOTE'      => false,

      'S_BBCODE_URL'         => $url_status,

   ));



   // Build custom bbcodes array

   display_custom_bbcodes();



$mode = strtoupper($mode);

$template->assign_vars(array(

   'FILENAME'      => append_sid("{$phpbb_root_path}chat.$phpEx"),

   'LAST_ID'      => $last_id,

   'S_' . $mode   => true,

));



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']}";

   $result = $db->sql_query($sql);



   $sql = 'DELETE FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_lastupdate < $check_time";

   $db->sql_query($sql);

   

   $status_time = false;

   $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,

      ));

      $user_ary[] = $row['user_id'];

   }

   $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;

}

?>


My posting_buttons_chat.html:

Spoiler:
Code: Select all

<script type="text/javascript">
// <![CDATA[
   var form_name = 'postform';
   var text_name = <!-- IF $SIG_EDIT -->'signature'<!-- ELSE -->'message'<!-- ENDIF -->;
   var load_draft = false;
   var upload = false;

   // 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}',
      a: '{LA_BBCODE_A_HELP}',
      s: '{LA_BBCODE_S_HELP}',
      f: '{LA_BBCODE_F_HELP}',
      e: '{LA_BBCODE_E_HELP}',
      d: '{LA_BBCODE_D_HELP}'
      <!-- BEGIN custom_tags -->
         ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
      <!-- END custom_tags -->
   }

   var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
   var show_panel = 'options-panel';


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

<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
   <dl style="clear: left;">
      <dt><label>{L_FONT_COLOR}:</label></dt>
      <dd>
      <script type="text/javascript">
      // <![CDATA[
         function change_palette()
         {
            dE('colour_palette');
            e = document.getElementById('colour_palette');
            
            if (e.style.display == 'block')
            {
               document.getElementById('bbpalette').value = '{LA_FONT_COLOR_HIDE}';
            }
            else
            {
               document.getElementById('bbpalette').value = '{LA_FONT_COLOR}';
            }
         }

         colorPalette('h', 15, 10);
      // ]]>
      </script>
      </dd>
   </dl>
</div>

<div id="format-buttons">
   <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
   <input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
   <input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}" />
   <!-- IF S_BBCODE_QUOTE -->
      <input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" title="{L_BBCODE_Q_HELP}" />
   <!-- ENDIF -->
   <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}" />
   <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}" />
   <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}" />
   <input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
   <!-- IF S_BBCODE_IMG -->
      <input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
   <!-- ENDIF -->
   <!-- IF S_LINKS_ALLOWED -->
      <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" title="{L_BBCODE_W_HELP}" />
   <!-- ENDIF -->
   <!-- IF S_BBCODE_FLASH -->
      <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" title="{L_BBCODE_D_HELP}" />
   <!-- ENDIF -->
   <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
      <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>
   <input type="button" class="button2" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
   <!-- BEGIN custom_tags -->
      <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
   <!-- END custom_tags -->
</div>
<!-- ENDIF -->


Who is BAD... ideas?????

Best Regards
User avatar
Portugas    
Cadet I
Cadet I
 
Posts: 16
Joined: 07 Dec 2007, 15:44
Favorite Team: Benfica
Gender: Male

Previous

Return to Miscellaneous MODs, Hacks and Downloads

Who is online

Users browsing this forum: No registered users and 1 guest