This post is to summarise the various replies in the original post on slideshow test. Please refer here for the latest update on the Unofficial slideshow feature. A big "Thanks You" to Karthik (yardbird) for kickstarting the whole activity and Arjun (arjunrc) for some great codes and suggestions.
Usage
There are two ways to add a slideshow to your gallery. The first provides an inline slideshow that is visible to the user as soon as they enter the gallery and the other method requires them to click (a link or an image) to launch the slidshow.
Inline method
For this method, use the code below as the starting point. Copy-paste it into your gellery's description field and enable 'html flag'.
- Code: Select all
<center>
<iframe frameborder="0px" style="border:0px" width="460" height="450" src="http://www.srijith.net/pbase/slideshow.cgi?user=USER&gallery=GALLERY_NAME()&delay=DELAY&color=COLORCODE&title=TITLE&size=SIZE&maxwidth=MAXWIDTH&maxheight=MAXHEIGHT">
<!-- Alternate content for non-supporting browsers -->
<h2>Your browser does not support the technology needed for this slideshow.</h2>
</iframe>
</center>
Then make the following changes to suit your needs:
- Change USER to your username
- Change DELAY to the number of seconds delay you would like between slides (minimum is 3 seconds)
- Change COLORCODE to the Hexadecimal color code that is used for your gallery backrgound (example ffffff for white, 000000 for black)
- Change TITLE to 1 if all your gallery images have titles or 0 if they do not. 0 is assumed if not set explicitly
- Change SIZE to 'medium', 'large' or 'auto'. If you choose 'large' make sure that all images in the gallery does indeed have a large sized image. Choose 'auto' if you have panoramic image in your gallery. If nothing is specified, 'medium' is assumed.
- Change MAXWIDTH and MAXHEIGHT to the the maximum value of the width and height of the images in your gallery at the SIZE you selected. If not specified they are assumed to be 400 and 300 (if SIZE is medium) or 800 and 600 (if SIZE is large or auto).
- If you see scrollbars when you view the gallery, change the values 460 and 450 to larger values.
An example code that renders this slideshow is:
- Code: Select all
<center>
<iframe frameborder="0px" style="border:0px" width="460" height="450" src="http://www.srijith.net/pbase/slideshow.cgi?user=srijith&gallery=GALLERY_NAME()&delay=3&color=4d4d4d&title=1&size=medium&maxwidth=400&maxheight=300">
<!-- Alternate content for non-supporting browsers -->
<h2>Your browser does not support the texhnology needed for this slideshow.</h2>
</iframe>
</center>
Extra-click method
For this method, use the code below as the starting point. Copy-paste it into your gellery's description field and enable 'html flag'
- Code: Select all
<center><a href='javascript:doslide()'><img src="http://www.srijith.net/pbase/ss-img/ss.jpg" /></a></center>
<script language="JavaScript1.2">
function doslide()
{
document.write('<html><head></head><body bgcolor=#COLOR>')
document.write('<center>')
document.write('<iframe frameborder="0px" style="border:0px" width="500" height="500" src="http://www.srijith.net/pbase/slideshow.cgi?user=USER&gallery=GALLERY_NAME()&delay=DELAY&color=COLOR&title=TITLE&size=SIZE&maxwidth=MAXWIDTH&maxheight=MAXHEIGHT">');
document.write('<h2>Your browser does not support the technology needed for this slideshow.</h2>')
document.write('</iframe> </center></body></html>')
}
</script>
Then make the following changes to suit your needs:
- Change USER to your username
- Change DELAY to the number of seconds delay you would like between slides (minimum is 3 seconds)
- Change COLORCODE to the Hexadecimal color code that is used for your gallery backrgound (example ffffff for white, 000000 for black)
- Change TITLE to 1 if all your gallery images have titles or 0 if they do not. 0 is assumed if not set explicitly
- Change SIZE to 'medium', 'large' or 'auto'. If you choose 'large' make sure that all images in the gallery does indeed have a large sized image. Choose 'auto' if you have panoramic image in your gallery. If nothing is specified, 'medium' is assumed.
- Change MAXWIDTH and MAXHEIGHT to the the maximum value of the width and height of the images in your gallery at the SIZE you selected. If not specified they are assumed to be 400 and 300 (if SIZE is medium) or 800 and 600 (if SIZE is large or auto).
- If you see scrollbars when you view the gallery, change the values 500 to larger values.
An example code that renders this slideshow is:
- Code: Select all
<center><a href='javascript:doslide()'><img src="http://www.srijith.net/pbase/ss-img/ss.jpg" /></a></center>
<script language="JavaScript1.2">
function doslide()
{
document.write('<html><head></head><body bgcolor=#4d4d4d>')
document.write('<center>')
document.write('<iframe frameborder="0px" style="border:0px" width="500" height="500" src="http://www.srijith.net/pbase/slideshow.cgi?user=srijith&gallery=GALLERY_NAME()&delay=3&color=4d4d4d&title=1&size=auto&maxwidth=400&maxheight=300">');
document.write('<h2>Your browser does not support the technology needed for this slideshow.</h2>')
document.write('</iframe> </center></body></html>')
}
</script>
Which to use?
The inline method involves one less click. However it will use up some space for the slideshow even if the viewer is not interested in the slideshow. The other method does involve one more click but it does not impose the slideshow area onto viewers.
Caveat
1. The slideshow feature will not work in passphrase protected galleries.
2. Setting title=1 when all images in the gallery does not have a title will render the slideshow unuseable.
3. I have no idea if non-english characters (Chinese, Japanese etc.) will create problems with the script.
4. The slideshow will not work on a multipage gallery.
5. The script performs server side caching to reduce load. Due to the way this caching works, I (owner of srijith.net on which the script runs) am in the position to see which galleries are using the slideshow feature. This list would also include 'non public' galleries. However, I assure you that I do not have any intention to poke my nose around galleries that have been made non-public. Not enough hours in the day
6. Because of the use of caching (to reduce server loads), any new image you may add to a gallery will not show in the slideshow until after about 2 hours (max as of now). After that 2 hours, the cache will expire and the new image will be added into the slideshow.
New features
There being only 24 hours in a day, it would be very difficult for me to make more changes to the script to accomodate new features. So unless you are good at hacking Perl (source code provided below), those request will not most probably be fulfilled. If you can hack Perl and have modified it to do more stuff, send it to me and I'll be happy to use the modification as long as it does not break any previous functionalities.
Disclaimer
This is not an official PBase feature. If it does not work, do not email Slug or Emily or anyone else related to PBase as they can't do anything about it! Post a reply in this thread and some of us will try our best to help you out. No assurances though. If it breaks, all I can guarantee you is that you get to keep the pieces
Source Code
Removed because of some licensing issues.
Change history
v 1.1 (2-Nov-2005)
----------
Added size, maxwidth and maxheight parameters.
Source code released.
v 1.0 (2-Nov-2005)
---------
Initial document