--00032555b4ce263cb8047e4d32b2--
Associated Messages, from the most recent to the oldest:
--00032555b4ce263cb8047e4d32b2Content-Type: text/plain; charset=UTF-8Chris,Yea - I assume anything we give out on this list is good to share on themain site. Here's the script and stuff. Come back to me if I have leftanything out.For the server side check I use a customised multi-group-checker template. Every time the user refreshes a page their session time (stored in secondssince) is updated. If they refresh a page and the timeout has passed themulti-group-checker kicks them out.- Tom-- On the CMS admin page
[!]------------------------------------### Set countdown variables and serve the script - prefTIMEOUt set inseconds ###[/!][math show=f]days=floor([prefTIMEOUT]/86400)[/math]
[!][/!][math show=f]hours=floor(([prefTIMEOUT]-([days]*86400))/3600)[/math]
[!][/!][math show=f]mins=floor(([prefTIMEOUT]-([hours]*3600))/60)[/math]
[!][/!][math show=f]secs=[prefTIMEOUT]-(([hours]*3600)+([mins]*60))[/math]
[!][/!]
this displays the countdown
this displays the alert-- On CMS page end-- The countdown JS// CountDown Script Inspired by Sandeep Gangadharanhttp://sivamdesign.com/scripts/// Modified by Digital Revolutionaries function checkPlural(noun, value) { noun = ((value == 1) || (value == 0)) ? noun : (noun += "s"); return noun;} function countDown() {sec--;if (sec == -1) {sec = 59;min = min - 1;}else {min = min;}if (min == -1) {min = 59;hou = hou - 1;}else {hou = hou;} hour = checkPlural("hour", hou);minute = checkPlural("min", min);second = checkPlural("sec", sec); if (hou == 0) {hoursLeft = "";}else {hoursLeft = (hou) + " " + hour + " ";} if (min == 0) {minsLeft = "";}else {minsLeft = (min) + " " + minute + " ";} time = (hoursLeft) + (minsLeft) + sec + " " + second + " untilauto-logout"; if (document.getElementById) {document.getElementById('div_countdown').innerHTML = time;} SD=window.setTimeout("countDown();", 1000);if (hou < '01' && min < '05') {document.getElementById('div_alert').style.display = 'block';document.getElementById('div_alert').innerHTML = 'You only have ' + time +'
You need to complete your current task and refresh the page now';if (sec == '59') {document.getElementById('div_alert').focus();}}if (hou == '00' && min == '00' && sec == '00') {sec = "00";window.clearTimeout(SD);document.getElementById('div_countdown').innerHTML = 'SiteMinder has loggedyou out !';window.alert('SiteMinder has logged you out !');window.location = "/admin/logout.tmpl";}}-- Countdown js ends--00032555b4ce263cb8047e4d32b2Content-Type: text/html; charset=UTF-8Content-Transfer-Encoding: quoted-printableChris,
Yea - I assume anything we give out on this list =is good to share on the main site. =C2=A0 Here's the script and stuff. ==C2=A0 Come back to me if I have left anything out.
For the server side check I use a customised multi-group-checker template=. =C2=A0Every time the user refreshes a page their session time (stored in =seconds since) is updated. =C2=A0If they refresh a page and the timeout has= passed the multi-group-checker kicks them out.
------------------------------------
### ==C2=A0Set countdown variables and serve the script =C2=A0- prefTIMEOUt set =in seconds ###
[/!][math show=3Df]days=3Dfloor([pr=efTIMEOUT]/86400)[/math]
[!][/!][math show=3Df]hours=3Dfloor(([prefTIMEOUT]-([days]*86400))/3600)[=/math]
[!][/!][math show=3Df]mins=3Dfloor(([prefTIMEOUT]-([hours]=*3600))/60)[/math]
[!][/!][math show=3Df]secs=3D[prefTIMEOUT]-(([=hours]*3600)+([mins]*60))[/math]
[!][/!]<script type=3D"text/javascript">
// variables for= the countDown script
var sec =3D [secs]; =C2=A0 // set the seconds
var m=in =3D [mins]; =C2=A0 // set the minutes
var hou =3D [hours]; =C2=A0 // set= the hours
</script>
<div =id=3D"div_countdown"></div> =C2=A0 this displays the cou=ntdown
<div id=3D"div_alert"></=div> =C2=A0this displays the alert
-- =C2=A0On CMS page end
-- The countdown JS
// Mo=dified by Digital Revolutionaries
function checkPlural(noun, value) {
=C2==A0noun =3D ((value =3D=3D 1) || (value =3D=3D 0)) ? noun : (noun +=3D &quo=t;s");
=C2=A0return noun;
}
fu=nction countDown() {
sec-=-;
if (sec =3D=3D -1) {
sec =3D 59;
min= =3D min - 1;
}
else {
min= =3D min;
}
if (min =3D=3D -1) {
min= =3D 59;
hou =3D hou - 1;
}
else= {
=span>hou =3D hou;
}
hou=r =3D checkPlural("hour", hou);
minute =3D checkPlural("min=", min);
seco=nd =3D checkPlural("sec", sec);
if (hou =3D=3D 0) {
hou=rsLeft =3D "";
}
else {
hou=rsLeft =3D (hou) + " " + hour + " ";
}
if (=min =3D=3D 0) {
minsLeft =3D "";
}
else= {
=span>minsLeft =3D (min) + " " + minute + " ";
}
tim=e =3D (hoursLeft) + (minsLeft) + sec + " " + second + " unti=l auto-logout";
if= (document.getElementById) {
doc=ument.getElementById('div_countdown').innerHTML =3D time;
}
<=div>
SD==3Dwindow.setTimeout("countDown();", 1000);
if (hou < '01=' && min < '05') {
doc=ument.getElementById('div_alert').style.display =3D 'block'=;
document.getElementById('div_alert').innerHTML =3D 'You onl=y have ' + time + '<br />You need to complete your current ta=sk and refresh the page now';
if =(sec =3D=3D '59') {
document.getElementById('div_alert'=).focus();
}=div>
=}
if (hou =3D=3D '00' && min =3D=3D '00' &&=; sec =3D=3D '00') {
sec= =3D "00";
window.clearTimeout(SD);
document.getElementById(&=#39;div_countdown').innerHTML =3D 'SiteMinder has logged you out !&=#39;;
win=dow.alert('SiteMinder has logged you out !');
window.location =3D= "/admin/logout.tmpl";
}
}<=/div>
-- =C2=A0Countdown js ends