Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 8, 2010 15:19:40 GMT -8
<- noob.
ill let you know if they go down by tomarrow when they change.
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 8, 2010 21:20:08 GMT -8
I think it works. I dont see any issues with it yet. It took my 100 level down to 80 in two days (down by 10% each day) and same 80 to 70 5%decrease.
whats with the clearbanusers though? when it reaches zero a button will apear somewhere giving those WhoCanClearBans the options to clear the ban? (ban im guessing is the disable accout?, not actual ban ip address's/email/accout?)
|
|
|
Post by Wormopolis on Jan 8, 2010 22:32:47 GMT -8
yes. when it reaches 0 it will put a red and white button in the spot where the warning was. only the user listed in that variable will see the button, everyone else will see nothing, as if the warning was lifted.
however, the warning WONT actually be lifted since, again, I cant access the PB database directly. clicking the button will take you to the user's profile and clear the warning and save. it takes about 2 seconds.
I also added in a thing to update the actual warning level everytime you visit the modify profile.
I still keep catching it do something strange so keep checking back to see if I post a final version.
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 9, 2010 11:16:10 GMT -8
ah ok, very nice, ill let you know if i see anything wrong w/ it.
|
|
|
Post by Wormopolis on Jan 11, 2010 1:51:59 GMT -8
ok... try this update:
<script type="text/javascript"> <!-- // auto-reducing warning bar v1.1 // by Wormopolis - www.wormocodes.com // concept by Topeka // Keep header intact - do not repost
var usersWhoCanClearWarnings=/admin|wormo|user3|user4/;
for (tds=document.getElementsByTagName('td'), w=0; w<tds.length; w++) { if (tds[w].width=='20%' && tds[w].className.match(/windowbg/) && tds[w].innerHTML.match(/Warning Level - (\d+)%/)) { stPerc=RegExp.$1; if (tds[w].innerHTML.match(/\[Ø(.*?):(\d+)\]/)) { stDate=RegExp.$1; decVal=RegExp.$2; tds[w].innerHTML=tds[w].innerHTML.replace(/\[Ø(.*?):(\d+)\]/,''); stDate=(parseInt(stDate,36)).toString(); tmpDate1=new Date(); tmpDate1.setFullYear(stDate.substr(0,4)); tmpDate1.setMonth(stDate.substr(4,2)); tmpDate1.setDate(stDate.substr(6,2)); tmpDate1.setHours(0); tmpDate1.setSeconds(0); tmpDate1.setMinutes(0); tmpDate2=new Date(); tmpDate2.setHours(0); tmpDate2.setSeconds(0); tmpDate2.setMinutes(0); dayStretch=parseInt((tmpDate2-tmpDate1)/(1000*60*60*24)); // bar width is 1.1 pixels x perc subPerc=stPerc-(dayStretch*decVal); for (pic=tds[w].getElementsByTagName('img'), p=0; p<pic.length; p++) { if (pic[p].src.match(/warn_left.gif/)) { midbar=pic[p].nextSibling; textSave=pic[p].previousSibling.previousSibling; if (subPerc>0) { midbar.width=subPerc*1.1; textSave.nodeValue=textSave.nodeValue.replace(/(\d+)%/,subPerc+'%'); } else { if (pb_username.match(usersWhoCanClearWarnings)) { tmp=tds[w].getElementsByTagName('b')[0].firstChild.href.split('user=')[1]; nwDiv=document.createElement('div'); nwDiv.width="100%"; fntstuff='<center><font style="background-color:CC0000; color:FFFFFF; font-size:14px; cursor:pointer;" onclick="location.href=\'/index.cgi?action=modifyprofile&user='+tmp+'&banclear\'" > CLEAR WARNING </font></center>' nwDiv.innerHTML=fntstuff; midbar.previousSibling.style.display= midbar.style.display= midbar.nextSibling.style.display="none"; textSave.nodeValue=""; textSave.parentNode.insertBefore(nwDiv, textSave); } else { midbar.previousSibling.style.display= midbar.style.display= midbar.nextSibling.style.display="none"; textSave.nodeValue=""; textSave.previousSibling.style.display= textSave.nextSibling.style.display ="none"; } } break; } } } } }
function setupWarnDec() { if (modifyForm.warnDec.checked==true && modifyForm.decVal.value>0) { dt=new Date; dt.setHours(0); dt.setMinutes(0); dt.setSeconds(0); timetemp=dt.getFullYear().toString() + '' + (dt.getMonth().toString().length<2 ? '0' : '') + dt.getMonth().toString() + '' + (dt.getDate().toString().length<2 ? '0' : '') + dt.getDate().toString(); wdstring=parseInt(timetemp).toString(36); modifyForm.customtitle.value='[Ø'+wdstring+':'+modifyForm.decVal.value+']'+modifyForm.customtitle.value; } }
if (document.modifyForm) { if (location.href.match(/banclear/)) { modifyForm.warninglevel.value=0; modifyForm.customtitle.value=modifyForm.customtitle.value.replace(/\[Ø(.*?):(\d+)\]/,''); alert("User's Ban has been cleared!"); modifyForm.submit(); } else { if (modifyForm.warninglevel) { wlrow=modifyForm.warninglevel.parentNode.parentNode.parentNode; nwrw=wlrow.parentNode.insertRow(wlrow.rowIndex+1); nwrw.insertCell(0);nwrw.insertCell(0);nwrw.insertCell(0); nwrw.cells[1].align="center"; tmp=document.createElement('font'); tmp.innerHTML='<input type="checkbox" name="warnDec"> <input size=5 name="decVal" value="0">%'; nwrw.cells[1].appendChild(tmp); tmp=document.createElement('font'); tmp.innerHTML=' decrease percentage each day. auto-decrement will start from midnight.'; nwrw.cells[2].appendChild(tmp); if (modifyForm.customtitle.value.match(/\[Ø(.*?):(\d+)\]/)) { stPerc=modifyForm.warninglevel.value; stDate=RegExp.$1; decVal=RegExp.$2; modifyForm.customtitle.value=modifyForm.customtitle.value.replace(/\[Ø(.*?):(\d+)\]/,''); stDate=(parseInt(stDate,36)).toString(); tmpDate1=new Date(); tmpDate1.setFullYear(stDate.substr(0,4)); tmpDate1.setMonth(stDate.substr(4,2)); tmpDate1.setDate(stDate.substr(6,2)); tmpDate1.setHours(0); tmpDate1.setSeconds(0); tmpDate1.setMinutes(0); tmpDate2=new Date(); tmpDate2.setHours(0); tmpDate2.setSeconds(0); tmpDate2.setMinutes(0); dayStretch=parseInt((tmpDate2-tmpDate1)/(1000*60*60*24)); // bar width is 1.1 pixels x perc subPerc=stPerc-(dayStretch*decVal); modifyForm.warninglevel.value=(subPerc < 0 ? 0 : subPerc); if (subPerc > 0) { modifyForm.warnDec.checked=true; modifyForm.decVal.value=decVal; } }
if (document.addEventListener) { document.modifyForm.addEventListener("submit", setupWarnDec , false); } else { document.modifyForm.attachEvent("onsubmit", setupWarnDec); }
} } }
// --> </script>
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 11, 2010 15:13:32 GMT -8
k, its updated.
|
|