You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

joekki

Trainee

  • "joekki" started this thread

Posts: 78

Location: Turku, Finland

Occupation: Panoramic photographer and web site builder

  • Send private message

1

Wednesday, June 10th 2009, 6:31pm

Opening current URL from the XML (for Facebook etc.)

Is it possible to make something like this:


Source code

1
2
3
4
5
6
7
8
<plugin name="facebook"
url="facebook_logo.png"
align="rightbottom"
onhover="showtext(Add this to Facebook);"
onclick="openurl('http://www.facebook.com/sharer.php?u='+location.href+'&amp;t='+document.title);"
x="10"
y="10"
/>


That's not obviously working, but that's the idea: Opening the current URL so you could add that to Facebook etc. Can I call my own Javascript commands or use some variables that I pass via the SFW call etc?

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

2

Thursday, June 11th 2009, 3:12am

I'm not sure what your question is... I have some ideas... but if you could try to clarify what you want to do and from where you are trying to do it we can help you better. *g*

Do you want to make some type of "share this" link that works with facebook?
- there's a commercial swf app that someone found on flashden that seems to work.

Do you want to embed your pano in facebook?
- I've used clearspring as well as the fb developer tools to do this

Let us know.

Graydon

joekki

Trainee

  • "joekki" started this thread

Posts: 78

Location: Turku, Finland

Occupation: Panoramic photographer and web site builder

  • Send private message

3

Thursday, June 11th 2009, 8:53am

I'm not sure what your question is...
:D Heh, sorry about the unclear question. I want the "Share this" button, and I was thinking that can I use the current URL in the "onclick"-event.

- Juha

nelk

Intermediate

Posts: 358

Location: Paris

  • Send private message

4

Thursday, June 11th 2009, 10:36am

Hi,

Do you want to make some type of "share this" link that works with facebook?
- there's a commercial swf app that someone found on flashden that seems to work.


Someone here in this forum ?

Thanks
VideoStitch, a video stitching engine / blog sur les visites virtuelles ( french ).

joekki

Trainee

  • "joekki" started this thread

Posts: 78

Location: Turku, Finland

Occupation: Panoramic photographer and web site builder

  • Send private message

5

Thursday, June 11th 2009, 11:40am

Of course, there's one way to do it without altering the XML etc. by modifying your template and using for example 5% of the bottom space for links etc.

But then you lose that 5% from the viewing space of the panorama and I don't want that. :)

Second way would be making a redirect site: like www.example.com/facebook-redirector.php and there we can do like:

Source code

1
2
3
<?php
header('Location: http://www.facebook.com/sharer.php?u='.urlencode($_SERVER['HTTP_REFERER']));
?>

etc? (note: that's just an example, haven't tested it. :D

Then you just make your button to the XML and open redirector url from the link? right?

Graydon

Professional

Posts: 614

Location: Texas

Occupation: Industrial gas turbine services.

  • Send private message

6

Friday, June 12th 2009, 3:04am

pixelcase did it here

I was thinking that someone else did it also... but I can't find it right now.

7

Monday, June 15th 2009, 4:14pm

That's not obviously working, but that's the idea: Opening the current URL so you could add that to Facebook etc. Can I call my own Javascript commands or use some variables that I pass via the SFW call etc?
Hi,

yes, both is possible,
you could either make a javascript function and call it from krpano,

e.g.
XML:

Source code

1
.. onclick="js( add_to_facebook() );"


HTML/JS:

Source code

1
2
3
4
function add_to_facebook()
{
  window.location='http://www.facebook.com/sharer.php?u='+location.href+'&amp;t='+document.title;
}



or pass the full facebook url to krpano and open it from there,

HTML/JS:

Source code

1
so.addVariable("add_to_facebook_url", ....);


XML: (krpano 1.0.8 beta 8 needed for this!)

Source code

1
... onclick="openurl( get(add_to_facebook_url) );" 



best regards,
Klaus