Sie sind nicht angemeldet.

1

Donnerstag, 31. Mai 2018, 11:59

show expiry date

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!

2

Freitag, 1. Juni 2018, 22:03

Hi,

there is currently no API to access the expire date, but I will consider one of the next releases.

Best regards,
Klaus

Fernando

Fortgeschrittener

Beiträge: 185

Wohnort: Habana, Cuba

Beruf: Architect, Photographer, Programmer.

  • Nachricht senden

3

Montag, 2. Juli 2018, 15:43

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.

jordi

Fortgeschrittener

Beiträge: 421

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

4

Montag, 2. Juli 2018, 21:28

Fernando, you can already do that. Just set a variable with the value of expiration and check if current time is lower or bigger...
everpano.com smart virtual tours

Fernando

Fortgeschrittener

Beiträge: 185

Wohnort: Habana, Cuba

Beruf: Architect, Photographer, Programmer.

  • Nachricht senden

5

Dienstag, 3. Juli 2018, 16:44

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

Scott Witte

Fortgeschrittener

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

6

Freitag, 6. Juli 2018, 04:11

Where is that info? How to get that variable? Any example please.

Just add it to the skin_settings variables:

Quellcode

1
2
3
4
5
<skin_settings
      expiry="######"
      gyro="true"
      ....
/>

If you want a message to appear add a textfield and display it there.

Fernando

Fortgeschrittener

Beiträge: 185

Wohnort: Habana, Cuba

Beruf: Architect, Photographer, Programmer.

  • Nachricht senden

7

Montag, 9. Juli 2018, 15:45

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

Scott Witte

Fortgeschrittener

Beiträge: 221

Wohnort: Milwaukee, WI USA

Beruf: Professional Photographer

  • Nachricht senden

8

Montag, 9. Juli 2018, 17:18

Pretty sure you need to do a js call to get the system date.

jordi

Fortgeschrittener

Beiträge: 421

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

9

Mittwoch, 11. Juli 2018, 07:17

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

Quellcode

1
<krpano expirationDate="1594451340" onstart="checkExpiration();" >


then it comes the action that you will probably need to execute on start

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
<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> 
everpano.com smart virtual tours

Fernando

Fortgeschrittener

Beiträge: 185

Wohnort: Habana, Cuba

Beruf: Architect, Photographer, Programmer.

  • Nachricht senden

10

Mittwoch, 25. Juli 2018, 06:31

Thanks Jordi, your example is very usefull. It works fine *thumbsup*
Greets,
Fernando

11

Mittwoch, 25. Juli 2018, 18:49

Fernando,
This code does not check expiration date but installation version of krpano but may be useful, too. Just set the expire_date before.

Quellcode

1
2
3
4
5
6
7
8
9
	<!-- 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

Fernando

Fortgeschrittener

Beiträge: 185

Wohnort: Habana, Cuba

Beruf: Architect, Photographer, Programmer.

  • Nachricht senden

12

Donnerstag, 26. Juli 2018, 21:09

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.

13

Samstag, 28. Juli 2018, 13:07

Hi Fernando,
Here is the action

Quellcode

1
2
3
4
5
6
7
8
9
	<!-- 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:

Quellcode

1
check_expire('2017-12-31');


Regards,
Pavel

Fernando

Fortgeschrittener

Beiträge: 185

Wohnort: Habana, Cuba

Beruf: Architect, Photographer, Programmer.

  • Nachricht senden

14

Samstag, 28. Juli 2018, 14:52

Thanks Pavel, very good solution! *thumbsup*
Greets,
Fernando