Hello everybody,
I wonderer if it was possible with krp, to get the host webserver date, and create krpano actions with it..?
Just something like display some plugins at one date or another...
Thank you!
regards,
Xavier
Hello everybody,
I wonderer if it was possible with krp, to get the host webserver date, and create krpano actions with it..?
Just something like display some plugins at one date or another...
Thank you!
regards,
Xavier
you could let krpano execute a js function, which returns the date
http://www.mediacollege.com/internet/javascript/date-time/
then do an if statement to do some actions.
Seems interesting,
i have some developement techniques limits..
Does these lines to be inserted in the html code, or in the swfkrpano.js?
Thanks!
<krpano>
<events onxmlcomplete="parsedate()" />
<action name="parsedate">
js(get_date());
if(get(day) == '24',
if(get(month) == '02',
if(get(year) == '2011',
trace('Jeej, today is 24-02-2011');
);
);
);
</action>
</krpano>
Display More
html:
function get_date()
{
var krpanoObj = document.getElementById('krpanoSWFObject');
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
krpanoObj.set('day', day);
krpanoObj.set('month', month);
krpanoObj.set('year', year);
}
Display More
Sorry Im a bit rusty with xml if statements, so mind the typos. But you get the idea :)
btw this gets the users date, webservers date probally needs serverside script like php http://php.net/manual/en/function.date.php
Thank you very much Zephyr,
i'll try it immediatly!
Hello,
well, it seems that i can't configure this code to my files..
i will take a look better next week...
Thank you very much!
:)
Xavier
Don’t have an account yet? Register yourself now and be a part of our community!