Hey!
I'm almost done writing a new ZenPhoto theme tailored to showing HTML5 and Flash virtual panoramas. One last thing I need to get working is panorama hotspots. When I open a pano from the album-pano.php page everything works fine - the image-pano.php page is loaded, the title and description of the "image" are shown and the panorama plays in the <div id="#container">. Javascript from Pano2VR targets the #container and puts the panorama there.
http://i.imgur.com/69My6oz.jpg
The problem is that when a user clicks on the door hotspot to go to the next panorama, that is handled by the javascript from Pano2VR which then replaces the contents of #container with the new pano. That's no good, because the name and description of the pano on my page outside of #container remains from the previous one.
I want to use hotspot urls relative to the current image (the whole tour resides in one album) so that I can then rename the album and parent albums without worrying about breaking links, otherwise if I use absolute URLs I'm in for a lot of work if I want to rename a parent album, I'd have to edit every pano's XML file which contains the hotspot URLs.
I think I solved the problem, unfortunately when a user clicks on the door, instead of getting taken to
http://127.0.0.1/zp/Panoramas/House%20of%20Karin/Foyer.txt
which works, they get taken to
http://127.0.0.1/zp/albums/Panoramas/House%20of%20Karin/Foyer.txt
which does not work, because of the "albums".
Even though the URL in the web browser is
http://127.0.0.1/zp/Panoramas/House%20of%20Karin/Porch.txt
(notice no "albums"), getUnprotectedImageURL() indeed shows
/zp/albums/Panoramas/House of Karin/Porch.txt
(with "albums") for this working URL, and getImageURL() shows
/zp/Panoramas/House%20of%20Karin/Porch.txt
I guess the .htaccess file does some magic here.
When a user clicks on a hotspot, the browser URL shows
http://127.0.0.1/zp/albums/Panoramas/House%20of%20Karin/Foyer.txt
with "albums", and that shows the contents of the txt file instead of loading the Foyer panorama.
If I remove the "albums/" part from that URL in the browser, it works and shows the pano, not the contents of Foyer.txt
Please help getting htaccess to remove "albums/" from the URL if it contains it.
/zp/.htaccess
# htaccess file version 1.4.5;
# Rewrite rules are now handled by PHP code
# See the file "zenphoto-rewrite.txt" for the actual rules
#
# These rules redirect everything not directly accessing a file to the Zenphoto index.php script
#
<IfModule mod_autoindex.c>
IndexIgnore *
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /zp
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*/?$ index.php [L,QSA]
</IfModule>