PHP Classes
Icontem

File: examples/default.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of andy loftus  >  Photo Album  >  examples/default.php  
File: examples/default.php
Role: Example script
Content type: text/plain
Description: Let PhotoAlbum create the entire web page for you
Class: Photo Album
Display interactive photo album
 

Contents

Class file image Download
<?php
    $doc_root 
'/var/www/htdocs/pictures';
    
$web_root '/pictures';
    require_once(
"$doc_root/php/PhotoAlbum.php");

    
// Create new photo album object
    
$album = new PhotoAlbum;

    
// Where to find required files for include
    // NOTE: All js and css files must be listed exactly as they would
    //       be in their respective HTML tag (<link href=...> or 
    //       <script src=...>)
    
$album->LIGHTBOX_JS "$web_root/js/lightbox.js";
    
$album->LIGHTBOX_CSS "$web_root/css/lightbox.css";
    
$album->PROTOTYPE_JS "$web_root/js/prototype.lite.js";
    
$album->MOO_FX_JS "$web_root/js/moo.fx.js";
    
$album->MOO_FX_PACK_JS "$web_root/js/moo.fx.pack.js";

    
// Add any optional HTML settings
    // This sets up the css file to be used for the layout.  Either
    // modify the photoalbum.css file or link to a different one here.
    
$album->LINKS[] = 
        
'<link rel="stylesheet" type="text/css" href="/crew/css/photoalbum.css" />';

    
// This is REQUIRED, it initializes all the moo.fx objects and
    // makes the whole thing work.
    
$album->SCRIPTS[] = 
        
'<script type="text/javascript">' .
        
file_get_contents("$doc_root/js/photoalbum.js") .
        
'</script>';
    
    
// Create photo album
    
$rv $album->create_album();
    if(
$rv !== TRUE)
    {
        exit(
'Error: The following problem occurred: '.$album->ERR);
    }

    
// Generate complete HTML page and print to screen.
    
$output = array();
    
$rv $album->generate_full_page($output);
    if(
$rv !== TRUE)
    {
        exit(
'Error: The following problem occurred: '.$album->ERR);
    }
    print(
join(''$output));
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products