PHP Classes

File: examples/default.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Andy Loftus  >  Photo Album  >  examples/default.php  >  Download  
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
Author: By
Last change: Fixed print statement so it works now.
Date: 8 years ago
Size: 1,708 bytes


Class file image Download
= '/var/www/htdocs/pictures';
$web_root = '/pictures';

// 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") .
// Create photo album
$rv = $album->create_album();
$rv !== TRUE)
'Error: The following problem occurred: '.$album->ERR);

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