V
Vitalch
Гость
Код:
<!-- IF LOGGED_IN -->
<script type="text/javascript">
ajax.chat_message = function(mode) {
ajax.exec({
action : 'chat_message',
mode : mode,
message : $('#message').val()
});
};
ajax.callback.chat_message = function(data) {
if(data.message)
{
$('#chat').show();
$('#message').attr('value', '');
$('#chat').html(data.message);
initPostBBCode('#chat');
}
};
function submit_click(e) {
e = e || window.event;
if (e.keyCode == 13 && e.ctrlKey) {
submit_chat();
};
}
function add_nick(text){
$('#message').attr('value', $('#message').val() + text +' ');
$('#message').focus();
}
$(document).ready(function(){ajax.chat_message(2);});
setInterval(function(){ajax.chat_message(2);}, 60000);
</script>
<style type="text/css">
#chat { overflow: auto; width: 850px; height: 300px; }
.chat-comment {
margin: 3px;
padding: 4px;
border: solid 1px #F9FCFF
background-color: #AED7FF;
}
textarea.chat_message {
height: 50px; width: 845px;
border-radius: 0px;
-moz-border-radius: 11px;
font-size: 11px;
}
.chat_btn {
border: 1px solid #0080FF;
padding: 2px;
background-color: #F9FCFF;
font-size: 10px;
font-weight: bold;
cursor:pointer;
}
.chat_btn:hover { color: #0080FF; }
'shout_del' => array('mod'),
$post_delete =($userdata['user_level'] == 1 || $userdata['user_level'] == 2) ? '<img src="images/shout_delete.gif" title="Удалить сообщение" alt="Удалить" class="clickable" onclick="ajax.shout_del('.$shout_row['shout_id'].'); ajax.chat_message(2); return false;" style="float:right"> ' : '';
function shout_del()
{
global $bb_cache;
$id = (int) $this->request['id'];
DB()->query("DELETE FROM bb_shout WHERE shout_id = $id");
$this->response['id'] = $id;
CACHE('bb_cache')->rm('shout_data');
}
</style>
<div class="category">
<h3 class="cat_title">Чат</h3>
<div class="buttons mrg_4">
<input type="button" class="chat_btn" value=" B " name="codeB" title="Bold (Ctrl+B)" style="font-weight: bold; width: 30px;" />
<input type="button" class="chat_btn" value=" i " name="codeI" title="Italic (Ctrl+I)" style="width: 30px; font-style: italic;" />
<input type="button" class="chat_btn" value=" u " name="codeU" title="Underline (Ctrl+U)" style="width: 30px; text-decoration: underline;" />
<input type="button" class="chat_btn" value=" s " name="codeS" title="Strikeout (Ctrl+S)" style="width: 30px; text-decoration: line-through;" />
<input type="button" value="Quote" name="codeQuote" title="Цитата" style="width: 60px;"/>
<input type="hidden" name="codeUrl2"/>
<select name="codeColor" class="chat_btn">
<option style="color: black; background: #fff;" value="black" selected="selected">{L_QR_COLOR_SEL}:</option>
<option style="color: darkred;" value="darkred"> {L_COLOR_DARK_RED}</option>
<option style="color: brown;" value="brown"> {L_COLOR_BROWN}</option>
<option style="color: #996600;" value="#996600"> {L_COLOR_ORANGE}</option>
<option style="color: red;" value="red"> {L_COLOR_RED}</option>
<option style="color: #993399;" value="#993399"> {L_COLOR_VIOLET}</option>
<option style="color: green;" value="green"> {L_COLOR_GREEN}</option>
<option style="color: darkgreen;" value="darkgreen"> {L_COLOR_DARK_GREEN}</option>
<option style="color: gray;" value="gray"> {L_COLOR_GRAY}</option>
<option style="color: olive;" value="olive"> {L_COLOR_OLIVE}</option>
<option style="color: blue;" value="blue"> {L_COLOR_BLUE}</option>
<option style="color: darkblue;" value="darkblue"> {L_COLOR_DARK_BLUE}</option>
<option style="color: indigo;" value="indigo"> {L_COLOR_INDIGO}</option>
<option style="color: #006699;" value="#006699"> {L_COLOR_STEEL_BLUE}</option>
</select>
<select name="codeAlign" class="chat_btn">
<option value="left" selected="selected">Расположение:</option>
<option value="left"> Слева</option>
<option value="right"> Справа</option>
<option value="center"> По центру</option>
<option value="justify"> Выровнять</option>
</select>
</div>
<div class="cat_footer"></div>
<div class="category">
<input type="button" class="chat_btn" style="width: 75px; color: green;" value="Смайлики" onclick="window.open('posting.php?mode=smilies', '_phpbbsmilies', 'height=540, resizable=yes, scrollbars=yes ,width=620'); return false;" title="Смайлики";/>
<input type="button" class="chat_btn" style="width: 75px; color: #996600;" value="Обновить" onclick="ajax.chat_message(2); return false;" title="Обновить чат"/>
<input type="button" class="chat_btn" style="width: 25px; color: red;" value="X" onclick="$('#message').attr('value', ''); $('#message').focus();" title="Очистить"/>
<input type="button" class="chat_btn" style="width: 75px; color: #006699;" value="Отправить" onclick="ajax.chat_message(1); return false;" title="Отправить сообщение"/>
</div>
<div class="cat_footer"></div>
<div class="f_tbl_wrap pad_4 tcenter">
<form name="post">
<textarea onkeydown="submit_click(event)" id="message" class="chat_message"></textarea>
<div class="clear"></div>
<div class="spacer_2"></div>
<div id="chat" class="tLeft hidden"></div>
</form>
</div>
<div class="cat_footer"></div>
</div>
<!-- ENDIF -->
<script type="text/javascript">
var bbcode = new BBCode("message");
var ctrl = "ctrl";
bbcode.addTag("codeB", "b", null, "B", ctrl);bbcode.addTag("codeI", "i", null, "I", ctrl);bbcode.addTag("codeU", "u", null, "U", ctrl);bbcode.addTag("codeS", "s", null, "S", ctrl);
bbcode.addTag("codeImg", "img", null, "R", ctrl);bbcode.addTag("codeUrl", "url", "/url", "", ctrl);bbcode.addTag("codeUrl2", "url=", "/url", "W", ctrl);
bbcode.addTag("codeColor", function(e) { var v=e.value; e.selectedIndex=0; return "color="+v }, "/color");bbcode.addTag("codeAlign", function(e) { var v=e.value; e.selectedIndex=0; return "align="+v }, "/align");
</script>