Welcome Guest [Log In] [Register]
Team SILO Forum

Forum Quick Links

Forum Rules

Staff Team

Introduce Yourself

Team SILO Wiki

Main Page


Follow Us!

Twitter

Facebook

Stumble Upon

Delicious

Digg

Myspace

Youtube
Video Of The Month


[ Click Here! ] For Full Download and Feedback


Team SILO Lead Staff

[DemonDog]
Founder/Lead Designer/Admin

[Vulcan]
Founder/Global Moderator

[HJKDillon]
Global Moderator

[Reapertura]
Global Moderator

[hawksghetto]
Global Moderator


AV Team

[xXd34thm3t4131fXx]

Welcome to Team SILO. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Simple Image Viewer; ~Easy Set-up~
Topic Started: Apr 16 2010, 11:21 AM (373 Views)
DemonDog
Member Avatar
~Speedy Silence~
1. Troubleshooting - add ?diag after your script when calling it (e.g. phpshow.php?diag) to get some diagnosis for common problems.

2. Parameters (like 15 pics per page and the times used for blending) can be changed easily, just open the php file with a text editor and have a look at the first few lines. Important parameters are:

Code:
 

$GD_WORKAROUND="";//set this to "oldGD" or "newGD" to switch off automatic GD version detection
//set to "oldGD" if you experience any trouble with the browse mode!

$browsertitle="Image browser";
$slidetitle= "Slideshow";

$autoplay= true; //Shall presentation start automatically in slideshow mode?
$stopOnMouseOver=false;//Shall playing be interrupted while the mouse is over a photo (slideshow mode)?

$imgsperline=5; //5 rows
$maxperpage=$imgsperline*3; //3 columns

$thumbQuality=90; //jpeg compression of thumbs (0 worst, 100 best quality but also largest size)
$resample=true; //resample images when creating thumbs - set to true if you have
//a fast server as quality is a lot better, but takes a bit of processing

$lang="auto"; //"auto": use preferred language if available or English if we don't have a translation for the preferred language
//for one fixed language this can also be set to "English" or "German" or "Swedish" or "Dutch" or "Norwegian" or
//"Portuguese" or "French" or "Russian" or "Spanish" or "Italian"


$basePath="./"; //use "." for browsing current directory
//or for example "./photos" to browse subdir photos
$preloadForward=4;//how many pictures do you want to preload ahead?

$useFading =true; //do you want to blend between images? - Especially if you expect many people with old
//PCs to access your page you might want a false here. N.B.: Fading does not work in oldGD mode!
$fadeMode =rand(0,3);//0:classic, 1:right-to-left, 2:left-to-right, 3:square fading type
$fadeColor =255; //fade to this grey tone [e.g. 255 is #FFFFFF, 0 equals #000000]
$fadeSteps =4; //how many shade levels for fadeing
$fadeTime =70; //milliseconds for one shade level
//(i.e. overall fade time = $fadeSteps*$fadeTime;
// overall fade time must not be bigger than 1200!)

$startFit =true; //shall the slideshow initially fit images to screen or show the actual size
$allowZip =true; //set to false if you do not want to make it easy for people to get
//your photos or save bandwith

$aftertext ="<div class=\"smallprint\" align=\"center\"><font size=\"2\">If you are shown on a picture and don't want this let me know and I will remove it.<br/>
<i>This page is autogenerated, get the script <a target=\"_blank\" href=\"http://phpshow.panmental.de/\">here</a></i>.</font></div>";
//comes after the rest of the page at the bottom
//Some kind of disclaimer is surely useful and I would really
//very much appreciate it if you let people where they can
//get this script, but it's up to you if and where to do it.

$wiwiMargin=50; //the space reserved around the currently displayed picture in
$wiheiMargin=123; //auto-fit slideshow mode (width/height), might need to be
//bigger if you have free webspace with autogenerated advertisments.


3. A simple way to personalize the page design is to create your own stylesheet. When you open the php file one of the first lines is this one:
$stylesheet="<link rel=\"stylesheet\" type=\"text/css\" href=\"$SCRIPT_NAME?css\">";
Just change the href address to your file, e.g. href=\"http://panmental.de/browser/phpshow.css\". Note that quotation marks need to be escaped (\"). You might want to start with the original stylesheet and only replace parts - it contains comments and explains e.g. how to hide control elements.

4. Incorportating the slideshow into your existing web page is no problem as long as you use it as a stand-alone, i.e. if you leave it unchanged and call it as a frame or iframe. Should you however want to add html to the script file and put anything before the <?PHP tag you need to set $GD_WORKAROUND="oldGD"; and $allowZip=false;. These constraints are imposed by html/php as headers can be sent only once; Thus modes which require image or zip headers will no longer work, as the html header gets sent before the script kicks in! (Note that changes within the PHP code, i.e. to the parameters are no problem.)

5. Do you want to display descriptive texts or even links along with photos? This is easy to do with the listing assistant. After you have the phpshow script on your server call it in your web browser, adding ?lister at the end. So, if the script is at http://panmental.de/photo/slideshow.php enter http://panmental.de/photo/slideshow.php?lister in your browser.
The listing assistant will display all images from that directory along with text boxes. Simply enter your description or link next to the corresponding photo. When you are done with annotating click the button to download the xml file. Afterwards you only have to upload this xml file to that photo directory on your server.

6. Actually instead of placing the original script in all photo directories you can put dummy scripts with the following content there (NO html around the php tags, 3. from above applies!):
Code:
 

<?PHP
include '../scripts/phpshow.php';
?>

Like this you need to save the script itself only in one place while from every directory you only have a pointer to the full script - saves space and allows for simple changing.
To make the script behave different depending on the directory it is run from you can also overwrite variables in each dummy script, e.g. add to the dummy script:
Code:
 

<?PHP
$browsertitle="Travelling in Europe";
$slidetitle= "Travelling in Europe - Slideshow";
$autoplay= false;
include '../scripts/phpshow.php';
?>


7. To run the script as an embedded or iFrame in an exisiting web page as shown here on the right you need to do the following: First get script running as described above, then set the parameter
$hideControlElements=true;
- either in the main script or, which might make more sense, in a dummy script only.
Then add the following line to your existing web page, with all capital letters replaced to fit your needs:

<iframe src="http://YOURDOMAIN.COM/PHOTOS/SCRIPT.php?newGD&slides&0"
width="X" height="Y" scrolling="no" allowtransparency="true" name="slideshow" frameborder="0">
<p>Uh oh, embedded frames are not supported by your browser!</p> </iframe>

Additionally you might want to add CSS information to the iframe, as
style="float:right; margin-left:15px; margin-bottom:5px;"
8. Want to design your own controls for the slideshow module? External iFrame control from within your page is easy to realize!
Try this to control the iFrame above right: << || >>
The html for this in your main page would be
Code:
 

<a href="javascript:window.slideshow.goDir=0;window.slideshow.doFade();"><<</a>
<a href="javascript:window.slideshow.stopit(true);">||</a>
<a href="javascript:window.slideshow.doFade();">>></a>
Attached to this post:
Attachments: phpshow.php (72.18 KB)
Edited by DemonDog, Apr 16 2010, 11:23 AM.
Posted Image

Youtube Channel
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · PHP Examples · Next Topic »
Add Reply

Share on: Share to Facebook | Share on Bebo | Post to MySpace! | | Post to Delicious! | StumbleUpon

Quote of the Moment


Team SILO Affiliates [ Click to Affiliate ] [ Show All Affiliates ]

Please support us by clicking our vote buttons everyday!
Video Games - Forum Top Sites Forum Topsite Forum Champ VoteForums.com / Forum Topsites, promote your forums, number one forum, best forums, Forum Topsite! Game Sites 50

|Forum Promotion|Add Your Link In|Video Game Forum|

Theme Designed by McKee91
Forum Elements used from Brawl Domain