<div class="stable front{$classes}" id="shoutbox">
<div class="headline">
<div class="head left">
<span class="icon"></span>
<span class="title">{$lang->dvz_sb_shoutbox}</span>
</div>
<div class="right">
(<a href="javascript:void(0)" onclick="MyBB.popupWindow('/misc.php?action=smilies&popup=true&editor=MyBBEditor&modal=1'); return false;"> Emotikony</a>)
<a href="{$mybb->settings['bburl']}/shoutbox.php"> Więcej </a>
<a href="{$mybb->settings['bburl']}/index.php?action=shoutbox_archive"> Archiwum</a>
</div>
</div>
<div class="body">
{$panel}
<div class="window" style="height:{$mybb->settings['dvz_sb_height']}px">
<div class="data">
{$html}
</div>
</div>
</div>
<style>
.shoutbox-stats {
margin: 20px;
text-align: center;
}
.shoutbox-stats .stat {
margin: 10px;
}
.shoutbox-stats .block {
font-size: 10pt;
font-weight: bold;
text-align: center;
vertical-align: middle;
background: rgb(165, 223, 16);
background: -moz-linear-gradient(top, rgba(165, 223, 16, 1) 0%, rgba(73, 145, 7, 1) 100%);
background: -webkit-linear-gradient(top, rgba(165, 223, 16, 1) 0%, rgba(73, 145, 7, 1) 100%);
background: linear-gradient(to bottom, rgba(165, 223, 16, 1) 0%, rgba(73, 145, 7, 1) 100%);
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#a5df10', endColorstr='#499107', GradientType=0);
box-sizing: border-box;
color: #fff;
border-radius: 3px;
padding: 5px 10px;
right: 8px;
transform: translateY(-50%);
}
</style>
<div class="shoutbox-stats">
<div class="clearfix">
<div class="left33"><span class="stat">Twoich shoutów: <span class="block">{$our_shouts}</span></span></div>
<div class="left33"><span class="stat">Wszystkich shoutów: <span class="block">{$wpisy}</span></span></div>
<div class="left33"><span class="stat">Największy spamer: <span class="block">{$top_spamer_noformatted} ({$shouts})</span></span></div>
</div>
</div>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/dvz_shoutbox.js"></script>
<script>
dvz_shoutbox.parseEntries = function(areLatest) {
dvz_shoutbox.runCallbacks('entries');
$('#shoutbox .entry:not([data-parsed])').each(function() {
if (typeof $(this).attr('data-mod') !== 'undefined') {
$(this).find(".info").prepend('<a href="" class="mod edit">E</a><a href="" class="mod del">X</a>');
}
if (dvz_shoutbox.markUnread) {
if ((areLatest === true ? dvz_shoutbox.firstId : $(this).attr('data-id')) > parseInt(Cookie.get('dvz_sb_last_read'))) {
$(this).addClass('unread');
}
}
$(this).attr('data-parsed', '');
});
}
dvz_shoutbox.update = function() {
if (dvz_shoutbox.updating) {
return false;
} else {
dvz_shoutbox.updating = true;
}
$.get(
'xmlhttp.php',
{ action: 'dvz_sb_get_updates', first: dvz_shoutbox.firstId, last: dvz_shoutbox.lastId },
function(data) {
if (dvz_shoutbox.handleErrors(data)) {
return false;
}
if (data) {
var data = $.parseJSON(data);
// new shouts
if (data.html) {
// insert new shouts
if (dvz_shoutbox.reversed) {
var scrollMax = $('#shoutbox .data').innerHeight() - $('#shoutbox .window').innerHeight(),
scroll = $('#shoutbox .window').scrollTop();
$('#shoutbox .data').append( $(data.html).fadeIn(function() {
// scroll to bottom again
if (!dvz_shoutbox.started || scroll >= scrollMax) {
$('#shoutbox .window').scrollTop( $('#shoutbox .window')[0].scrollHeight );
}
}) );
} else {
$('#shoutbox .data').prepend( $(data.html).hide().fadeIn() );
}
// remove old shouts to fit the limit
var old = $('#shoutbox .entry').length - dvz_shoutbox.maxShouts;
if (old > 0) {
$('#shoutbox .entry:nth'+(dvz_shoutbox.reversed ? '' : '-last')+'-child(-n+'+old+')').remove();
dvz_shoutbox.firstId = $('#shoutbox .entry:'+(dvz_shoutbox.reversed ? 'first' : 'last')+'-child').attr('data-id');
}
// mark new shouts
if (dvz_shoutbox.started) {
$('#shoutbox .entry').filter(function() {
return parseInt($(this).attr('data-id')) > dvz_shoutbox.lastId && $(this).not('[data-own]').length;
}).addClass('new');
setTimeout("$('#shoutbox .entry.new').removeClass('new')", 1000);
}
dvz_shoutbox.lastId = data.last;
if (dvz_shoutbox.firstId == 0 && data.first !== undefined) {
dvz_shoutbox.firstId = data.first;
}
dvz_shoutbox.parseEntries(true);
dvz_shoutbox.updateLastRead();
}
// sync updates
if (data.sync) {
for (var i in data.sync) {
var entry = $('#shoutbox .entry[data-id='+i+']');
if (data.sync[i] === null) {
entry.fadeOut(function() {
$(this).remove();
});
} else {
entry.find('.text').html(data.sync[i]);
}
}
}
}
dvz_shoutbox.updating = false;
dvz_shoutbox.runCallbacks('update');
if (typeof(callback) == 'function') {
callback();
}
}
);
}
</script>
{$javascript}
<script>
dvz_shoutbox.callbacks['update'].push(function(){
if ($('#shoutbox .entry.new').length) {
var audio = new Audio(rootpath + '/images/dvz_shoutbox.mp3');
audio.volume = 0.2;
audio.play();
}
});
</script>
</div>