File size: 3.59Kb
<?php
/* ############################################################ *\
----------------------------------------------------------------
GUN GPL
----------------------------------------------------------------
\* ############################################################ */
function chatbar_header() {
global $client;
if ($client['id'] > 0 && !is_redirecting()) {
return '
<style>
.chat_bar {
background: url("'.uhome().'/modules/chatbar/chat_bg.gif") repeat-x;
}
.chat_bar_active {
background: #eeeeee;
}
#chat_bar {
z-index:9;
height:20px;
width:200px;
position:fixed;
border: #ccc 1px solid;
border-width: 1px 1px 0 1px;
bottom: 0;
right:60px;
text-align: left;
cursor: pointer;
}
#chat_bar_content {
padding-left: 20px;
height:14px;
font-weight: bold;
font-size: 11px;
padding-top:3px;
background: url("'.uhome().'/modules/chatbar/chat.gif") no-repeat;
background-position: 3px 1px;
width:170px;
}
#chat_list {
z-index:10;
height:auto;
width:200px;
background: #eeeeee;
border: #ccc 1px solid;
border-width: 1px 1px 0 1px;
position:fixed;
bottom: 19px;
right:60px;
display:none;
text-align: left;
overflow:hidden;
}
#chat_list_content {
overflow:hidden;
padding: 5px;
}
</style>
<script>
function show_chat_list() {
$("#chat_list").show();
$("#chat_friends_list").html("<img src=\''.uhome().'/files/loading.gif\' width=16 height=16 />");
$("#chat_friends_list").load("'.uhome().'/index.php?p=chatbar/chat_friends_list");
$("#chat_bar").removeClass("chat_bar");
$("#chat_bar").addClass("chat_bar_active");
}
function hide_chat_list() {
$("#chat_list").hide();
$("#chat_bar").removeClass("chat_bar_active");
$("#chat_bar").addClass("chat_bar");
}
function update_chat_bar() {
$("#chat_bar_content").load("'.uhome().'/index.php?p=chatbar/update_chat_bar");
}
function open_chatroom(uid) {
window.open("'.uhome().'/index.php?p=chat/chatroom/"+uid, "chatwith"+uid, config="height=400,width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no");
}
jQuery(document).ready(function($) {
$("#chat_bar").click(function() {
show_chat_list();
});
$(document).click(function(event) {
if ( !$(event.target).hasClass("chat_boxes")) {
hide_chat_list();
}
});
update_chat_bar();
setInterval(function() {
update_chat_bar();
}, 9000);
});
</script>
<link type="text/css" rel="stylesheet" media="all" href="'.uhome().'/modules/chatbar/css/chat.css" />
<link type="text/css" rel="stylesheet" media="all" href="'.uhome().'/modules/chatbar/css/screen.css" />
<!--[if lte IE 7]>
<link type="text/css" rel="stylesheet" media="all" href="'.uhome().'/modules/chatbarchatbar/css/screen_ie.css" />
<![endif]-->
<script type="text/javascript" src="'.uhome().'/modules/chatbar/js/chat.js"></script>
';
}
}
function chatbar_footer() {
global $client;
if ($client['id'] > 0 && !is_redirecting()) {
return '<div id="chat_list" class="chat_boxes">
<div id="chat_list_content" class="chat_boxes">
<div style="padding:3px;background:#999;color:white;font-weight:bold" class="chat_boxes">Chat</div>
<div id="chat_friends_list" class="chat_boxes"></div>
</div>
</div>
<div id="chat_bar" class="chat_boxes chat_bar">
<div id="chat_bar_content" class="chat_boxes">
</div>
</div>';
}
}