MaxRom | Scripturi uCoz Romania

Bannerul tau aici
[ Mesaje noi · Membrii · Regulamentul forumului · RSS ]
  • Pagina 1 din 1
  • 1
Butonul Like
Muşatinu Date: Miercuri, 2012-01-04, 13:33 | Message # 1
Mesaje: 1801
Awards: 202
« 53 »

[spoiler="Exemplu"][/spoiler]

Modificam Optiunea rating in Like

in CSS adaugam:

Code

.likeplus {font-size:1pt;background:url('http://i.imgur.com/BvP9N.png') top;width:13px;height:12px;overflow:hidden;cursor:pointer;margin-right:4px;margin-top:0px}    
.likeplus_hover {font-size:1pt;background:url('http://yraaa.ru/_pu/10/58127939.png') bottom;width:13px;height:12px;overflow:hidden;cursor:pointer;margin-right:4px;margin-top:0px}    
.like2 {font-size:8pt;font-weight:bold;color:#111C49;}    
.likex {font-size:8pt;font-weight:bold;color:#223276;}    


Urmatoru cod il adaugam sau in partea de sus sau in partea de jos a site-ului (de dorit jos):
Code

<script type="text/javascript">    
likePlus = function (c, d, f, g) {    
     if (typeof d == 'undefined' || typeof c == 'undefined' || (c != 1 && c != -1)) return false;    
     c += 2;    
     if (!f) f = location.pathname.match(/[^\\\/]+/i) + '';    
     if (!f) return false;    
     var h = $('#rate_' + d);    
     g = $.extend({    
     'before': function (a) {    
     },    
     'after-success': function (a, b) {    
     document.getElementById('frs2' + d).innerText++    
     a.html(b).addClass(b > 0 ? 'positiveRate' : (b == 0 ? 'nullRate' : 'negativeRate'));    
     },    
     'after-error': function (a) {    
     try {eval(a)} catch (e) {}    
     }    
     }, g || {});    
     g.before(h);    
     $.post('/' + f + '/', {'a': '65', 'id': d, 'mark': c, 'mod': f, 'ajax': '2'}, function (a) {    
     a = $('cmd:first', a).text();    
     var b = a.match(/Рейтинг:\s*([\d.]+)\/(\d+)/i);    
     if (!b) return g['after-error'](a);    
     b = Math.round(b[1] * b[2]) - 2 * b[2];    
     g['after-success'](h, b)    
     })    
}    
function getClass(nameid, nameclass) {    
     document.getElementById(nameid).className=nameclass    
}    
</script>


in aspectul materialului sau pagina cu tot continutul si camentariile la el, adaugam urmatorul script in loc de tegul:
Code
$RATED$


Atentie!!! in script schimbati publ cu modulul dorit.

Code
<?if($RATING$)?>    
<div onclick="likePlus(1,$ID$,'publ');return false" style="cursor:pointer;height:16px;" onmouseover="getClass('hr2$ID$','likeplus_hover');getClass('frs2$ID$','like2')" onmouseout="getClass('hr2$ID$','likeplus');getClass('frs2$ID$','likex')">    
<table cellspacing="0" cellpadding="0"><tr><td><div id="hr2$ID$" class="likeplus"> </div></td><td><div class="likex" id="frs2$ID$">$RATED$</div></td></tr></table>    

</div>    
<?endif?>
[texterror4]Sursa: http://webo4ka.ru

[/texterror4]

 
TyBy Date: Miercuri, 2012-01-04, 15:44 | Message # 2
Mesaje: 46
Awards: 77
« 2 »

Gand la gand cu bucurie... Chiar ma gandeam la ceva de genu zilele astea.
Merge modificat codul asta, sau trebuie unu nou, ca pe langa like sa apara si un buton de dislike? (dar sa contorizeze voturile separat) 5 like / 3 dislike...

 
Muşatinu Date: Miercuri, 2012-01-04, 15:48 | Message # 3
Mesaje: 1801
Awards: 202
« 53 »

TyBy, nop... este altu.. http://maxrom.ucoz.com/forum/30-649-1 modifici cum vrei si merge bat :D

 
Stapanul Date: Luni, 2012-06-18, 09:28 | Message # 4
Mesaje: 17
Awards: 21
« -1 »

Ceea ce trebuie. Din prima nu am reusit... dar pana la urma m-am descurcat.

 
  • Pagina 1 din 1
  • 1
Căutare: