payad.me
Гость
Прозрачное с Avarat оповещение на сайте ЛС
Прозрачное с Avarat оповещение на сайте ЛС
payad.me

У каждого ресурса должна своя внутреннее оповещение, а вот какой она будет, здесь вам решать, к примеру Прозрачно с Avarat оповещение на сайте ЛС которая точная копия как на социальной сети В контакте. Теперь вы можете установить у себя на ресурсе и оно будет отлично работать а также выводить картинку, кто вам пишет. Выполнено в прозрачно темном виде и безусловно отличное решение поставить его на светлый портал. Но и проверил на темном и вы можете посмотреть как смотрится, что по мне, если не слишком черная гамма, то подойдет. И не нужно забывать, что прозрачность на нем хорошая, что дает прочитать спокойно, тему самого письма.

Установка:

Здесь все как у стандартных, идем в низ сайта и прописываем код в самом его низу. Потом заходим в админ панель в настройки - общие настройки и находим функцию Разрешить использование API: и выставляем как на картинке.


Но и сам код:
Код

<!--Оповещение ЛС-->  

  <?if($USER_LOGGED_IN$)?>  
  <div id="one_pm"></div>  

  <script type="text/javascript">  
  var no_ava = 'http://zornet.ru/SKRIPT/ZR/granve/no_ava.gif';  

  var this_mess_link = '';  
  function m_reload() {  
  if($('#one_pm').html()=='') {  
  $.get('/index/14?'+Math.random(), function (data) {  
  $('b.unread', data).each(function (i,index) {  
  getLink = $(index).parent().attr("href");  
  this_mess_link = getLink;  
  getText = $(index).parent().text();  
  getAuthorName = $(index).parent().parent().children('a').eq(1).text();  
  getAuthor = $(index).parent().parent().children('a').eq(1).attr("href");  
  getID = '#one_pm'+i;  
  var xml = $.ajax({  
  type: 'GET',  
  url: '/api/index/8-0-'+getAuthorName.replace('-','~'),  
  dataType: 'xml',  
  async: false  
  }).responseText;  
  var urlAvatar = $(xml).find('struct:first member:contains("USER_AVATAR")').find('string').text();  
  var userName = $(xml).find('struct:first member:contains("USER_NAME")').find('string').text();  
  $('#one_pm').html('<div id="one_pm'+i+'" style="display:none">'  
  +'<div class="h_newpm">'  
  +'<div class="h_npin"><div class="h_nover" onclick="document.location.href="'+getLink+'""></div>'  
  +'<div class="h_nptitle">Новое сообщение</div><span class="h_del" onclick="h_del();return false;"></span>'  
  +'<div class="h_npl"><div class="h_npimg"><a href="#" id="hnp_avatar"></a></div></div>'  
  +'<div class="h_npr"><a href="#" id="hnp_author"></a> <span id="hnp_text" onclick="document.location.href="'+getLink+'"">'+getText+'</span></div>'  
  +'</div>'  
  +'</div>'  
  +'</div><div id="hnp_sound"></div>');  
  $(getID+' #hnp_author').attr('href', getAuthor);  
  $(getID+' #hnp_avatar').attr('href', getAuthor);  
  $(getID+' #hnp_author').html(userName);  
  $(getID+' #hnp_avatar').html('<img src="'+ (urlAvatar == '' ? no_ava : urlAvatar )+'">');  
  setTimeout(function(){$(getID).slideDown(200);},200);  
  $('#hnp_sound').html('<audio src="http://zornet.ru/SKRIPT/ZR/granve/vk.mp3" volume="1" autoplay></audio>');setTimeout(function(){$('#hnp_sound').html('')},2000);  
  });  
  });  
  }  
  }  
  function h_del() {$('#one_pm').fadeOut(200,function(){$('#one_pm').html('<i></i>')});$.get(this_mess_link);}  
  m_reload();setInterval(function(){m_reload()}, 5000);  
  </script>  

  <style type="text/css">  
  #one_pm {position:fixed;left:20px;bottom:0px;cursor:pointer;font-family:Tahoma,Arial,Verdana,sans-srif}  
  #hnp_sound {position:absolute;top:-1000px;left:-1000px}  
  #hnp_author span {display:none}  
  .h_newpm {position:relative;width:350px;height:110px;margin-bottom:20px;background:rgba(0,0,0,0.7);text-shadow:0 1px 3px rgba(0,0,0,0.5);box-shadow:0 0 10px #000;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}  
  .h_newpm a {color:#a4dcfa;font-weight:bold;text-decoration:none;}  
  .h_newpm a:hover {color:#a4dcfa;text-decoration:underline}  
  .h_npin {padding:14px;padding-top:10px}  
  .h_nptitle {color:#FFF;font-size:13px;font-weight:bold;padding-bottom:12px}  
  .h_npimg {width:57px;height:57px;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,0.3);-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}  
  .h_npimg img {width:100%;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}  
  .h_npl {position:absolute;left:13px;top:38px;z-index:3;width:70px}  
  .h_npr {position:absolute;left:84px;top:38px;z-index:3;color:#FFF;font-size:13px;padding-right:14px}  
  .h_npr span {display:block}  
  .h_newpm:hover .h_del {display:inline-block;}  
  .h_del {position:absolute;display:none;top:12px;right:12px;z-index:3;cursor:pointer;background:url('http://zornet.ru/SKRIPT/ZR/granve/close.png') 0px 0px;width:18px;height:18px}  
  .h_del:hover {background-position:0px 18px}  
  .h_nover {position:absolute;top:0px;left:0px;width:100%;height:100%;}  
  </style>  

  <?endif?>


Забыл сказать про звук, просто у меня наушники для скайпа подключены и не услышал, но потом проверил, звук есть как щелкнуть по лбу, вообщем вы услышите.


Всего комментариев: 0
avatar