Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #11  
Old 01-14-2011, 03:59 PM
davide73 davide73 is offline
Junior Member
 
Join Date: Dec 2010
Posts: 6
Downloads: 3
Uploads: 0
Default

That could be a solution, but I would have to create temp xml files for each user, it's a little tricky, it would be possible to trigger a custom fpp function on the first load, passing the function name encoded in the url.
I found a workaround that almost works, as I described it to you here

thanks again
Reply With Quote
  #12  
Old 04-12-2011, 04:12 PM
gr.panorama gr.panorama is offline
Member
 
Join Date: Jul 2010
Location: Greece
Posts: 33
Downloads: 1
Uploads: 0
Default parse a parameter that contains the name of the starting pano

Quote:
Originally Posted by allSaints View Post
Hi Bober,

as you are using javascript to embed your FPP pano, you can also use javascript to parse a parameter that contains the name of the starting pano:

example URL: http://domain_name.com/path/nam.html?startpano=hotel3


Code:
...
<script type="text/javascript">
var startPano = getParm("startpano");

var so = new SWFObject("hotel.swf", "pano", "100%", "100%", "9", "#40373a");
so.addVariable("panoName",startPano);
so.addVariable("xml_file","hotel.xml");
so.addVariable("filepath", getQueryParamValue("filepath"));
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
window.document["pano"].focus();

function getParm( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}
</script>
...
So, by including the code above in your web page, you can choose your starting pano simply by changing the parameter in your url.

Regards,
Tommy
Hello Tommy,
I ve been trying this option but it keeps loading the default pano
a link :
http://hellaspanorama.gr/hosted/expo...pano=images/19

and the embed code:

Code:
<script type="text/javascript">
var startPano = getParm("startpano");

var so = new SWFObject("pano.swf", "pano", "100%", "100%", "9", "#40373a");
so.addVariable("panoName",startPano);
so.addVariable("xml_file","pano.xml");
so.addVariable("filepath", getQueryParamValue("filepath"));
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
window.document["pano"].focus();

function getParm( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "default_pano_name";
  else
    return results[1];
}
</script>
I tried renaming pano.swf and pano.xml, and replacing "filepath" with the panoramas directory without success.
Can't figure out where I' m wrong.
Any help would be much appreciated

Thanks,
Minnos
Reply With Quote
  #13  
Old 04-14-2011, 08:20 PM
EnochTwig EnochTwig is offline
Junior Member
 
Join Date: Nov 2010
Posts: 10
Downloads: 0
Uploads: 0
Default

gr.panorama:

Unless I'm mistaken, getQueryParamValue("filepath") gets a parameter from the URL string, similarto getParm, so you need to have a value in the URL like:


http://hellaspanorama.gr/hosted/expo...pano=images/19&filepath=my/file/path


Although I've never seen any 'filepath' parameter for FPP so I'm not really sure what it's supposed to be doing.
Reply With Quote
  #14  
Old 04-14-2011, 08:39 PM
gr.panorama gr.panorama is offline
Member
 
Join Date: Jul 2010
Location: Greece
Posts: 33
Downloads: 1
Uploads: 0
Default

Thanks for your reply,

http://hellaspanorama.gr/hosted/expo...ilepath=images
or
http://hellaspanorama.gr/hosted/expo...ilepath=images


does not seem to solve it

Minos
Reply With Quote
  #15  
Old 04-16-2011, 12:45 AM
gr.panorama gr.panorama is offline
Member
 
Join Date: Jul 2010
Location: Greece
Posts: 33
Downloads: 1
Uploads: 0
Default

Anyone has used it successfully? A link to a working example would be really helpfull.
Reply With Quote
  #16  
Old 08-17-2011, 01:31 PM
gr.panorama gr.panorama is offline
Member
 
Join Date: Jul 2010
Location: Greece
Posts: 33
Downloads: 1
Uploads: 0
Default

sorted out.....
Quote:
<parameters>panoname=images/00</parameters>
and
Quote:
<global onStart="loadPano(panoName=images/00&amp;pan=80&amp;tilt=0&amp;zoom=0.6);"</global>
had to be removed, having an initial or an onStart pano would not let starting panorama to be changed from url.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 06:53 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.