Hi,
I have set an expire date via krpanotools, is there anyway I can show this in the context-menu or call it as a variable?
Thanks!
Hi,
I have set an expire date via krpanotools, is there anyway I can show this in the context-menu or call it as a variable?
Thanks!
Hi,
there is currently no API to access the expire date, but I will consider one of the next releases.
Best regards,
Klaus
Hi, Klaus this feature is very important. Now the only option is to link to Website. Another option as: "Message to show when expired" would be very good.
Best Regards,
Fernando.
Fernando, you can already do that. Just set a variable with the value of expiration and check if current time is lower or bigger...
Thanks Jordy, this is very important for me.
Just set a variable with the value of expiration and check if current time is lower or bigger...
Where is that info? How to get that variable? Any example please.
Greets,
Fernando
Where is that info? How to get that variable? Any example please.
Just add it to the skin_settings variables:
If you want a message to appear add a textfield and display it there.
Thanks Scott and Jordy,
1) Is there any krpano current date variable or it is javascript variable?
2) The idea is before to load the complete project, check this var: if the date expired then show message, if not run normally?
Greets,
Fernando
Pretty sure you need to do a js call to get the system date.
You should use unix time, so if you don't want to make it dynamic go this web page and transform your expiration date into unix timesatamp
https://www.unixtimestamp.com/
then set in your krpano tag the expirationDate atribute
then it comes the action that you will probably need to execute on start
<action name="checkExpiration" type="javascript"><![CDATA[
var expirationDate = krpano.get("expirationDate");
var currentTime = new Date().getTime()/1000; // UNIX TIME IN SECONDS
if (currentTime > expirationDate) {
doSomething(); // Javascript Action
// or
krpano.call("myKrpanoAction()");
}
]]></action>
Alles anzeigen
Thanks Jordi, your example is very usefull. It works fine
Greets,
Fernando
Fernando,
This code does not check expiration date but installation version of krpano but may be useful, too. Just set the expire_date before.
<!-- krpano version check -->
<action name="combobox_versioncheck" autorun="preinit">
if(build LT '2017-09-13',
error('combobox.xml - too old krpano version!');
set(events[combobox_xml_plugin_events].name, null);
set(action[addComboboxLayer].content, '');
set(action[removeComboboxLayer].content, '');
);
</action>
It is located in the krapno examples ..\krpano\krpano-1.19-pr16-win\viewer\plugins\combobox.xml file.
Regards,
Pavel
Thanks Pavel,
if(build LT '2017-09-13',
in this case, the problem is how to get the current date in krpano ... Do you know how?
Greets,
Fernando.
Hi Fernando,
Here is the action
<!-- Expiration check -->
<action name="check_expire" scope="localonly" args="exp_date">
jsget(today, 'new Date().toISOString().slice(0,10);');
trace('Today is ', get(today));
if(today GT exp_date,
//your actions here e.g.:
error('Sorry, your creditcard has expired!');
);
</action>
and the call is:
Regards,
Pavel
Thanks Pavel, very good solution!
Greets,
Fernando
Hi Klaus,
Has anything changed with regard to the set expiry date (with the krpanotools) with version 1.20? Can we read it or do we still need to use the workaround as described in the thread?
Kind regards
Hi,
yes, it is exposed now as '_krpanolicense.expiredate' variable and has the format "YYYY-MM-DD".
Best regards,
Klaus
YES! Perfect, thanks!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!