Вот собственно и скрипт! Через быструю замену заменяем: на (сам скрипт можно засунуть в js файл!) Версия на jQ: Code <?if($ONLINE_COUNTER$ || $MODULE_ID$='forum')?> <script type="text/javascript"> // Online User Avatar for uCoz v2.1 jQ ~ http://allcity.net.ru/ $('a.groupAdmin').each(function(){ $(this).attr('title','<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()+'" border="0" /><br />Администратор</div>'); }); $('a.groupModer').each(function(){ $(this).attr('title','<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()+'" border="0" /><br />Модератор</div>'); }); $('a.groupVerify').each(function(){ $(this).attr('title','<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()+'" border="0" /><br />Проверенный</div>'); }); $('a.groupUser').each(function(){ $(this).attr('title','<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()+'" border="0" /><br />Пользователь</div>'); }); </script> <?endif?> </body> Версия на JS: Code <?if($ONLINE_COUNTER$ || $MODULE_ID$='forum')?> <script type="text/javascript"> // Online User Avatar for uCoz v1.1 JS ~ http://allcity.net.ru/ us=document.getElementsByTagName('a'); for(on=0;on<us.length;on++){ if(us[on].className=='groupAdmin'){ us[on].title='<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+us[on].innerHTML+'" border="0" /><br />Администратор</div>';} if(us[on].className=='groupModer'){ us[on].title='<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+us[on].innerHTML+'" border="0" /><br />Модератор</div>';} if(us[on].className=='groupVerify'){ us[on].title='<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+us[on].innerHTML+'" border="0" /><br />Проверенный</div>';} if(us[on].className=='groupUser'){ us[on].title='<div align="center"><img alt="Загрузка..." src="http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+us[on].innerHTML+'" border="0" /><br />Пользователь</div>';} } </script> <?endif?> </body> Для роботы скрипта нужен хинт! Внимание: просмотр профиля должен быть доступен гостям! * Сделано - Создать кеширование ссылок (увеличит скорость загрузки аватаров)! - Ссылка аватарa обновляется раз в 24 часа! * Сделано - Версия на JS. * Сделано - Версия скрипта на jQ без использования хинта. * Сделано - Принудительное определения ссылки аватaра (если скрипт не смог определить ссылку аватара на вашем сайте). Версия скрипта на jQ без использования хинта! В CSS (окошко можно подогнать под себя) Code /* === Online User Avatar for uCoz === */ #userAvatarAdmin { text-align: center; position: absolute; border: 1px solid #FF0000; background: #FFE5E5; padding: 5px; display: none; color: #000000; }
#userAvatarModer { text-align: center; position: absolute; border: 1px solid #99BBE8; background: #F0F3F5; padding: 5px; display: none; color: #000000; }
#userAvatarVerify { text-align: center; position: absolute; border: 1px solid #99BBE8; background: #F0F3F5; padding: 5px; display: none; color: #000000; }
#userAvatarUser { text-align: center; position: absolute; border: 1px solid #323D4F; background: #ECECEC; padding: 5px; display: none; color: #000000; } /* ============================ */ и опять через быструю замену заменяем: Code на (сам скрипт можно засунуть в js файл!): <?if($ONLINE_COUNTER$ || $MODULE_ID$='forum')?> <script type="text/javascript"> // Online User Avatar for uCoz v1.1 jQ without HINT ~ http://allcity.net.ru/ $('a.groupAdmin').each(function(){ $(this).attr('rel','http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()); });
$('a.groupModer').each(function(){ $(this).attr('rel','http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()); });
$('a.groupVerify').each(function(){ $(this).attr('rel','http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()); });
$('a.groupUser').each(function(){ $(this).attr('rel','http://s1.allcity.net.ru/ucoz_avatar/online_user_avatar.php?domain='+location.host+'&username='+$(this).html()); });
xOffset=5; yOffset=25;
$('a.groupAdmin').hover(function(e){ $('body').append('<p id="userAvatarAdmin"><img alt="Загрузка..." src="'+this.rel+'" /><br />Администратор</p>'); $('p#userAvatarAdmin').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px').fadeIn('slow');},function(){$('p#userAvatarAdmin').remove();}); $('a.groupAdmin').mousemove(function(e){$('p#userAvatarAdmin').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px');});
$('a.groupModer').hover(function(e){ $('body').append('<p id="userAvatarModer"><img alt="Загрузка..." src="'+this.rel+'" /><br />Модератор</p>'); $('p#userAvatarModer').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px').fadeIn('slow');},function(){$('p#userAvatarModer').remove();}); $('a.groupModer').mousemove(function(e){$('p#userAvatarModer').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px');});
$('a.groupVerify').hover(function(e){ $('body').append('<p id="userAvatarVerify"><img alt="Загрузка..." src="'+this.rel+'" /><br />Проверенный</p>'); $('p#userAvatarVerify').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px').fadeIn('slow');},function(){$('p#userAvatarVerify').remove();}); $('a.groupVerify').mousemove(function(e){$('p#userAvatarVerify').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px');});
$('a.groupUser').hover(function(e){ $('body').append('<p id="userAvatarUser"><img alt="Загрузка..." src="'+this.rel+'" /><br />Пользователь</p>'); $('p#userAvatarUser').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px').fadeIn('slow');},function(){$('p#userAvatarUser').remove();}); $('a.groupUser').mousemove(function(e){$('p#userAvatarUser').css('top',(e.pageY-xOffset)+'px').css('left',(e.pageX+yOffset)+'px');}); </script> <?endif?> </body> Источник: allcity.net.ru
|