General Android James Lieutenant-Commander Forum Promotion Manager Combat Teacher Strategy Teacher[M:3000] member is offline
~Them Black Hat's won't take me alive~
Joined: Jan 2006 Gender: Male Posts: 563 Location: Out in who knows where Karma: 19
Auto Warning Expiration. « Thread Started on Apr 2, 2007, 11:46pm »
Link:http://support.proboards.com/index.cgi?board=codedatabase&action=display&n=1&thread=1128622097 Description:Auto Expiration warning system. Place:Top of Global Headers
Code:
<script> //Warning Meter v2.0 //Now with auto expiration
//Copyright 10-04-2005 by ~Wonder //May be reposted anywhere as long as this header remains in tact. Make sure you include instructions.
//Put at TOP of Global Header
//Edit these 3 variables to suit your color and height needs meterBGColor="#CC0000"; meterBorderColor="#000000"; meterHeight=7;
//If you want to user a gradient instead of a solid background color, enter the URL here meterGradientURL="";
//Copyright 10-04-2005 by ~Wonder //May be reposted anywhere as long as this header remains in tact. Make sure you include instructions.
//Put at top of Global Footer if(meterGradientURL!=""){meterBGColor="";dogooent.write("<style type=\"text/css\"><!--.warningmeter {background-image: url("+meterGradientURL+"); background-repeat: repeat;}--></style>")} else{meterBGColor=" bgColor="+meterBGColor;}
if(location.href.match(/action=(display|goto|viewprofile|pmview|recent)/)) { curDate=mainDate; var td=dogooent.getElementsByTagName("td"); for(i=0;i<td.length;i++) { if(td[i].width=="20%" && td[i].className.match(/windowbg/) && td[i].innerHTML.match(/(\[W#(.+?)#(.+?)#(.+?)\](<br>)?)/i)) { temp=RegExp.$1; w=""; s=RegExp.$2; f=RegExp.$3; des=RegExp.$4; start=s.replace(/\.|\//g,"-").replace(/[^\-\d]/g,"").split("-"); finish=f.replace(/\.|\//g,"-").replace(/[^\-\d]/g,"").split("-"); if(start[2].length<=2){start[2]=parseInt(start[2],10)+2000;} if(finish[2].length<=2){finish[2]=parseInt(finish[2],10)+2000;} start=new Date(parseInt(start[2],10),parseInt(start[0],10)-1,parseInt(start[1],10)); finish=new Date(parseInt(finish[2],10),parseInt(finish[0],10)-1,parseInt(finish[1],10)+1); p=Math.round(((finish-curDate)/(finish-start))*100);if(p>100){p=0;} if(des.length>2){des+="<br>";} if(p>0){td[i].innerHTML=td[i].innerHTML.replace(temp,"<b>Warning:</b> "+p+"%"+"<table style=\"border-width:1px; border-style: solid; border-color:"+meterBorderColor+"\" cellpadding=0 cellspacing=0 width=100%><tr><td"+meterBGColor+" width="+p+"% height="+meterHeight+" class=warningmeter></td><td width="+(100-p)+"%></td></tr></table><table border=0 cellpadding=0 cellspacing=0 width=100%><tr><td><font size=1>S:"+s+"</font></td><td align=\"right\"><font size=1>E:"+f+"</font></td></tr></table>"+des);} else{td[i].innerHTML=td[i].innerHTML.replace(temp,"><br>");} } } } if("undefined" != typeof(dogooent.modifyForm) && "undefined" != typeof(dogooent.modifyForm.customtitle)) { curDate=mainDate; f=dogooent.modifyForm; f.customtitle.onblur=wp; f.customtitle.onfocus=wr; sta="";fin="";des="";orig="";wc=""; if(f.customtitle.value.match(/(\[W#(.+?)#(.+?)#(.+?)\])/)) { orig=RegExp.$1;sta=RegExp.$2;fin=RegExp.$3;des=RegExp.$4; start=sta.replace(/\.|\//g,"-").replace(/[^\-\d]/g,"").split("-"); finish=fin.replace(/\.|\//g,"-").replace(/[^\-\d]/g,"").split("-"); if(start[2].length<=2){start[2]=parseInt(start[2],10)+2000;} if(finish[2].length<=2){finish[2]=parseInt(finish[2],10)+2000;} start=new Date(parseInt(start[2],10),parseInt(start[0],10)-1,parseInt(start[1],10)); finish=new Date(parseInt(finish[2],10),parseInt(finish[0],10)-1,parseInt(finish[1],10),23,59,59); if(curDate>finish) { f.customtitle.value=f.customtitle.value.replace(orig,""); sta="";fin="";des="";orig=""; } } if(sta==""){sta=(curDate.getMonth()+1)+"/"+curDate.getDate()+"/"+(curDate.getFullYear()+"").substring(2,4);} curDate=new Date((curDate-0)+(86400000*7)); if(fin==""){fin=(curDate.getMonth()+1)+"/"+curDate.getDate()+"/"+(curDate.getFullYear()+"").substring(2,4);} tabs=dogooent.getElementsByTagName("table"); for(i=0;i<tabs.length;i++) { if(tabs[i].innerHTML.match(/Account Notes:/) && !tabs[i].innerHTML.match(/MSN:/)) { temprow=tabs[i].insertRow(-1); temp=temprow.insertCell(0); temp.innerHTML="<font size=\"-1\">Warning:</font>"; temp.width=160;temp.vAlign="top"; temp=temprow.insertCell(1); temp.colSpan=2; if(des==" "){des="";} temp.innerHTML="<table border=0 width=100%><tr><td>Start Date:</td><td><input name=startdate size=11 value=\""+sta+"\"></td><td>End Date:</td><td><input name=enddate size=11 value=\""+fin+"\"></td></tr><tr><td>Description:</td><td colSpan=3><input name=description size=40 value=\""+des+"\"> <input type=button value=\"Apply\" onClick=updateWarning()> <input type=button value=\"Reset\" onClick=resetWarning()></td></tr></table><font size=\"-2\">Enter the start date, expiration date, and description of a warning you want to give this member. Start and End dates must be in MM/DD/YYYY or MM/DD/YY formats (You can use - or . instead of /). You may use UBBC in the description. If you start a warning in the future, it will not start showing until that date. If you want to set a warning's start date for some time before 2000, use a 4 digit year. To remove a warning, set the end date to some time in the past. Click \"Apply\" when you are content. Then click \"Modify Profile\" to submit the information.</font>"; temp.width=245;temp.valign="top"; break; } } } function wr(){wc=f.customtitle.value.match(/(\[W#(.+?)#(.+?)#(.+?)\])/); wc=(wc.length>0)?wc[0]:""; f.customtitle.value=f.customtitle.value.replace(wc,"");} function wp(){if(wc!=null)f.customtitle.value=wc+f.customtitle.value;} function resetWarning() { curDate=mainDate; f.startdate.value=(curDate.getMonth()+1)+"/"+curDate.getDate()+"/"+(curDate.getFullYear()+"").substring(2,4); curDate=new Date((mainDate-0)+(86400000*7)); f.enddate.value=(curDate.getMonth()+1)+"/"+curDate.getDate()+"/"+(curDate.getFullYear()+"").substring(2,4); f.description.value=""; } function updateWarning() {if(f.description.value.length==0){f.description.value+=" ";} f.customtitle.value=f.customtitle.value.replace(f.customtitle.value.match(/\[W#(?:.+)#(?:.+)#(?:.+)\]/),"");f.customtitle.value="[W#"+f.startdate.value+"#"+f.enddate.value+"#"+f.description.value+"]"+f.customtitle.value;} </script>
Re: Auto Warning Expiration. « Reply #1 on Apr 3, 2007, 12:14am »
Okay, if this can't help prevent spamming or help with security(I'm not good at judging codes, I can't even read this one because TST is having trouble loading) then it shouldn't be here...
If it is for security or can help stop spam, it should be in the Proboards; Anti-Spam and Security(where proboards codes go that can help forums) Android James, I'll leave you up to where it goes since it's your post
Creation, Betrayal, Peace, the Fall of Empires, the Rise of Empires, Wrath, Victory, the Past, the Future, Death, Resurrection, Eternity... Read the Bible... It will scare the "Hell" out of you!
General Android James Lieutenant-Commander Forum Promotion Manager Combat Teacher Strategy Teacher[M:3000] member is offline
~Them Black Hat's won't take me alive~
Joined: Jan 2006 Gender: Male Posts: 563 Location: Out in who knows where Karma: 19
Re: Auto Warning Expiration. « Reply #2 on Apr 3, 2007, 12:23am »
Well this board is also security. I figured it would help you out to be "secure" if you didn't have to keep track off un-banning anyone. I'll properly leave it here unless anyone objects.