deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 19, 2009 10:49:12 GMT -8
Hey, is it okay if you can generate a code where if a member reaches a certain rank or rank requirement, they'll be able to give karma? Thanks.
|
|
|
Post by Wormopolis on Apr 19, 2009 23:30:36 GMT -8
before I start on this, I want to make sure I have all the details. when you say rank, you are talking about post count right? so you want it where someone has to reach a certain postcount before they can start using Karma? Or are there other factors involved?
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 20, 2009 15:39:38 GMT -8
I want it to where they have to reach a certain post count.
|
|
|
Post by Wormopolis on Apr 20, 2009 16:06:05 GMT -8
excellent! that will make it much easier to code. I will start on this tonight.
|
|
|
Post by Wormopolis on Apr 23, 2009 15:51:28 GMT -8
I am back home in Vegas and should have this done today!
|
|
|
Post by Wormopolis on Apr 23, 2009 23:47:34 GMT -8
This should work for you:
Global footer
<script language="JavaScript"> <!-- // Post requirements for Karma use - version 1.0 // by Wormopolis - wormocodes.proboards.com // Do not repost - keep header intact
var postsRequiredToUseKarma=100;
// no need to edit below
if(location.href.match('board=')) { pstcnt=0; if (document.cookie.match(/postcount=(\d+),?(\d+)/)) { pstcnt=RegExp.$1; pstcnt2=RegExp.$2; pstcnt=(pstcnt2 ? parseInt(pstcnt+pstcnt2) : parseInt(pstcnt)); } if (pstcnt<=postsRequiredToUseKarma) { for (lnks=document.getElementsByTagName('a'), i=0; i<lnks.length; i++) { if (lnks[i].href.match(/action=karma/)) { lnks[i].style.display="none"; lnks[i].previousSibling.nodeValue=""; lnks[i].nextSibling.nodeValue=""; lnks[i].parentNode.innerHTML=lnks[i].parentNode.innerHTML.replace(/karma:\s(\d+)/i,''); } } } }
if(location.href.match('action=viewprofile') || (location.href.match('thread=') && !location.href.match(/action=post/i))){ var ahh=document.getElementsByTagName('a') for(q=0;q<ahh.length;q++){ if(ahh[q].href.match('viewprofile&user='+pb_username)){ postcount=ahh[q].parentNode.parentNode.innerHTML.split('Posts: ')[1].split(/</)[0]; expDate=new Date(); expDate.setYear(expDate.getFullYear()+1); document.cookie="postcount="+postcount+"; expires="+expDate; break; } } } // --> </script>
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 24, 2009 13:56:36 GMT -8
Thank you! Oh and can you make it to where staff can add/remove a karma?
|
|
|
Post by Wormopolis on Apr 24, 2009 14:58:25 GMT -8
you mean make it where a particular person isnt affected by the script, or do you mean actually edit someones karma? Anyone who can edit profiles of other members should be able to edit someones karma. No code would be able to actually edit that number because it is stored on serverside.
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 24, 2009 17:19:53 GMT -8
Isn't affected by the script. I've noticed that whoever can edit profiles (other than admin) cannot edit karmas.
|
|
|
Post by Wormopolis on Apr 24, 2009 19:13:23 GMT -8
I stand corrected. I just checked that myself on a test site. only ppl with rank of admin (not just main admin but anyone with administrator level) can actually modify karma.
We can mod this script in 2 ways. either make a list of ppl you dont want affected by the script, or make it where anyone with an admin button in the menubar isnt affected. or both actually.
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 24, 2009 20:29:23 GMT -8
Umm, I'll take the list of people.
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 25, 2009 0:26:36 GMT -8
Also, the regular code doesn't work.
|
|
|
Post by Wormopolis on Apr 25, 2009 1:52:40 GMT -8
URL? I thought it was working after you said "Thank You".
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 25, 2009 12:49:28 GMT -8
Yeah, its just that I never tested it. No one can karma though, but even if I change their post count on/above 100, they still can't give karmas.
|
|
|
Post by Wormopolis on Apr 25, 2009 13:15:22 GMT -8
have them visit their profile and then try again. the code has to store a cookie.
|
|