Скрипт баллов для uCoz (валюта на сайте)

Автор [Lichkin-rus], 12-07-2011, 10:42:51

« назад - далее »

[Lichkin-rus]Topic starter

Скрипт баллов для uCoz (валюта на сайте)






Отнятие/прибавление баллов пользователям очень простое (1 клик).

Пользователь заполняет форму заказа услуги, вам в ЛС приходит такое сообщение, вы выполняете услугу, переходите по ссылке, делаете 1 клик и все, готово.



Требования:
- Модуль Блог

Заходим в модуль Блог » Настройки модуля » Поля для добавления материалов и уберем галочки везде кроме,

Полный текст материала,

Дополнительное поле 1,

Дополнительное поле 2

В вид материалов блога меняем все на:

<span class="ballEdit">
<span class="plus">$OTHER1$</span>
<span class="minus">$OTHER2$</span>
<span class="log">$MESSAGE$</span>
</span>$MODER_PANEL$


$OTHER1$ и $OTHER2$ - можно поменять на свои.

Страница архива материалов блогa, меняем $BODY$ на:

<div id="bFast">$BODY$</div>

Скачиваем файл скрипта, после чего открываем его текстовым редактором, идем на сайт - Персональная страница пользователя  и перед </body> вставляем код скрипта. В этом же шаблоне, в нужное место, где хотите видеть надпись "Баллы пользователя" вставляем:


<div class="udtb"><div class="udtlb">Баллы пользователя:</div><a href="#" onclick="balli.open();return false;" id="ballov">...</a></div>

Стили вставляем в самый низ  - Дизайн >> Таблица стилей:

<style type="text/css">
.gold1 {text-align:left;padding:3px;}
.gold2 {clear:left;float:left;width:150px;}
#goldI {display: none}
.etitle{background:#f1f1f1;border:1px solid #cdcbcb;text-shadow:
0.1em 0.1em
0.05em #FFF;padding:7px;}
#tableball tr td{background:
#fafafa; border: 1px solid #bdbdbd;padding: 4px 10px;}
.xt-edit{background-position:0 -90px;}
.xt-edit-over{background-position:-15px -90px;}
.xt-log{background-position:0 -315px;}
.xt-log-over{background-position:-15px -315px;}
.rdv {text-align:left;padding:6px;}
.ldv {clear:left;float:left;width:150px;}
.ulb{text-align:left; margin: 2px;}
.lbl{clear:left;float:left;width:170px;}
.field_Y{width:145px;}
#infa_y
{display: none; font-size: 9px;}
#infa_y label {cursor: pointer; font-size: 9px;}
</style>


В нужное место вставляем скрипт Услуг с надписью "Услуги сайта":

<script type="text/javascript" src="http://ucodes.ru/js/yslygi.js"></script>
<script type="text/javascript">
_y.href = "$HOME_PAGE_LINK$"; 
_y.idSender = "$USER_ID$";
_y.date = "$DAY$.$MONTH$.$YEAR$";
_y.admin = "ваш ник";
</script>
<a href="javascript:_y.all();">Услуги сайта</a>


Скрипт создан командой сайта ucodes.ru

[spoiler=JS файл]
var
  user_id,
  ucodes = window.ucodes || {};

(ucodes = {
    initMenu: function (){
        $("ul.subnav").parent().append("<span></span>");
        $("ul.topnav li span").click(function() {
            $(this).parent().find("ul.subnav").slideDown('fast').show();
            $(this).parent().hover(function() {
            }, function(){   
                $(this).parent().find("ul.subnav").slideUp('slow');
            });
        }).hover(function() {
            $(this).addClass("subhover");
        }, function(){
            $(this).removeClass("subhover");
        });
       
    },
    chooseNum: function(){
        $('.eFooter').each(function(){
            var num = $('a',this).eq(1).html(),
                num1 = $('a',this).eq(2).html();
            if(num == 1)
                $('.com',this).html('комментарий');
            else
                if(num > 1 && num < 5)
                    $('.com',this).html('комментария');
            else
                $('.com',this).html('комментариев');
            if(num1 == 1)
                $('.rea', this).html('просмотр');
            else
                if(num1 > 1 && num1 < 5)
                   $('.rea', this).html('просмотра');
            else
                $('.rea', this).html('просмотров');
        });
    },
    resizeWindow: function(){   
        if(window.innerWidth == 1152) {
             $('body,td').css('font-size','13px');
        } else {
            if(window.innerWidth == 1280)
                $('body,td').css('font-size','14px');
        }
        $('.tips').click(function(){
            if($('.tops').css('marginTop') == '-120px' ){
                $('.tops').animate({'marginTop':'0px'});
                $(this).attr('style','position:absolute; top:2px; right:4px; height:32px; width:32px; border:none; background:url(/engine/img/12.png) no-repeat;');
            } else {
                $('.tops').animate({'marginTop':'-120'});
                $(this).attr('style','');
                $(this).css('background','url(/engine/img/11.png) top');
            }
        });
    },
    moveReklama: function(uid){
        user_id = uid;
        if(uid != 0){
            if($('.bеgun_adv_cell').html() != null){
                $('div[id*="bеgun_block"]').remove().appendTo('.block-1');
                $('.block-1 div, .block-1 table').css('border','none');
                $('img[src="http://s48.ucoz.net/img/ma/c.gif"]').remove();
                $('div[style="margin-bottom: 4px; position: relative;"]').eq(0).remove();
            } else {
               $('.block-1').remove();
            }
        } else {
            $('.block-1').remove();
        }
    },
    awsner: function(){
          if($('.answer div div[style*="width: 129px;"]')){
            $('.answer').each(function(i){
                $('div',this).addClass('prog').css({height:'18px',overflow:'hidden'});
                $('div div',this).addClass('prog ress'+i).css({background:'url(/engine/img/poll/'+(i+1)+'.png) 0 -2px repeat-x',height:'18px',marginTop:'-3px'});
                $('span',this).html($('span',this).html()+' - <span class="procent">'+$('span',this).attr('title').replace('(','/ ').replace(')','').split(':')[1]+'<\/span>');
            });
            $('.answer div div[style*="width: 129px;"]').css('width','99%');
        }
    },
    afterMessage:function(){
      if(user_id ==0){
        var $a,$s;
        $('.entryurl').hover(function(){
            $a=$(this).attr('href');
            $(this).attr('href','javascript://');
            $(this).click(function(){
                $('.eBlock').hide('1000');
                $s=$.get($a, function(mes){
                   $('.block-3').html($('.eBlock',mes).after());
                });
                $s.success(function(){$('.eBlock').show('1000');});
                $s.error(function(){_uWnd.alert('<font color="red">Ошибка  запроса!</font>','',{w:200,h:70,pad:'10px'});});
            });},function(){$(this).attr('href', $a);}); 
    }
   },
    getCode: function(){
    $(".bbCodeName:contains('Code')").html("<font style='font-size:12px;'>Код:</font> <a href='javascript://' style='font-size:12px;font-weight:normal;text-decoration:underline;margin-left:5px;' id='getcode'>Получить</a>"); 
$("#getcode").live("click",function() { 
codes = $(this).parent().next().html(); 
lencodes = codes.length; 
replcode = /<!--uzc-->/ 
replcode2 = /<!--\/uzc-->/ 
replcode3 = /<br>/g 
resultCode = codes.replace(replcode, "").replace(replcode2, "").replace(replcode3, "\n"); 
new _uWnd('getC','Получение кода для "$ENTRY_TITLE$"',600,100,{align:0,shadow:0,close:1,autosize:1,maxh:500,minh:100,resize:0}, '<fieldset><legend>Код:</legend><textarea onfocus="select(this)" id="codes" readonly="1">'+resultCode+'</textarea></fieldset><fieldset>Символов: <b>'+lencodes+'</b></fieldset>' ); 
}); 
}
});

[/spoiler]


AvriX

как начислить баллы пользователю?
  •  


Bludnik

  •  

Alexuiop1

  •  

Juiseed

Цитата: Alexuiop1 от 27-05-2014, 13:50:47Где скачать?
качать ничего не нужно, делайте все по мануалу 1го поста


Alexuiop1

почему когда вставляю скрипт перед тегом body всё рушется
:'( :'( :-\ :-[ >:D
  •  

vfetis

#6
Подскажите как это сделать пожалуйста.
_________________________________________________________
Скачиваем файл скрипта, после чего открываем его текстовым редактором, идем на сайт - Персональная страница пользователя  и перед </body> вставляем код скрипта. В этом же шаблоне, в нужное место, где хотите видеть надпись "Баллы пользователя" вставляем:

Добавлено: 20-07-2014, 19:14:38


в какое такое нужно место можно вставить скрипт услуги сайта

Добавлено: 20-07-2014, 19:45:04


подскажите как начислять баллы, и куда вставлять вот этот код ниже

var
user_id,
ucodes = window.ucodes || {};

(ucodes = {
initMenu: function (){
$("ul.subnav").parent().append("<span></span>");
$("ul.topnav li span").click(function() {
$(this).parent().find("ul.subnav").slideDown('fast').show();
$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnav").slideUp('slow');
});
}).hover(function() {
$(this).addClass("subhover");
}, function(){
$(this).removeClass("subhover");
});

},
chooseNum: function(){
$('.eFooter').each(function(){
var num = $('a',this).eq(1).html(),
num1 = $('a',this).eq(2).html();
if(num == 1)
$('.com',this).html('комментарий');
else
if(num > 1 && num < 5)
$('.com',this).html('комментария');
else
$('.com',this).html('комментариев');
if(num1 == 1)
$('.rea', this).html('просмотр');
else
if(num1 > 1 && num1 < 5)
$('.rea', this).html('просмотра');
else
$('.rea', this).html('просмотров');
});
},
resizeWindow: function(){
if(window.innerWidth == 1152) {
$('body,td').css('font-size','13px');
} else {
if(window.innerWidth == 1280)
$('body,td').css('font-size','14px');
}
$('.tips').click(function(){
if($('.tops').css('marginTop') == '-120px' ){
$('.tops').animate({'marginTop':'0px'});
$(this).attr('style','position:absolute; top:2px; right:4px; height:32px; width:32px; border:none; background:url(/engine/img/12.png) no-repeat;');
} else {
$('.tops').animate({'marginTop':'-120'});
$(this).attr('style','');
$(this).css('background','url(/engine/img/11.png) top');
}
});
},
moveReklama: function(uid){
user_id = uid;
if(uid != 0){
if($('.bеgun_adv_cell').html() != null){
$('div[id*="bеgun_block"]').remove().appendTo('.block-1');
$('.block-1 div, .block-1 table').css('border','none');
$('img[src="http://s48.ucoz.net/img/ma/c.gif"]').remove();
$('div[style="margin-bottom: 4px; position: relative;"]').eq(0).remove();
} else {
$('.block-1').remove();
}
} else {
$('.block-1').remove();
}
},
awsner: function(){
if($('.answer div div[style*="width: 129px;"]')){
$('.answer').each(function(i){
$('div',this).addClass('prog').css({height:'18px',overflow:'hidden'});
$('div div',this).addClass('prog ress'+i).css({background:'url(/engine/img/poll/'+(i+1)+'.png) 0 -2px repeat-x',height:'18px',marginTop:'-3px'});
$('span',this).html($('span',this).html()+' - <span class="procent">'+$('span',this).attr('title').replace('(','/ ').replace(')','').split(':')[1]+'<\/span>');
});
$('.answer div div[style*="width: 129px;"]').css('width','99%');
}
},
afterMessage:function(){
if(user_id ==0){
var $a,$s;
$('.entryurl').hover(function(){
$a=$(this).attr('href');
$(this).attr('href','javascript://');
$(this).click(function(){
$('.eBlock').hide('1000');
$s=$.get($a, function(mes){
$('.block-3').html($('.eBlock',mes).after());
});
$s.success(function(){$('.eBlock').show('1000');});
$s.error(function(){_uWnd.alert('<font color="red">Ошибка запроса!</font>','',{w:200,h:70,pad:'10px'});});
});},function(){$(this).attr('href', $a);});
}
},
getCode: function(){
$(".bbCodeName:contains('Code')").html("<font style='font-size:12px;'>Код:</font> <a href='javascript://' style='font-size:12px;font-weight:normal;text-decoration:underline;margin-left:5px;' id='getcode'>Получить</a>");
$("#getcode").live("click",function() {
codes = $(this).parent().next().html();
lencodes = codes.length;
replcode = /<!--uzc-->/
replcode2 = /<!--\/uzc-->/
replcode3 = /<br>/g
resultCode = codes.replace(replcode, "").replace(replcode2, "").replace(replcode3, "\n");
new _uWnd('getC','Получение кода для "$ENTRY_TITLE$"',600,100,{align:0,shadow:0,close:1,autosize:1,maxh:500,minh:100,resize:0}, '<fieldset><legend>Код:</legend><textarea onfocus="select(this)" id="codes" readonly="1">'+resultCode+'</textarea></fieldset><fieldset>Символов: <b>'+lencodes+'</b></fieldset>' );
  •  

mrgeser

#7
Еле разобрался.
vfetis автор не правильный скрипт выложил, он вообще не нужен.

а так все пашет.
  •  


neodmin

и почему то никто не написал про обходимость активации PHP на сайте.ну вы жжете))))
  •  


biglanch

neodmin, дурень? тут нет php, без php работает, только что проверял  :D

Если кому надо js, который надо скачать, прикрепил к сообщению.
  •