Описание
Скрипт показывающий окошко с информацией как только какой либо пользователи зашел на сайт или вышел с него!
По многим жалобам в интернете на неработоспособность скрипта, сделал новую версию, и доработал кнопки "ЛС" и "Профиль"
Установка:
На место где хотите видеть статистику:
Code
<div id="userList"></div>
В нижнюю часть сайта:
Code
<script type="text/javascript">
$.get('/index/62',function(e){ fuu = $('cmd[p="content"]',e).text();
$('a',fuu).each(function(i){
userid = $(this).attr('href').replace("http://"+location.host+"/index/8-","");
$('#userList').prepend('<div class="ssikq" style="margin-top:6px; margin-bottom:-16px; padding-right:6px;" align="right"><img style="margin-right:5px; cursor:pointer" onclick="location.href=\'/index/14-'+userid+'-0-1\';" src="http://creat1ve.ucoz.ua/design/img_css/mchat_pm.png" border="0" /><img style="cursor:pointer" onclick="location.href=\'/index/8-0-'+$(this).text()+'\';" src="http://creat1ve.ucoz.ua/design/img_css/face.png" border="0" title="Страница '+$(this).text()+'" /></div><a class="userList '+$(this).attr('class')+'" href="'+$(this).attr('href')+'">'+$(this).text()+'</a><div style="clear:both"></div>');
});
});
setInterval(function(){
data=$('#userList').text();
$.get('/index/62',function(q){ fis = $('cmd[p="content"]',q).text();
$('a',fis).each(function(){
if(data.indexOf($(this).text())== -1){
userid = $(this).attr('href').replace("http://"+location.host+"/index/8-","");
$('#userList').prepend('<div class="ssikq" style="margin-top:6px; margin-bottom:-16px; padding-right:6px;" align="right"><img style="margin-right:5px; cursor:pointer" onclick="location.href=\'/index/14-'+userid+'-0-1\';" src="http://creat1ve.ucoz.ua/design/img_css/mchat_pm.png" border="0" /><img style="cursor:pointer" onclick="location.href=\'/index/8-0-'+$(this).text()+'\';" src="http://creat1ve.ucoz.ua/design/img_css/face.png" border="0" title="Страница '+$(this).text()+'" /></div><a class="userList '+$(this).attr('class')+'" href="'+$(this).attr('href')+'">'+$(this).text()+'</a><div style="clear:both"></div>');
_uWnd.alert('<div align="center" style="padding:5px;"><b>'+$(this).text()+'</b> зашел на сайт</div>', '',{w:210, tm:5000, h:60});
}});
$('#userList a').each(function(){
if(fis.indexOf($(this).text())== -1){
_uWnd.alert('<div align="center" style="padding:5px;"><b>'+$(this).text()+'</b> вышел из сайта</div>', '',{w:210, tm:5000, h:60});
$(this).prev('.ssikq').remove(); $(this).remove();
}});
});
},7000);
</script>
В CSS:
Code
a.userList:link, a.userList:visited, a.userList:active {
text-decoration:none;
border:0px;
border-top:1px dotted #cbd3d5;
background:#fff;
padding:4px 5px;
display:block;
}
a.userList:hover {
background:#f3f3f3;
text-decoration:underline;
}
Для корректной работы скрипта в настройках модуля "Пользователи" поставьте:
"Персональную страницу пользователя открывать: В текущем окне"