#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Mar 24, 2012 15:43:02 GMT -8
This will simply adds to the mini profile the amount of time you need to wait after giving or taking karma before you are allowed to do it again.
It goes in your Global Footer.
<script type="text/javascript"> <!-- // Karma countdown...
function karmaClock(karma) { var xDate = new Date(); xDate.setHours(xDate.getHours()+1); document.cookie = 'karmaTime='+xDate.getMinutes()+'; expires='+xDate.toUTCString()+';'; document.location.href = karma; return; }
if(pb_action.match(/^(display|viewprofile|search2|(modify)?preview(post)?)$/)) { if(document.cookie.match(/karmaTime/)) { var karmaMins = parseInt(document.cookie.split(/karmaTime=/)[1])+60; var KT = new Date(); KT = KT.getMinutes();//+60; KT = karmaMins-KT; if(KT>60) { KT = KT-60; }
var miniP = document.getElementsByTagName('td'); for(m=0; m<miniP.length; m++) { if(miniP[m].width == '20%' && miniP[m].vAlign == 'top' && miniP[m].className.match(/windowbg/) && miniP[m].innerHTML.match(/Karma:/)) { if(KT == 0) { miniP[m].innerHTML += '<br>Karma Time: <1 minute'; } else { miniP[m].innerHTML += '<br>Karma Time: '+KT+' minutes'; }}}} else { var kLink = document.getElementsByTagName('a'); for(k=0; k<kLink.length; k++) { if(kLink[k].href.match(/tion=karma&user/)) { var newkLink = document.createElement('a'); with(newkLink) { innerHTML = kLink[k].innerHTML; href = 'javascript:karmaClock("'+kLink[k].href+'")'; } kLink[k].parentNode.replaceChild(newkLink,kLink[k]); }}}} // --> </script>
|
|