Miscellaneous Code
  Home arrow Miscellaneous Code arrow Slide Show
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS CODE

Slide Show
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 4
    2004-08-05

    Table of Contents:

    Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    This is a page that can be used to display images in a folder as a slide show. It is a complete html page and should work with minor changes, as long as images meet simple criteria.
    Newbie here so be gentle when you bend me over for the rape session. Or not.

    By : paulhitz

    <html>
    <head>
    <meta name="author" value="Paul Hitz">
    <meta http-equiv="reply-to" value="paulhitz770@hotmail.com">
    <!-- This is my "junk mail" account, may take a couple tries. Put Paul John in subject -->
    <?php
    // slideshow.php
    // This program will show pictures in a folder as a slide show. The pictures need to be
    // similarly named with a number which distinguishes each picture. For instance for the
    // example, I have chosen JPEGs in a folder called images, named pic001.JPG, pic002.JPG,
    // etc. You can pause the slide show, jump ahead or jump back within the slide show and
    // and set the delay of how long a picture stays up after it is loaded.

    // Get the variables from the url(QUERY_STRING), and move into hash table $vars.
    parse_str($_SERVER['QUERY_STRING'],$vars);

    // Get value of picture, time and savetime from hash table and move into $ variables.
    $picture = $vars['picture'];
    $time = $vars['time'];
    $savetime = $vars['savetime'];


    // Build the image name including path. In this example go up one folder above where
    // slideshow.php is and go into a folder called images. The sprintf(... tells says to
    // display the number as a three digit number and pad with leading zeros, 1 = 001.
    // Hint, you could change ../images/ to a variable, put variable in url, get var from hash
    // table and access any folder on your site (and beyond).
    $picfile = "../images/pic" . sprintf("%03d",$picture) . ".JPG";

    // Increment $picture before you build next url so you go to the next picture.
    $picture += 1;
    $url = 'http://www.hitz.info/Haiti04Jun/slideshow/slideshow.php?picture=' . $picture . '&time=' . $time;

    // Decrement $picture so you pause on same picture and include save time in $urlpause to
    // fill the time input box as the default for restart.
    $picture -= 1;
    $urlpause = 'http://www.hitz.info/Haiti04Jun/slideshow/slideshow.php?picture=' . $picture . '&time=6000&savetime=' . $time;

    // Meta refresh redirect to new page in this case same page with new vars in CONTENT seconds.
    // Change if statement to be number of pictures in folder.
    // Hint create an image that says end of slideshow or some such as closure.
    $meta = '<META HTTP-EQUIV="refresh" CONTENT="' . $time . ';URL=' . $url .'">';
    if ($picture < 82)
    {
    echo $meta;
    }
    ?>
    <title>
    Slide show
    </title>
    </head>
    <body>

    <table border="1">
    <tr>
    <td>
    <table>
    <tr>
    <td rowspan="5"><img src= <?php echo $picfile; ?> >
    </td>
    </tr>
    </table>
    </td>
    <td>
    <table>
    <FORM METHOD='GET' ACTION='HTTP://www.hitz.info/Haiti04Jun/slideshow/slideshow.php'>
    <?php
    if ($time == 6000)
    {
    echo " <tr>\n <td>";
    echo "How many <br>seconds delay <br>per picture?\n";
    echo " </td>\n </tr>\n <tr>\n <td>";
    echo "<INPUT TYPE='text' NAME='time' VALUE='" . $savetime . "' SIZE='3'>\n";
    echo " </td>\n </tr>\n <tr>\n <td>&nbsp;\n";
    echo " </td>\n </tr>\n <tr>\n <td>";
    echo "Which picture <br>do you want <br>to start with? <br>(This is<br>&nbsp;slide\n";
    echo " </td>\n </tr>\n <tr>\n <td>";
    echo "<INPUT TYPE='text' NAME='picture' VALUE='" . $picture . "' SIZE='2'>\n";
    echo " </td>\n </tr>\n <tr>\n <td>";
    echo "&nbsp; of 82.)\n";
    echo " </td>\n </tr>\n <tr>\n <td>";
    echo "<INPUT TYPE='submit' VALUE='submit' NAME='submitbutton'>\n";
    echo " </td>\n </tr>\n";
    }
    else
    {
    echo " <tr>\n <td align='center'>";
    echo "<a href='" . $urlpause . "'>pause</a><br>$picture of 82\n";
    echo " </td>\n </tr>\n";
    }
    ?>
    </FORM>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Miscellaneous Code Articles
    More By Codewalkers

     

    IBM® developerWorks developerWorks - FREE Tools!


    NEW! Best Practices: The Integrated Project and Portfolio Management Platform.

    Hear how IBM Rational Project and Portfolio Management integrated solutions help teams put the right tools and processes in place to maximize the effectiveness and efficiency of project teams and ensure that the business vision is being executed correctly. Learn how to automate and integrate requirements prioritization, top-down project planning, communications and controls, and methodology deployment to keep your scope, costs, and schedules under control. Tackle with an end-to-end approach the management of scope and scope changes, usage of methodology to control and empower project teams, and optimization of resources to align activity costs with the overall project plan.
    FREE! Go There Now!


    NEW! Download DB2 Express-C 9.5

    Visit IBM developerWorks to download IBM DB2 Express-C 9.5, a no-charge version of DB2 Express 9 database server. DB2 Express-C offers the same core data server base features as other DB2 Express editions and provides a solid base to build and deploy applications developed using C/C++, Java, .NET, PHP, and other programming languages.
    FREE! Go There Now!


    NEW! Download IBM Data Studio V1.1

    Visit IBM developerWorks to download the latest trial version of IBM Data Studio V1.1 at no cost. IBM Data Studio is a comprehensive data management solution that helps you effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life cycle utilizing a consistent and integrated user interface. Unlike other client-side data management solutions that focus on only one aspect of the application lifecycle or database administration, Data Studio complements the Rational Software Delivery platform, providing unparalleled flexibility for a heterogeneous data server environment across platforms.
    FREE! Go There Now!


    NEW! Evaluate IBM Rational Software Analyzer V7.0

    Download a free trial version of IBM Rational Software Analyzer Developer Edition V7.0 to identify bug defects earlier in the software development cycle. Rational Software Analyzer is an extensible software development solution that reduces the expense of bug-fixes by enabling static analysis code reviews and bug identification very early in the development cycle.
    FREE! Go There Now!


    NEW! Hello World: Monitor a simple business process using WebSphere Business Monitor V6.0.2

    This tutorial shows new users of IBM WebSphere Business Monitor Version 6.0.2 how to perform the "Hello World" equivalent for monitoring business process applications. It is intended to help you get familiar with the capabilities of the product.
    FREE! Go There Now!


    NEW! Improve your build process with IBM Rational Build Forge, Part 1: Create a continuous build and integration environment

    Learn how to implement a build management system that uses and extends your existing automation technologies. This tutorial shows, step-by-step, how to install and configure IBM Rational Build Forge to manage builds for Jakarta Tomcat from source code.
    FREE! Go There Now!


    NEW! Rational Talks to You: Manage RUP-based CMMI initiatives

    Join this Rational Talks to You teleconference on December 4 at 1:00 pm ET to discuss how Rational Method Composer can help meet your compliance objectives. Get your questions answered!
    FREE! Go There Now!


    NEW! Try the IBM SOA Sandbox for Process

    Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly.
    FREE! Go There Now!


    NEW! Webcast: Eclipse: Empowering the universal platform

    The Eclipse community is constantly working to extend Eclipse's functionality. In this webcast, learn about some of the most important and feature-rich projects under development. From multi-language support to plug-in development, tune in to see what Eclipse is capable of now.
    FREE! Go There Now!


    Refresh! IBM Rational Systems Development Solution eKit

    With IBM Rational Systems Development Solution, you can deliver products faster with higher quality. Within this kit, Read the “Model Driven Systems Development” white paper to see how to improve product quality and communication. Then check out the rest of the e-Kit to learn more about important topics that can affect the success of any software project through customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems. From start to finish, at every stage in your projects, Rational Systems Development Solution can help your company reach its full potential.
    FREE! Go There Now!



    All FREE IBM® developerWorks Tools!

    MISCELLANEOUS CODE ARTICLES

    - A Web App Based on a Model for the CodeIgnit...
    - Completing a Model for the CodeIgniter PHP F...
    - Validating Input Data with the CodeIgniter P...
    - Deleting Database Records with the CodeIgnit...
    - Inserting Database Records with a CodeIgnite...
    - Fetching Database Rows with a Model for the ...
    - Model Data and Validation Rules for a Generi...
    - Building a Generic Model for the CodeIgniter...
    - upload image to database sql
    - Random Password Generator
    - BCroot, get the root of a number with BC fun...
    - Find pi in a high precision
    - [PHP5] FORMCHECKER : data validation
    - SPL and ITERATOR : examples
    - Xml with Rss Feeds





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek