• Hello there,

    I know that you can protect the krpano projects with 'panorama expires'.
    But this have to be a swf, app or exe.

    Is it possible to do the same with html 5 version ?

    I want to give a test version to a client to put it on his iPad, but I want it to be available for only a few weeks.

    Thanks for your reactions !
    =servaas=

  • if the client isnt too Techsmart, you could do this simply with javascript

    Code
    var currentTime = new Date();
    var enddate= new Date(2011, 12, 12); 
    
    
    if(currentTime =< enddate){
      embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano"});
    }

    not 100% sure about the code, my date object knowledge is rusty

    And if you use a packer like:
    http://dean.edwards.name/packer/

    It would be harder to decode it.

  • updated version. This one works

    Code
    var currentTime = new Date();
    		var enddate= new Date(2011, 10, 12); 		
    		var enddate_reached =  currentTime >= enddate;
    
    
    		if(!enddate_reached){
    			embedpano({swf:"player/tour.swf", xml:"tour-001/virtualtour.xml", target:"pano"});
    		}

    Alsoo the format is year, month, day. And you have to subtract one of the month, so november would be 10, oktober 9.

    If I pack the code, it becomes:

    Code
    eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[code=c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[code=c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[code=c]);return p}('0 1=2 3();0 4=2 3(9,a,b);0 5=1>=4;c(!5){d({6:"e/7.6",8:"7-f/g.8",h:"i"})}',19,19,'var|currentTime|new|Date|enddate|enddate_reached|swf|tour|xml|2011|10|12|if|embedpano|player|001|virtualtour|target|pano'.split('|'),0,{}))

    And that works too :)

    btw, this uses the date object in javascript, meaning its clientside. the client could adjust his clock and it would still run. Best practice would be php, wich is almost the same code

  • swfkrpano.js is for instance alsoo packed. It basicly removes all the logical names and replaces them with a,b,c,d,e etc and then uses an eval function that runs a scrammbled code.

    You put this in your html.

    or

    mind you the packed code in the above example is specific for my example (with player/tour.swf etc) you have to pack your own code ;)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!