Social Networks Bookmarks

  • Hi Guys,

    I'm trying to automate a process to link each pano to several social networks like facebook, twitter, etc.


    Here is what i have now:

    Code
    <plugin name="facebook" keep="false" url="icon-facebook.png"
             align="bottom left" edge="bottom left" x="80" y="12" scale="0.13" alpha="1"
       onhover="tween(scale,0.15,0.1); showtext(Facebook, text)"
       onout="tween(scale,0.13,0.1);"
       onclick="url(window.location='http://www.facebook.com/sharer.php?u=http://www.MYDOMAIN.com/MYPANO.html)"
       zorder="100"
             />


    Same for myspace:

    Code
    <plugin name="myspace" keep="false" url="icon-myspace.png"
             align="bottom left" edge="bottom left" x="160" y="12" scale="0.13" alpha="1"
       onhover="tween(scale,0.15,0.1); showtext(Myspace, texto)"
       onout="tween(scale,0.13,0.1);"
       onclick="url(http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.MYDOMAIN.com/MYPANO.html )"
       zorder="100"
             />

    How can I automate the process in order to have krpano get my actual web adress and keep the same code to every xml i make?

    Thanks in advance!

    Daniel

  • Hi,

    there are two ways:

    1. you can put the same attributes in the <style> tag and set - style="stylename" - in the plugin,
    e.g.

    Code
    <krpano .... baseurl="www.MYDOMAIN.com/MYPANO.html">
    <style name="basicstyle" align="bottom left" edge="bottom left" y="12" scale="0.13" alpha="1" onover="tween(scale,0.15,0.1);" onhover="showtext(get(title), text);" onout="tween(scale,0.13,0.1);" "zorder="100"/>
    <plugin name="facebook" title="Facebook" url="icon-facebook.png" style="basicstyle" x="80" onclick="txtadd(dsturl,
    'http://www.facebook.com/sharer.php?u=http://',get(baseurl)); openurl(get(dsturl));" />
    <plugin name="myspace" title="Myspace" url="icon-myspace.png" style="basicstyle" x="80" onclick="txtadd(dsturl,
    'http://www.facebook.com/sharer.php?u=http://',get(baseurl)); openurl(get(dsturl));" />

    2. or build the buttons completely dynamically via an action:

    best regards,
    Klaus

Jetzt mitmachen!

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