в виде материалов комментариев в самый верх ставим это
Код
<div id="apoucomments" apotms="$TIMESTAMP$">
и естественно в самом низу закрываем
В форму добавления комментариев в самый низ ставим
Код
<script>
var apocominterval;
$('div#apoucomments:first').before('<input class="apoButtons" style="margin-right:2px;" type="button" value="Проверить комментарии" onclick="aporefcomments()" /> <input class="apoButtons" style="margin-right:2px;" type="button" value="Обновить комментарии" onclick="apofullrefcomments()" />
');
function aporefcomments(s) {
$('div#apoucomments').stop().fadeTo(300, 0.6);
$.get(location.href, function(apogt) {
var apolastcom = $('#apoucomments:first').attr('apotms');
$('div#apoucomments').stop().fadeTo(300, 1);
if(apolastcom == $('#apoucomments:first', apogt).attr('apotms')) {
if(!s) {
_uWnd.alert('Нет новых комментариев', {w:250, h:70});
};
} else {
apofullrefcomments();
if(!s) {
_uWnd.alert('Подгружены новые комментарии', {w:250, h:70});
};
}
});
}
apocominterval = setInterval(function() {
aporefcomments('s');
}, 60000); // Задаём интервал автообновления в 60 секунд
function apofullrefcomments() {
clearInterval(apocominterval);
apocominterval = setInterval(function() {
aporefcomments('s');
}, 30000);
$('#allEntries').stop().fadeTo(300, 0.6);
setTimeout(function() {
$.get(location.href, function(apogt) {
$('#allEntries').html($('#allEntries', apogt).html()).stop().fadeTo(300, 1);
$('div#apoucomments:first').before('<input class="apoButtons" style="margin-right:2px;" type="button" value="Проверить комментарии" onclick="aporefcomments()" /> <input class="apoButtons" style="margin-right:2px;" type="button" value="Обновить комментарии" onclick="apofullrefcomments()" />
');
});
}, 1000);
}
function addcom(f){
if (document.getElementById('addcBut')){document.getElementById('addcBut').disabled=true;}else {try{document.addform.submit.disabled=true;}catch(e){}}if (document.getElementById('eMessage')){document.getElementById('eMessage').innerHTML='<span style="color:#8B8B8B">[img]http://s36.ucoz.net/img/ma/m/i2.gif[/img] Идет передача данных...</span>';}
if($('#apodop1').val().length > 4) {
$('.commFl').val($('.commFl').val() + '\n[url=' + $('#apodop1').val() + ']' + $('#apodop1').val() + '[/url]')
}
_uPostForm('acform',{type:'POST',url:'/index/', success:apofullrefcomments()});
}
</script>
<style>
#newEntryB{display:none}
.apoButtons{transition:all 1s;-moz-transition:all 1s; -webkit-transition:all 1s; -o-transition:all 1s; background:white;border:none;border-bottom:1px solid #CCC;border-right:1px solid #CCC}
.apoButtons:hover{background:#EEE}
.apoButtons:active{background:#DDD;border-bottom:1px solid #BBB;border-right:1px solid #BBB}
</style>
Сохраняем и наслаждаемся