Hi,

i think this mod will improve your support area. I found this chat here and added it to my ticket system.

Screenshots:

Staff Control Panel:

Client Front End:

if you like it you can ask here and i´ll post the mod files.

I don’t have enough knowledge in javascript so if you can add more things to this chat i would love to share with all.

things I’d like to have:

  • Sound
  • Creating ticket from chat
  • Admin Area
  • Display picture

If  you have more ideas to add you are welcome to post them.

Download ChatMod

Front End:
open include/client/header.inc.php

Add this:

<!--start chat mod ozkr-->
<link type="text/css" rel="stylesheet" media="all" href="././scp/css/chat.css" />
<link type="text/css" rel="stylesheet" media="all" href="././scp/css/screen.css" />
<script type="text/javascript" src="./scp/js/jquery.js"></script>
<script type="text/javascript" src="./scp/js/chat.js"></script>
<!--end chat mod ozkr-->

open include/client/open.inc.php

Add this at the end:

<?php
if(isset($_SESSION['username'])){
$user = $_SESSION['username'];
echo "<div align='right'>Conectado al Chat como: $user</div>";
}
else {
echo "<div align='center'>Error al conectarte al Chat";
}
?>
<div>Staff Conectado:
<?php
$qry = mysql_query("SELECT username,lastlogin FROM ost_staff WHERE isactive=1 ORDER BY lastlogin DESC");
while($row = mysql_fetch_array($qry)) {
$staff=$row['username'];
$activity=strtotime($row['lastlogin']);
$currently=time();
if ($currently - $activity < 600){
$chat="<a href='javascript:void(0)' onClick='javascript:chatWith(\""  . htmlspecialchars($staff,ENT_QUOTES) ."\")'>" .  htmlspecialchars($staff,ENT_QUOTES) . ", </a>";
echo $chat;
}

}
?>
</div>

With this you can now see the chat mod in the front end.

Support Control Panel:
open include/staff/header.inc.php

Add this:

<!--start chat mod ozkr-->
<link type="text/css" rel="stylesheet" media="all" href="css/chat.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/screen.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/chat.js"></script>
<!--end chat mod ozkr-->

open include/staff/tickets.inc.php

find:

<?}?>
</td></tr>
<? }
} ?>
</form>

after that add:

<tr><td></td></tr>
<tr>
<th align="left">Chatea con tus compa&ntilde;eros conectados: (5 min)</th>
</tr>
<tr><td colspan="8">
<div style="width: auto; background-color: #efefef; border: 1px solid #ccc;margin: 0px 0 10px 0; padding: 10px;"><?
$qry = mysql_query("SELECT username,lastlogin FROM ost_staff WHERE isactive=1 ORDER BY lastlogin DESC");
while($row = mysql_fetch_array($qry)) {
$staff=$row['username'];
$activity=strtotime($row['lastlogin']);
$currently=time();
if ($currently - $activity < 300){
$chat="<a href='javascript:void(0)' onClick='javascript:chatWith(\""  . htmlspecialchars($staff,ENT_QUOTES) ."\")'>" .  htmlspecialchars($staff,ENT_QUOTES) . ", </a>";
echo $chat;
}

}
?>
</div>
<tr>
<th align="left">Lista de compa&ntilde;eros: (Mensajes Offline)</th>
</tr>
<tr><td colspan="8">
<div style="width: auto; background-color: #efefef; border: 1px solid #ccc;margin: 0px 0 10px 0; padding: 10px;">
<?php $_SESSION['username'] = $thisuser->getUsername();
$qry = mysql_query("SELECT username FROM ost_staff WHERE isactive=1");
while($row = mysql_fetch_array($qry)) {
$staff=$row['username'];
$chat="<a href='javascript:void(0)' onClick='javascript:chatWith(\""  . htmlspecialchars($staff,ENT_QUOTES) ."\")'>" .  htmlspecialchars($staff,ENT_QUOTES) . ", </a>";

echo $chat;
}
?>
</div>

thats it now you´re able to chat with your clients and and staff.

enjoy!