[Released] Handymans Chat with Sound and Archive

MODs and Styles for phpBB3.

To post your MOD or style, go to the STG MOD Manager
Forum rules
Go to http://startrekguide.com/mods to submit your MOD or style

Re: [Released] Handymans Chat with Sound and Archive

Postby IBurn36360 » 01 Nov 2010, 15:45

Ok, I have only a small issue with the sounds on this addon. I have combined the sound addon, and the bbcode/smileys addon. No action, either submitting a message, nor receiving an update of one, will trigger sound to play. I rechecked what uploaded to my host, and the sound is there, and intact. I have included both the chat_body, and the chat.php files.

Any help would be appreciated and the actual chat room can be found here.
login: STG
password: test00



chat.php
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, 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'   => clean_username(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('soundrow', array(
                'SOUND'   => '<div style="visibility: hidden; position: absolute;"><object data="sound.swf" type="application/x-shockwave-flash"><param name="movie" value="sound.swf" /></object></div>',
                ));
             }
         $template->assign_block_vars('chatrow', array(
            'MESSAGE_ID'   => $row['message_id'],
            'USERNAME_FULL'   => clean_username(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;
      }
      clean_message($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)
         {
                $template->assign_block_vars('soundrow', array(
                'SOUND'   => '<div style="visibility: hidden; position: absolute;"><object data="soundout.swf" type="application/x-shockwave-flash"><param name="movie" value="soundout.swf" /></object></div>',
                ));
             $last_id = $row['message_id'];
             }
         $template->assign_block_vars('chatrow', array(
            'MESSAGE_ID'   => $row['message_id'],
            'USERNAME_FULL'   => clean_username(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;
}


   //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,
  'ARCH_TITLE'  => $user->lang['ARCH_TITLE'],
  'ARCH_LABEL'  => $user->lang['ARCH_LABEL'],
));
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'   => clean_username(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;
}
function clean_message(&$message)
{
   if (strpos($message, '---') !== false)
   {
      $message = str_replace('---', '–––', $message);
      clean_message($message);
   }
}
function clean_username($user)
{
   if (strpos($user, '---') !== false)
   {
      $user = str_replace('---', '–––', $user);
      clean_username($user);
   }
   return $user;
}
?>


chat_body.html
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">
                  <p class="author">{chatrow.TIME} </p>
                  
                  <div class="chatcontent">{chatrow.MESSAGE}</div>
               </div>
               <dl class="postprofile" id="profile{postrow.POST_ID}">
                  <dt>{chatrow.USERNAME_FULL}</dt>
               </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}')"><span>{L_DELETE_POST}</span></a>
                        </li>
                     </ul>
                  <!-- ENDIF -->
               <span class="corners-bottom"><span></span></span>
            </div>
         </div>
      <!-- END chatrow -->---{LAST_ID}
      <!-- BEGIN soundrow -->{soundrow.SOUND}<!-- END soundrow -->
      <!-- IF S_WHOISONLINE -->---
         
            |
            <!-- BEGIN whoisrow -->
                  
                     <img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> {whoisrow.USERNAME_FULL} |
                     
               <!-- END whoisrow -->
         ---{LAST_TIME}---{DELAY}---{LAST_POST}
      <!-- ENDIF -->
   <!-- ENDIF -->
<!-- ELSE -->
<!-- IF S_USER_LOGGED_IN -->
   <!-- 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.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.';
      }
   }
   -->
   </script>
   <style type="text/css">
   <!--
      #act_indicator {
         visibility:hidden;
      }
      .shouts {
         width: 100%;
         height:600px;
         overflow:auto;
         float:left;
      }
      #chat {
         width: 100%;
         text-align:left;
         align:center;
      }
      .postprofile {
         min-height: 5px !important;
      }
      .chatform {
         width: 90%;
         text-align:center;
      }
      .onlinelist {
         width: 15%;
         overflow:auto;
         height:0px;
      }
      .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:middle;
      }
      .whoonlinelist {
         width: 100%;
         overflow:auto;
         height:auto;
         text-align:center;
      }
      .chatcontent {
         color: #FFFFFF;
         width: 100%;
         font-size: 1.3em;
      }
      ul .authorspace {
         width: 230px;
      }
      .postbody ul.profile-icons {
         float: right;
         width: 230;
         padding: 0;
      }
   -->
   
   </style>
   <!-- IF S_USER_LOGGED_IN -->
   <table align="center" text-align:center style="width:100%"><tr><td><strong><H4>Welcome to the public chat room, please socialize to your heart's content. Forum rules still apply.</H4><br><hr width:95% /></strong><br></td></tr></table>
   <table style="width: 100%"><tr>
      <td border="1" border-color="#FFFFFF" style="width:230px">
      
         <strong>Smileys!!!</strong><br><br>
         <!-- 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 -->
      
      </td>
      <td style="width:auto">
         <div class="forabg">
            <div class="inner">
               <span class="corners-top"><span></span></span>
               <div class="chatform" align="center">   
            
                  <!-- INCLUDE chat_posting_buttons.html -->   
               
            
                  <form name="postform" id="postform" method="post" action="javascript:void(0);" onsubmit="handle_send('add', this)" autocomplete="off">
                     <strong style="color: white;">{L_MESSAGE}:</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 />
                  </form>
               </div>
               <span class="corners-bottom"><span></span></span>
            </div>
         </div>
      </td>
   </tr></table>
   <!-- ENDIF -->
      <div class="forabg">
         <div class="inner">
            <span class="corners-top"><span></span></span>
            <div class="whoonlinelist bg1" id="whois_online">
                                 |
            <!-- BEGIN whoisrow -->
                  
               <img src="{T_IMAGESET_PATH}/{whoisrow.USER_STATUS}.png" class="online_img" /> {whoisrow.USERNAME_FULL} |
                     
            <!-- END whoisrow -->
            </div>
            
            <span class="corners-bottom"><span></span></span>
         </div>
      </div>
   <div class="forabg" align="left">
      <div class="inner">
         <span class="corners-top"><span></span></span>
         <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">
                           <p class="author">{chatrow.TIME} </p>
                           
                           <div class="chatcontent">{chatrow.MESSAGE}</div>
                        </div>
                        <dl class="postprofile" id="profile{postrow.POST_ID}">
                           <dt>{chatrow.USERNAME_FULL}</dt>
                        </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}')"><span>{L_DELETE_POST}</span></a>
                                 </li>
                              </ul>
                           <!-- ENDIF -->
                        <span class="corners-bottom"><span></span></span>
                     </div>
                  </div>
               <!-- END chatrow -->
            </div>
         </div>
      </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>
   <!-- IF S_CHAT -->
      <!-- INCLUDE overall_footer.html -->
   <!-- ENDIF -->
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF not S_USER_LOGGED_IN -->
<!-- INCLUDE overall_header.html -->
   <table style="width=100%"><tr><td>
      <div><strong style="text-color=#FF0000">You are not logged in, please <a href="{U_LOGIN_LOGOUT}">log in</a> or <a href="{U_REGISTER}">register</a> to continue.</strong></div>
   </td></tr></table>
<!-- INCLUDE overall_footer.html -->
<!-- ENDIF -->
Leader of Alls Requiem web development.

Capability, is humanities greatest strength, and it greatest flaw. We are capable of such good, and such evil. And yet it is in the run for the both of them, that evil is indeed winning. It grows and festers, and it holds the lives of many in its grotesque grip. The few who stay from it will eventually be tainted by its filth, but try as it might, a few will never turn.
-IBurn36360
User avatar
IBurn36360    
Lt. Jr Grade
Lt. Jr Grade
 
Posts: 167
Joined: 09 Aug 2010, 12:35
Favorite Team: AReq Game Battles Te
Gender: Male
phpBB Knowledge: 7




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: [Released] Handymans Chat with Sound and Archive

Postby King Rhyono » 04 Dec 2010, 18:57

The delete-icon isn't fully showing and on mouseover it doesn't flip to red. I have tried many things to fix it. Any ideas?
King Rhyono
MOD Author
MOD Author
 
Posts: 174
Joined: 01 Aug 2007, 11:20
Gender: Male

Re: [Released] Handymans Chat with Sound and Archive

Postby wads24 » 07 Feb 2012, 18:20

what if i just wanted to add the sound part of this script? I would liek a soudn to be played for every new post made...
User avatar
wads24
Supporter
Supporter
 
Posts: 83
Joined: 04 Jul 2007, 00:55
Gender: Male

Re: [Released] Handymans Chat with Sound and Archive

Postby Sniper_E » 07 Feb 2012, 19:37

Try this... I didn't test this... to get sound to work from the original chat files:
Open chat.php
Find - on/around line 128
Code: Select all
            $last_id = $row['message_id'];
After add
Code: Select all
                $template->assign_block_vars('soundrow', array(
                'SOUND'   => '<div style="visibility: hidden; position: absolute;"><object data="sound.swf" type="application/x-shockwave-flash"><param name="movie" value="sound.swf" /></object></div>',
                ));

Open shout.php
Find - on/around line 143
Code: Select all
   $status_time = time();
After add
Code: Select all
    $template->assign_block_vars('soundrow', array(
       'SOUND'   => '<object data="sound.swf" type="application/x-shockwave-flash" width="0" height="0"><param name="movie" value="sound.swf" /></object>',
    ));

Open styles/prosilver/template/chat_body.html
Find - on/around line 19
Code: Select all
      <!-- END chatrow -->--!--{LAST_ID}
Replace with
Code: Select all
      <!-- END chatrow -->--!--{LAST_ID}--!--
        <!-- BEGIN soundrow -->{soundrow.SOUND}<!-- END soundrow -->

Then place a sound.swf sound file in the root of your forum directory.
Upload your saved files and Refresh your templates.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6983
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [Released] Handymans Chat with Sound and Archive

Postby wads24 » 07 Feb 2012, 19:45

@Sniper_E Ed

Thanks for the change, but it didn't work. I tested the changes, and then when i posted in chat, then the online list disappeared... there was no one on the list then...

Any ideas?
User avatar
wads24
Supporter
Supporter
 
Posts: 83
Joined: 04 Jul 2007, 00:55
Gender: Male

Re: [Released] Handymans Chat with Sound and Archive

Postby Sniper_E » 07 Feb 2012, 19:55

Well, you do have the original chat installed, right?
And there are duplicate lines like you see in the Find - check those line numbers.
You did make the edits on the correct lines, right. I put the line numbers to look for.

Other than that I'd say take those edits out and let someone more qualified instruct you.
I pulled those instruction out of a chat that does work with sound.
Or download this version on the first post and see where nicholasalipaz placed these codes for sound.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6983
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [Released] Handymans Chat with Sound and Archive

Postby wads24 » 07 Feb 2012, 23:36

Sniper_E wrote:Well, you do have the original chat installed, right?
And there are duplicate lines like you see in the Find - check those line numbers.
You did make the edits on the correct lines, right. I put the line numbers to look for.

Other than that I'd say take those edits out and let someone more qualified instruct you.
I pulled those instruction out of a chat that does work with sound.
Or download this version on the first post and see where nicholasalipaz placed these codes for sound.


@Sniper_E,
Thanks so much for trying to help. I searched for multiple edits, but there was non, and yes I have the original AJAX Chat installed. Thanks for trying to help with that though. I appreciate it!
User avatar
wads24
Supporter
Supporter
 
Posts: 83
Joined: 04 Jul 2007, 00:55
Gender: Male

Re: [Released] Handymans Chat with Sound and Archive

Postby SamanthaS » 06 Sep 2012, 12:46

Ow pls be cool with me here Handyman. Look, I wish to add sound to my phpBB3 free forum. Link to my site's in my profile page here. Pls, help me out! Second to none would be to have sound added to the default chatbox in phpBB3! I wanna have sound whenever a user joins or leaves the chat or sends something. Pls, be aware, my knowledge of phpBB forums is almost zero here. I really need some guidance here! Thank you for your help!

Warm regards,
Samantha.
SamanthaS
Crewman
Crewman
 
Posts: 4
Joined: 06 Sep 2012, 06:19
Gender: Female
phpBB Knowledge: 3

Re: [Released] Handymans Chat with Sound and Archive

Postby wads24 » 08 Dec 2012, 21:49

So, I love this modification to Handymans Chat, but I have just a couple questions.
1. Would there be a way to format the messages this way below?
shoutbox.jpg


2. I noticed that if you refresh the page, the timestamp is a larger font, and then if you type in a message it time stamps it with a spammer font for the time.
User avatar
wads24
Supporter
Supporter
 
Posts: 83
Joined: 04 Jul 2007, 00:55
Gender: Male

Re: [Released] Handymans Chat with Sound and Archive

Postby Zohall » 08 Dec 2012, 22:10

how can change the sound?
User avatar
Zohall    
Lieutenant
Lieutenant
 
Posts: 201
Joined: 16 Aug 2010, 05:39
Location: Hecatompylos
Favorite Team: Real Madrid
Gender: Male
phpBB Knowledge: 6

PreviousNext

Return to phpBB3 Customizations

Who is online

Users browsing this forum: Bingbot and 14 guests