Background Image

Мини скрипты для uCoz

Script

by — Category Script on

 Награды на ПСП для uCoz

<span id="listawards">загрузка наград ...</span>  

JS

$('#listawards').hide(); 
  $.get('/index/54-$_USER_ID$', function(data){  
  data=$(data).text();  
  $('#listawards').empty().append($('td', data)).show();  
  }) 

 ПРОВЕРЕНО!

 Статус пользователя на любой странице

На персональной странице в самый низ ставим

<div id="userstatus"><?if($USERNAME$=$_USERNAME$)?><img border="0" align="absmiddle" src="/online.gif"><?else?>$_STATUS$<?endif?></div> 


 Далее страницы где хотим видеть отображение вставляем скрипт

<script type="text/javascript"> 
$('#statusload1').load('/index/8-290 #userstatus'); 
$('#statusload2').load('/index/8-1 #userstatus');
$('#statusload3').load('/index/8-114 #userstatus'); 
</script>

где - 
<div id="statusload1"></div> - вставить в блок, где находится первый юзер.
<div id="statusload2"></div> - это статус второго юзера.
<div id="statusload3"></div> - это статус третьего юзера.
и т.д.

  ПРОВЕРЕНО!

 Статистика в кружках

.statistics {margin:0 17px; text-align: center;} 
.statistics .block {display: inline-block; margin: 0 8px; position: relative;} 
.statistics .block div {border: 3px solid; border-radius: 50%; width: 60px; height: 60px; line-height: 53px; font-size: 16px;} 
.statistics span {display: block; border-radius: 3px; width: 54px; height: 20px; line-height: 20px; font-size: 10px; color: #646464; text-transform: uppercase; position: absolute; right: 6px; top: 50px;} 
.statistics .block:nth-of-type(1) div {border-color: rgba(0,0,0,0.3); color: #000;} 
.statistics .block:nth-of-type(1) span {background: rgba(255,255,255,0.7);} 
.statistics .block:nth-of-type(2) div {border-color: rgba(0,0,0,0.3); color: #000;} 
.statistics .block:nth-of-type(2) span {background: rgba(255,255,255,0.7);} 
.statistics .block:nth-of-type(3) div {border-color: rgba(0,0,0,0.3); color: #000;} 
.statistics .block:nth-of-type(3) span {background: rgba(255,255,255,0.7);}

Разметка

<div class="statistics"> 
<div class="block"> 
<div id="tnum"></div> 
<span>Online</span> 
</div> 
<div class="block"> 
<div id="unum"></div> 
<span>User</span> 
</div> 
<div class="block"> 
<div id="gnum"></div> 
<span>Guest</span> 
</div> 
</div> 
<div style="display: none;">$ONLINE_COUNTER$</div> 

Подключаем Javascript и готово.

<script type="text/javascript"> 
$('#tnum').text($('#onl1 b').text()); 
$('#gnum').text($('#onl2 b').text()); 
$('#unum').text($('#onl3 b').text()); 
</script> 

  ПРОВЕРЕНО!

 Спасибо за материал

Подключаем script

<!-- Спасибо за материал/Мне нравится --> <script>
 (function($){

 var defaults = {
 id: 0,
 post: 0,
 text: 'Спасибо за материал =)'
 }

 function _post(repXML, id, text){
 status('LOADING');

 $.ajax({
 type: 'POST',
 url: '/index/',
 timeout: 10000,
 data: {
 a:23,t:1,act:2,ref: document.location.href, s:id,
 reason: text,
 code: $('#addReputation-code #secuCode').val(),
 seckey: $('#addReputation-code input[name="seckey"]').val(),
 ssid: $('input[name="ssid"]', repXML).val(),
 _tp_: 'xml'
 },
 success: function(response){
 response = $('cmd[p="innerHTML"]',response).text();

 if(response.indexOf('myWinLoadSD') != -1){
 status('OK');
 _uWnd.close('reputation');
 _uWnd.alert('<br>Вы успешно отблагодарили, пользователя!','',{close:1,w:250,h:80,tm:7000,align:'center'});

 }else{
 status('EROR');
 _updateCaptcha(id);
 _uWnd.alert('<br>'+$(response).attr('title'),'',{close:1,w:250,h:80,tm:7000,align:'center'});
 }

 },
 error: function(){
 status('EROR');
 _uWnd.alert('<br>Ошибка, повторите запрос.','',{close:1,w:250,h:80,tm:7000,align:'center'});
 }
 });
 }

 function _get(id){
 var documentHtml;
 $.ajax({url: '/index/23-'+id, async: 0}).done(function(resp){
 documentHtml = $('cmd[p="content"]', resp).text();
 });
 return documentHtml;
 }

 /* Получение капчи */
 function _getCaptcha(id, htmlNew){

 var code_input = '<input type="text" id="secuCode" style="width:90px;height:30px;float:left;box-sizing: border-box;-moz-box-sizing: border-box;font-size:18px;">';
 var code = $('input[name="seckey"]', htmlNew).size() ? '<div id="addReputation-code">'+code_input+$('#secuImg',htmlNew).prop('outerHTML')+$('input[name="seckey"]',htmlNew).prop('outerHTML')+'</div><style>#addReputation-code img{height:28px;padding: 1px 5px !important}</style>' : 0;

 return code;
 }

 /* Обновление капчи */
 function _updateCaptcha(id){
 var newCap = _getCaptcha(id);
 $('#addReputation-code').html(newCap);
 }

 /* Статус отправки */
 function status(isType){

 var type = {'OK': 'myWinLoadSD', 'EROR': 'myWinLoadSF', 'LOADING': 'myWinLoadS'}
 $('.addReputation .status').html('<div class="'+type[isType]+'"></div>');
 }

 /* Плагин */
 $.addReputation = function(options){
 var settings = $.extend({}, defaults, options);
 var xml = _get(settings.id);

 if(settings.post){
 _post(xml, settings.id, $('.addReputation #comment').val());
 return false;
 }

 var button = _uButton(null,'button',{style:1,text:'Готово',content:'onclick="$.addReputation({post:1,id:'+settings.id+'});"'});
 var captcha = _getCaptcha(settings.id, xml);

 new _uWnd('reputation','Спасибо за материал',260, captcha ? 180 : 130, {autosize:0,resize:0,notaskbar:1,fadetype:2,fadespeed:500,fadeclosetype:1,fadeclosespeed:500,align:'left'},'<div class="addReputation"><fieldset style="margin-top:5px;padding-bottom:5px;"><legend>Комментарий</legend><input type="text" id="comment" value="'+settings.text+'" style="width:100%;box-sizing: border-box;-moz-box-sizing: border-box;"></fieldset>'+ (captcha ? '<fieldset><legend>Введите код безопасности</legend><div>'+captcha+'</div></fieldset>' : '') +'<fieldset style="margin-top:5px;padding:5px 5px"><div style="float:right" class="status"></div>'+button+'</fieldset></div>');
 }

})(window.jQuery);
 </script> <!--/ Спасибо за материал/Мне нравится -->

Устанавливаем кнопку "Мне нравится"

<?if($USER_LOGGED_IN$ && $UID$ != $USER_ID$)?><a href="javascript://" class="down" onclick="$.addReputation({id:$UID$});">&#8250; Мне нравится!</a><?endif?>

Всё! Готово.

  ПРОВЕРЕНО!


Понравился материал?
Поделитесь с друзьями

С этим материалом смотрят:
    Своя стилизация кнопок "Поделиться" uSocial.pro

    Своя стилизация кнопок "П...

    Набор кнопок "Поделиться" для сайта позвол...

    View More
    2 625 12:50
    Выезжающая панель меню на CSS3

    Выезжающая панель меню на CSS3

    Меню по своему стилю подойдет для сайтов с любым диз...

    View More
    0 971 15:06
    Простой скрипт выделения кода одним кликом

    Простой скрипт выделения кода ...

    Порой в материала...

    View More
    0 758 15:25
    Добавление ссылки на источник при копировании

    Добавление ссылки на источник ...

    Очень простой скрипт, который добавляет при копирова...

    View More
    0 490 15:33
Метки: Скрипты, UCOZ
Feedback: 1
iMadeas
0
Не выделяется код

Leave a Comment

Имя *:
Email *:
Код *:
Menu