
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<html>
<head>
<title>panorama</title>
<style>
body{ font-family:Arial, Helvetica, sans-serif; font-size:10px; color:#FFFFFF; background-color:#111111; margin:0; padding:0; }
* html, * html body{ overflow: hidden; }
a{ color:#AAAAAA; text-decoration:underline; }
a:hover{ color:#FFFFFF; text-decoration:underline; }
</style>
</head>
<body>
<div id="krpanoDIV">
<noscript><table width="100%" height="100%"><tr valign="middle"><td><center>ERROR:<br/><br/>Javascript not activated<br/><b/r></center></td></tr></table></noscript>
</div>
<script type="text/javascript" src="inc/swfkrpano.js"></script>
<script type="text/javascript">
var swf = createswf("inc/krpano.swf", "krpanoSWFObject", "100%", "100%");
swf.addVariable("xml", "pano.xml");
swf.addVariable("qtvr", "pano/<?php echo $_GET['pano']; ?>.mov");
swf.addVariable("setview", "true");
swf.addVariable("progress.showwait", "none");
swf.addVariable("progress.showload", "none");
swf.embed("krpanoDIV");
</script>
</body>
</html>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// KRPANO SHORTCODE
// Sam Rohn http://www.samrohn.com
// usage: [krpano file="pano-name" title="Pano Title"]
function panorama($attributes, $content='') {
extract(shortcode_atts(array(
'file' => '',
'title' => ''
), $attributes));
return '<div><a href="'.get_bloginfo('url').'/wp-content/panorama/pano.php?pano='.$file.'" title="'.$title.'" target="_blank" class="">
<img class="pano" src="'.get_bloginfo('url').'/wp-content/panorama/pano/'.$file.'.jpg" alt="'.$title.'"/></a></div>
<div align="center"><p>Click on Image to view 360° VR Panorama of '.$title.'</p></div>';
}
add_shortcode(krpano, 'panorama');
// END KRPANO SHORTCODE
|
Dieser Beitrag wurde bereits 33 mal editiert, zuletzt von »Sam Rohn« (27. August 2012, 10:32)
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com
Zitat
I just picked up a copy of KRPano and thought I would take a try at your shortcode tutorial and I'm a bit stuck. Hope you don't mind helping out, I'm not so fluent with and serious coding, but I get the logic.
So far I have created 3 directories: panorama, pano and inc
Inside of Panorama I have the "inc" and "pano" directories, and two loose files: pano.php (copied content from your post), and ?????pano.xml???? where do I get this?
Inside of the inc directory I have placed the the example.jpg, example.mov files I created in Pano2VR.
Inside of the pano folder, I have put my krpano.license, and swfkrpano.js (from my copy of KRPano), and ?????krpano.swf???? I tried the one found in Panotools folder?
I found the location of my wordpress installations functions.php but when trying to add the code you suggest to add to the functions.php file, it breaks the installation due to this line
add_shortcode(krpano, 'panorama');
I guess there are three main things I don't understand. 1) where the pano.xml file comes from or what it should contain. 2) the proper edit procedures to the functions.php file (3) in the beginning of your post, you state "the shortcode is used like this - [krpano file="pano-name" title="Panorama Title"]" yet I'm not sure where I should use this code??
I am using a Wordpress installation that I don't care much about so I can rip and tear at it!!
Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von »Sam Rohn« (11. November 2010, 07:51)
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// KRPANO SHORTCODE
// Sam Rohn http://www.samrohn.com
// usage: [krpano file="pano-name" title="Pano Title"]
function panorama($attributes, $content='') {
extract(shortcode_atts(array(
'file' => '',
'title' => ''
), $attributes));
return '<div id="test"><iframe src="'.get_bloginfo('url').'/wp-content/panorama/pano.php?pano='.$file.'" marginheight="0" width="100%" height="100%" marginwidth="0" frameborder="0" class="iframe" scrolling="no"></iframe>
</div>
';
}
add_shortcode(krpano, 'panorama');
// END KRPANO SHORTCODE
|
|
|
Quellcode |
1 2 |
swf.addParam("allowFullScreen","true");
swf.addParam("wmode","transparent");
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
in head section add this -
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
add these to swf vars -
swf.addVariable("image.mobile.left.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_iphone_l.jpg");
swf.addVariable("image.mobile.front.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_iphone_f.jpg");
swf.addVariable("image.mobile.right.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_iphone_r.jpg");
swf.addVariable("image.mobile.back.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_iphone_b.jpg");
swf.addVariable("image.mobile.up.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_iphone_u.jpg");
swf.addVariable("image.mobile.down.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_iphone_d.jpg");
swf.addVariable("image.tablet.left.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_ipad_l.jpg");
swf.addVariable("image.tablet.front.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_ipad_f.jpg");
swf.addVariable("image.tablet.right.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_ipad_r.jpg");
swf.addVariable("image.tablet.back.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_ipad_b.jpg");
swf.addVariable("image.tablet.up.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_ipad_u.jpg");
swf.addVariable("image.tablet.down.url", "pano/<?php echo $_GET['pano']; ?>/<?php echo $_GET['pano']; ?>_ipad_d.jpg");
|
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Sam Rohn« (20. November 2010, 04:35)
Zitat
[krpano file="pano-file-name" title="Panorama Title" xml="path/my-custom-xml.xml"]
Zitat
// KRPANO XML SHORTCODE TEST
// Sam Rohn http://www.samrohn.com
// usage: [krpano file="pano-name" title="Pano Title"]
function panorama($attributes, $content='') {
extract(shortcode_atts(array(
'file' => '',
'title' => ''
'xml' => 'my-default-xml.xml'
), $attributes));
return '<div id="test"><iframe src="'.get_bloginfo('url').'/wp-content/panorama/pano.php?pano='.$file.'&xml='.$xml.'" marginheight="0" width="100%" height="100%" marginwidth="0" frameborder="0" class="iframe" scrolling="no"></iframe>
</div>
';
}
add_shortcode(krpano, 'panorama');
// END KRPANO XML SHORTCODE TEST
Zitat
swf.addVariable("xml", "<?php echo $_GET['xml']; ?>");
Dieser Beitrag wurde bereits 12 mal editiert, zuletzt von »Sam Rohn« (13. Januar 2011, 04:01)
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Sam Rohn« (20. Januar 2011, 19:10)