Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Dec 31, 2009 12:33:28 GMT -8
I dont even know if this is posible. But it was an idea that struck when i was doing something. Is it possible to have the warning level(bar) automaticaly decrease over time? Like say you make a user's warning level at 50, and after each week after it will automaticly go down by five. so the next week will be 45, then 40 etc. And at any time you can still lower or raise it yourself. Um.. having the time, and amount lowered as variables, so you can change it to like every min. by 10 or what ever.
Also, sometimes you want to have a user stay at 100 or 50 for a long time, so is there also a way to place like a check box to enable or disable the script for each user? like have a check box in Admin Functions under the Warning Level: that says "Do you want the Warning level to automaticly decrease?" (idk something like that) and if you check it, the level will decrease over time, if not it will stay the same.
It was just an idea. I dont know if its posible. lol But i figured i'd ask. ?/?
Thanks.
|
|
|
Post by Wormopolis on Dec 31, 2009 13:17:36 GMT -8
dammit.. I typed out a long thing about this and accidentally erased it.
This question has been asked before, and even submitted as a feature to PBS. Basically the answer is no. A code could not be written to auto-decrement the warning bar in a user's account. The value is stored server side, so it would require someone with ability to edit the value to submit a new value. even if you provided a list of those people, you would have to keep a list of all the people with warnings stored in the code iteslf.
now with that sad truth in mind, I DID have an idea that would simulate the warning being decreased. if someone looked without headers, however, they would see the truth. It would require storing a datestamp in the custom title field (in order to access it everywhere). it would use that date stamp to auto-decrement the bar and percentage. once depleted, it would put a message to the admin that the ban needed to be lifted where the ban used to be (cannot send autoPM so dont ask).
having it decrement by MINUTE would require storing a time stamp which is a minimum of 16 digits. since custom title field is only 30 or so chars long, that probably wouldnt work out.
you could however possibly change the decrement amount to a decimal number, but again, the smaller it is the more space it will take up. in other words, a 12 hour decrement would appear as .5, a 6 hour .25, an hour would be .0417, a minute would be .000694... so you see again you are taking up a lot of storage space. if the user already has a custom title, its going to get cut off.
I can play around with a prototype, but Im fairly certain one that updates on a minute-by-minute basis is going to be difficult. especially if you have any other codes utilizing the custom title field.
why use the custom title field? because lets say the user catches on that he has a warning bar but the code uses a field he can edit to decrease. he can just turn off headers and modify the start date to make his warning go away.
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Dec 31, 2009 22:59:33 GMT -8
If the update on the minute-by-minute basis thing would make difficult, would you even need to add minutes to it for it to work? I mean usually they wont need that script for the bar to go down by minutes. I mean you make it go down 1 per minute. Well its over in an hour and 40 min. So it seems sorta pointless to use minutes. The only thing it is good for is testing it. But I dont know if it can work without minutes , or if the minute-by-minute thing is the same thing as having the script run down by minutes. -.-
and, instead of useing the custom field which i see why you would use it, but cant you add your own field? Like you see people adding Xfire fields and facebook fields in Instant messangers Area. so cant you add your own in Admin features, and then use that?
Just ideas. O. and Happy New Year.
|
|
|
Post by Wormopolis on Dec 31, 2009 23:21:48 GMT -8
if crossfury uses its own server to store the data then it can hold whatever it wants. I cannot, at this time, write codes to utilize server side data. I can only do what codes like the money hack or rpg hacks do which is utilize space that is already there.
a lot of those codes you mentioned trick you into thinking you have a new field, when in fact it uses something already existing like webpage or signature or custom title or personal text. custom title is one of the few fields that displays ina miniprofile that the user cant just edit.
the shop code in the database on PBS uses the personal text field. if you disable dheaders you would see what gets added in there. its all been obfuscated so it wouldnt make sense to you, but it is there.
Im working on a CT version so you can see it. if you are running cross fury, and want to use a cross fury field to store the data, we will ahve to see what can be done
|
|
|
Post by Wormopolis on Dec 31, 2009 23:23:16 GMT -8
also, I was going to write it where you dont have to decrement by 1 each day, you COULD have it decrement by any number, say 24 for example, and it would appear at the end of the day like it decrements every hour.
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 1, 2010 12:23:05 GMT -8
O ok, like i have an xfire field, and when you type in that, you see [x=What you type] in personal text field. so it is useing personal text field, just shows a "new" field for you to type in.
And, i am not currently running Crossfury, I can add it if you would like to use that. i dont mind. I never saw it before. i see its purpose after seeing it, so i might add it anyway, later on, if you dont want to use it now.
|
|
|
Post by Wormopolis on Jan 1, 2010 13:36:49 GMT -8
the problem with using personal text field is that they will be able to jack with it. I did some encryption stuff and turned a 8 digit date into a 5 character string. I think Im going to use an alt char instead of WD to shorten it further. using 8 chars in the CT field is an acceptable loss I would think.
if you look at your own warning bar, it is ACTUALLY set at 100%.
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 1, 2010 17:19:20 GMT -8
yeah 8 chars in the CT would be fine by me. I've never found use for CT very much, just to leave little notes about the person that they cant edit out.
and yeah i saw i was set at 100%, its shows your actual percentage still in main profile page.
|
|
|
Post by Wormopolis on Jan 1, 2010 19:53:45 GMT -8
I only have the code turned on in THIS thread. Im not done yet. I just have the bar and percentage reacting to the flag in the CT.
next step will be to remove the flag from all CT and set up the input stuff on the user's modify profile to start the decrement.
It will get there.
Im juggling all the codes on this site myself, so I sorta rotate through each of them until I get stuck on something and try the next code.
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 2, 2010 11:36:52 GMT -8
take all the time you need. idm.
|
|
|
Post by Wormopolis on Jan 5, 2010 2:30:45 GMT -8
Im having trouble getting it to attach to the form submit. I think its another code doing it so I have to spend a bit of time removing everything until I find it.
|
|
|
Post by Wormopolis on Jan 6, 2010 23:06:13 GMT -8
ok.. give this a shot...
<script type="text/javascript"> <!-- // auto-reducing warning bar v1.0 // by Wormopolis - www.wormocodes.com
var usersWhoCanClearBans=/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)); tmpDate2=new Date(); 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(usersWhoCanClearBans)) { 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 BAN </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)); tmpDate2=new Date(); 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>
|
|
|
Post by Wormopolis on Jan 7, 2010 13:28:20 GMT -8
I just noticed my fix for something else is causing it to do a decrement right away. you can try out the code still and I will post a bug fix when I figure it out.
|
|
Topeka
Junior Member
Posts: 94
Topeka said 0 great things
|
Post by Topeka on Jan 7, 2010 13:40:50 GMT -8
no i get your [Øbyt9j:10] showing up on both boards testing it. no warning precentage bar.
~~and the red warning bar wont show up at all even if you dont check that box.
|
|
|
Post by Wormopolis on Jan 7, 2010 15:53:13 GMT -8
do you have warning levels turned on in those boards?
|
|