TST Archive
« Auto Warning Expiration. »

Welcome Guest. Please Login or Register.
Nov 28, 2009, 6:29pm




DONATE TO TST

ProBoards.com READ THIS!

source

How to prevent your forum from being taken out!

Read all of The Main Interface before doing anything!

VOTE HERE, HERE, and HERE to help TST climb the ranks!

~TST Productions~


TST Archive :: The Great Hack War :: Anti-Spam Resources :: Proboards; Anti-Spam and Security :: Auto Warning Expiration.
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Auto Warning Expiration. (Read 175 times)
General Android James
Lieutenant-Commander
****
Forum Promotion Manager
Combat Teacher
Strategy Teacher
[M:3000]
member is offline

[avatar]

~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="";

function getDate()
{
months=new Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec");te=0;
curDate=dogooent.getElementsByTagName("table")[0].innerHTML.match(/\.<br>.+ (\d{1,2}\:\d{2}(a|pm)?)/i)[0];
time=RegExp.$1;
curDate=curDate.toLowerCase().replace(/\.<br>/i,"").replace(time,"").replace(/ at /i,"").replace(/,/g,"").replace(/\.|\-|\//g," ").split(" ");
time=time.split(":");
if(time[1].match(/am/) && time[0].match(/12/)){time[0]=parseInt(time[0],10)-12;}
if(time[1].match(/pm/) && !time[0].match(/12/)){time[0]=parseInt(time[0],10)+12;}time[1]=time[1].replace(/[^\d]/g,"");
for(k=0;k<12;k++){if(curDate[0].match(months[k]) || curDate[1].match(months[k])){break;}}
if((t=curDate[0].match(months[k]))!=null && t!=""){curDate[0]=(k+1)+"";te=1;}else if((t=curDate[1].match(months[k]))!=null && t!=""){curDate[1]=(k+1)+"";temp2=curDate[1];curDate[1]=curDate[0];curDate[0]=temp2;te=1;}
curDate[0]=curDate[0].replace(/[^\d]/g,"");curDate[1]=curDate[1].replace(/[^\d]/g,"");
if(parseInt(curDate[0],10)>12){temp2=curDate[1];curDate[1]=curDate[0];curDate[0]=temp2;}
if(parseInt(curDate[1],10)<13 && te==0){now = new Date();if(parseInt(curDate[1],10)==(now.getMonth()+1)){temp2=curDate[1];curDate[1]=curDate[0];curDate[0]=temp2;}}
if(curDate[2].length<=2){curDate[2]=parseInt(curDate[2],10)+2000;}
return new Date(parseInt(curDate[2],10),parseInt(curDate[0],10)-1,parseInt(curDate[1],10),parseInt(time[0],10),parseInt(time[1],10));
}
mainDate=getDate();
</script>


PLACE: Top of Global Footers

Code:
<script>
//Warning Meter v2.0

//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>
Link to Post - Back to Top  IP: Logged

[image]

~Quis_custodiet_ipsos_custodes?~
~He who fights for Justice in White Armor~

~White Knight~

Admiral Refuge™
Admiral
****
Strategy Pr0
Combat Pr0
[M:4030]
member is offline

[avatar]



Joined: Sept 2005
Gender: Male
Posts: 1,217
Location: U.S.A.
Karma: 120
 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
Link to Post - Back to Top  IP: Logged

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!
|John 3:16|Mark 16:15-18|
General Android James
Lieutenant-Commander
****
Forum Promotion Manager
Combat Teacher
Strategy Teacher
[M:3000]
member is offline

[avatar]

~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.

~White Knight
Link to Post - Back to Top  IP: Logged

[image]

~Quis_custodiet_ipsos_custodes?~
~He who fights for Justice in White Armor~

~White Knight~

   [Search This Thread][Send Topic To Friend] [Print]

© 2006 The Spammers Takeout - All rights reserved. Graphics and design by Zellow.
Best viewed in 1024x768 screen resolution.
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!