deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 26, 2009 12:21:01 GMT -8
You're correct about renaming the karmas, but only staff can smite. If a user reaches the minimum post requirement then they can exalt other people.
|
|
|
Post by Wormopolis on Apr 26, 2009 13:12:02 GMT -8
I think I can merge all that into 1 script. first lets make sure the regular script is ok.
ok I nolonger have karma privs. I cant exalt/smite, and I dont even see karma for people.
so the script is working.
I will mod it for the rename, and make it so only users in a list can smite.
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 26, 2009 13:23:34 GMT -8
I can still see it in profiles. I dont think the requirement code is working though, because for a user under the requirement is able to give it in profiles.
|
|
|
Post by Wormopolis on Apr 26, 2009 13:37:13 GMT -8
updated code: <script language="JavaScript"> <!-- // Post requirements for Karma use - version 1.2 // by Wormopolis - wormocodes.proboards.com// Do not repost - keep header intact var postsRequiredToUseKarma=100; // if you want to rename karma: var useNewKarmaWords=true; var newKarmaWord="Mojo"; var newSmiteWord="Ice"; var newExaltWord="Work"; // if you want only certain people to use smite: var restrictSmite=true; var smiteAllowed=/^(admin|user1|user2|wormopolis)$/; // no need to edit below if(location.href.match('board=') || location.href.match(/action=viewprofile/)) { pstcnt=0; if (document.cookie.match(/postcount=(\d+),?(\d+)/)) { pstcnt=RegExp.$1; pstcnt2=RegExp.$2; pstcnt=(pstcnt2 ? parseInt(pstcnt+pstcnt2) : parseInt(pstcnt)); } for (lnks=document.getElementsByTagName('a'), i=0; i<lnks.length; i++) { if (lnks .href.match(/action=karma/)) { if (pstcnt<=postsRequiredToUseKarma) { lnks.style.display="none"; lnks.previousSibling.nodeValue=""; lnks.nextSibling.nodeValue=""; lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/karma:\s(\d+)/i,''); } else { if (restrictSmite && lnks.innerHTML.match(/Smite/) && !pb_username.match(smiteAllowed)) { lnks.style.display="none"; lnks.previousSibling.nodeValue=" ]"; lnks.nextSibling.nodeValue=""; } if (useNewKarmaWords && lnks.innerHTML.match(/Smite/)) lnks.innerText=lnks.innerText.replace(/Smite/,newSmiteWord); if (useNewKarmaWords && lnks.innerHTML.match(/Exalt/)) lnks.innerText=lnks.innerText.replace(/Exalt/,newExaltWord); if (useNewKarmaWords && lnks.parentNode.innerHTML.match(/Karma/)) lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/Karma/,newKarmaWord);
} } } }
// --> </script>
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 26, 2009 13:39:47 GMT -8
Is it finished? I don't see a </script>
|
|
|
Post by Wormopolis on Apr 26, 2009 13:42:36 GMT -8
heh heh.. yah.. sorry bout that
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 26, 2009 14:01:58 GMT -8
Seems to work a little, but under requirements are able to give them still. I gave you a group.
|
|
|
Post by Wormopolis on Apr 26, 2009 14:06:23 GMT -8
I cant do exalt or smite in my account there. the postcount cookie wont update unless you visit your profile or a thread with one of your posts. this update clears Karma from the Profile as well as all mini-profiles: <script language="JavaScript"> <!-- // Post requirements for Karma use - version 1.3 // by Wormopolis - wormocodes.proboards.com// Do not repost - keep header intact var postsRequiredToUseKarma=100; // if you want to rename karma: var useNewKarmaWords=true; var newKarmaWord="Mojo"; var newSmiteWord="Ice"; var newExaltWord="Work"; // if you want only certain people to use smite: var restrictSmite=true; var smiteAllowed=/^(admin|user1|user2|wormopolis)$/; // no need to edit below if(location.href.match('board=') || location.href.match(/action=viewprofile/)) { pstcnt=0; if (document.cookie.match(/postcount=(\d+),?(\d+)/)) { pstcnt=RegExp.$1; pstcnt2=RegExp.$2; pstcnt=(pstcnt2 ? parseInt(pstcnt+pstcnt2) : parseInt(pstcnt)); } for (lnks=document.getElementsByTagName('a'), i=0; i<lnks.length; i++) { if (lnks .href.match(/action=karma/)) { if (pstcnt<=postsRequiredToUseKarma) { lnks.style.display="none"; lnks.previousSibling.nodeValue=""; lnks.nextSibling.nodeValue=""; lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/karma:\s(\-?)(\d+)/i,''); if (location.href.match(/action=viewprofile/)) { for (tds=lnks.parentNode.nextSibling.getElementsByTagName('td'), j=0; j<tds.length; j++) { if (tds[j].innerHTML.match(/karma:/i)) { tds[j].parentNode.style.display="none"; } } } } else { if (restrictSmite && lnks.innerHTML.match(/Smite/) && !pb_username.match(smiteAllowed)) { lnks.style.display="none"; lnks.previousSibling.nodeValue=" ]"; lnks.nextSibling.nodeValue=""; } if (useNewKarmaWords && lnks.innerHTML.match(/Smite/)) lnks.innerText=lnks.innerText.replace(/Smite/,newSmiteWord); if (useNewKarmaWords && lnks.innerHTML.match(/Exalt/)) lnks.innerText=lnks.innerText.replace(/Exalt/,newExaltWord); if (useNewKarmaWords && lnks.parentNode.innerHTML.match(/Karma/)) lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/Karma/,newKarmaWord); if (location.href.match(/action=viewprofile/) && useNewKarmaWords && lnks.parentNode.nextSibling.innerHTML.match(/Karma/)) lnks.parentNode.nextSibling.innerHTML = lnks.parentNode.nextSibling.innerHTML.replace(/Karma/,newKarmaWord);
} } } }
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>
|
|
|
Post by Wormopolis on Apr 26, 2009 14:23:23 GMT -8
ok.. on your site it works fine for me in FF, but IE is still showing "Karma". on my test site it works in both browsers. try this version: <script language="JavaScript"> <!-- // Post requirements for Karma use - version 1.4 // by Wormopolis - wormocodes.proboards.com// Do not repost - keep header intact var postsRequiredToUseKarma=100; // if you want to rename karma: var useNewKarmaWords=true; var newKarmaWord="Mojo"; var newSmiteWord="Ice"; var newExaltWord="Work"; // if you want only certain people to use smite: var restrictSmite=true; var smiteAllowed=/^(admin|user1|user2|wormopolis)$/; // no need to edit below if(location.href.match('board=') || location.href.match(/action=viewprofile/)) { pstcnt=0; if (document.cookie.match(/postcount=(\d+),?(\d+)/)) { pstcnt=RegExp.$1; pstcnt2=RegExp.$2; pstcnt=(pstcnt2 ? parseInt(pstcnt+pstcnt2) : parseInt(pstcnt)); } for (lnks=document.getElementsByTagName('a'), i=0; i<lnks.length; i++) { if (lnks .href.match(/action=karma/)) { if (pstcnt<postsRequiredToUseKarma) { lnks.style.display="none"; lnks.previousSibling.nodeValue=""; lnks.nextSibling.nodeValue=""; lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/karma:\s(-?)(\d+)/i,''); if (location.href.match(/action=viewprofile/)) { for (tds=lnks.parentNode.nextSibling.getElementsByTagName('td'), j=0; j<tds.length; j++) { if (tds[j].innerHTML.match(/karma:/i)) { tds[j].parentNode.style.display="none"; } } } } else { if (restrictSmite && lnks.innerHTML.match(/Smite/) && !pb_username.match(smiteAllowed)) { lnks.style.display="none"; lnks.previousSibling.nodeValue=" ]"; lnks.nextSibling.nodeValue=""; } if (useNewKarmaWords && lnks.innerHTML.match(/Smite/)) lnks.innerText=lnks.innerText.replace(/Smite/,newSmiteWord); if (useNewKarmaWords && lnks.innerHTML.match(/Exalt/)) lnks.innerText=lnks.innerText.replace(/Exalt/,newExaltWord); if (useNewKarmaWords && lnks.parentNode.innerHTML.match(/Karma/)) lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/Karma/,newKarmaWord); if (location.href.match(/action=viewprofile/) && useNewKarmaWords && lnks.parentNode.nextSibling.innerHTML.match(/Karma/)) lnks.parentNode.nextSibling.innerHTML = lnks.parentNode.nextSibling.innerHTML.replace(/Karma/,newKarmaWord);
} } } }
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>
|
|
|
Post by Wormopolis on Apr 26, 2009 14:33:53 GMT -8
its working for me in IE and FF now... my IE browser had logged me out and I didnt notice.
which means Guests can view Karma. You want Karma Hidden to Guests?
|
|
|
Post by Wormopolis on Apr 26, 2009 15:28:05 GMT -8
added in the new option: <script language="JavaScript"> <!-- // Post requirements for Karma use - version 1.5 // by Wormopolis - wormocodes.proboards.com// Do not repost - keep header intact var postsRequiredToUseKarma=500; // if you want to rename karma: var useNewKarmaWords=true; var newKarmaWord="Mojo"; var newSmiteWord="Ice"; var newExaltWord="Work"; // if you want only certain people to use smite: var restrictSmite=true; var smiteAllowed=/^(admin|user1|wormopolis)$/; //seperate by | // if you want certain users to use karma regardless of postcount var alwaysKarma=/^(admin|user1|user2)$/; //seperate by | // if you want Karma hidden to Guests var guestHideKarma=true; // no need to edit below if(location.href.match('board=') || location.href.match(/action=viewprofile/)) { pstcnt=0; if (document.cookie.match(/postcount=(\d+),?(\d+)/)) { pstcnt=RegExp.$1; pstcnt2=RegExp.$2; pstcnt=(pstcnt2 ? parseInt(pstcnt+pstcnt2) : parseInt(pstcnt)); } for (lnks=document.getElementsByTagName('a'), i=0; i<lnks.length; i++) { if (lnks .href.match(/action=karma/)) { if (pstcnt<postsRequiredToUseKarma && !pb_username.match(alwaysKarma)) { lnks.style.display="none"; lnks.previousSibling.nodeValue=""; lnks.nextSibling.nodeValue=""; lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/karma:\s(-?)(\d+)/i,''); if (location.href.match(/action=viewprofile/)) { for (tds=lnks.parentNode.nextSibling.getElementsByTagName('td'), j=0; j<tds.length; j++) { if (tds[j].innerHTML.match(/karma:/i)) { tds[j].parentNode.style.display="none"; } } } } else { if (restrictSmite && lnks.innerHTML.match(/Smite/) && !pb_username.match(smiteAllowed)) { lnks.style.display="none"; lnks.previousSibling.nodeValue=" ]"; lnks.nextSibling.nodeValue=""; } if (useNewKarmaWords && lnks.innerHTML.match(/Smite/)) lnks.innerText=lnks.innerText.replace(/Smite/,newSmiteWord); if (useNewKarmaWords && lnks.innerHTML.match(/Exalt/)) lnks.innerText=lnks.innerText.replace(/Exalt/,newExaltWord); if (useNewKarmaWords && lnks.parentNode.innerHTML.match(/Karma/)) lnks.parentNode.innerHTML=lnks.parentNode.innerHTML.replace(/Karma/,newKarmaWord); if (location.href.match(/action=viewprofile/) && useNewKarmaWords && lnks.parentNode.nextSibling.innerHTML.match(/Karma/)) lnks.parentNode.nextSibling.innerHTML = lnks.parentNode.nextSibling.innerHTML.replace(/Karma/,newKarmaWord);
} } } }
if (pb_username=="Guest") { for (tds=document.getElementsByTagName('td'), k=0; k<tds.length; k++) { if (tds[k].innerHTML.match(/karma:\s(-?)(\d+)/gi)) { if (guestHideKarma) tds[k].innerHTML=tds[k].innerHTML.replace(/karma:\s(-?)(\d+)/gi,''); tds[k].innerHTML=tds[k].innerHTML.replace(/karma/gi,newKarmaWord); } } }
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 26, 2009 19:47:42 GMT -8
I think its working. ;D
|
|
|
Post by Wormopolis on Apr 26, 2009 20:03:17 GMT -8
well you are my beta tester, so let me know if everything is working ok.
I will put this in my submissions board
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 26, 2009 20:40:58 GMT -8
ok thanks
|
|
deadend123
Junior Member
testing custom title
Posts: 68
deadend123 said 0 great things
|
Post by deadend123 on Apr 26, 2009 20:42:59 GMT -8
One more code lol Can you make a code that'll allow only staff to edit all and any polls?
|
|