PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Carlos Reche  >  Power Thumb  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file of how to use PowerThumb class
Class: Power Thumb
Output thumbnail with zoom link and color filters
Author: By
Last change: I made a few corrections in the text.
Date: 17 years ago
Size: 3,651 bytes


Class file image Download

// Imports PowerThumb Class to this file
require_once 'class.thumb.php';

$Thumb = new PowerThumb();

'<?xml version="1.0" encoding="iso-8859-1" ?>';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
    <title>PowerThumb - Example File</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
      body { margin: 70px; font-family: verdana, arial; font-weight: bold; font-size: 15px; }
      img { border: 1px solid #555; }
      hr { width: 600px; text-align: left; color: #aaaaaa; }
      p { margin: 40px 0px; }

    <div style="position: absolute; right: 0px; top: -10px; right: 20px; z-index: -1; text-align: right; font-weight: normal;">
      <div style="font-size: 60px;">
        <span style="letter-spacing: -5px; font-family: arial black; color: #ffbbbb;">Power</span><span style="color: #bbbbff;">Thumb</span>
      <div style="font-style: italic; font-size: 15px;">Powered by Carlos Reche</div>

    <div style="margin: 30px; font-size: 17px; color: #cc0000;">
      <div style="margin: 0px 0px 0px 10px; font-size: 13px; font-weight: normal;">
        To see PowerThumb working please put an image named &quot;photo.jpg&quot; in the same directory of this file.

    <div style="margin: 30px; font-size: 17px;">
      <div style="margin: 0px 0px 0px 10px; font-size: 13px; font-weight: normal;">
        - Create thumbs with ampliations link in a very easy way. There is <br /> no need to have a different HTML document for the popup.<br />
        - Define a description to each picture (will be displayed when ampliated)<br />
        - Seven type of color filters<br />

echo "\n<p> Generate thumbs with ampliation link and photo description\n<hr />\n\n";

$Thumb->setDescription("Description goes here. Note that popup size changes automatically to fit each image.");

$Thumb->setDescription("Another description.");

"\n</p>\n<p>\n Thumbs in gray scale, personalized tag img style and no ampliation link\n<hr />\n\n";


$Thumb->setStyle("border", "2px dotted red");

$Thumb->setStyle("border", "2px dashed teal");

"\n</p>\n<p>\n Thumbs with color filters\n<hr />\n\n";

$Thumb->setStyle("border", "1px solid #000000");
$Thumb->setStyle("margin", "3px");

$Thumb->setFilter('red', 40);
$Thumb->setDescription('Thumb image filter: Red, 40%');

$Thumb->setFilter('green', 40);
$Thumb->setDescription('Thumb image filter: Green, 40%');

$Thumb->setFilter('blue', 50);
$Thumb->setDescription('Thumb image filter: Blue, 50%');

"\n<br />";

$Thumb->setFilter('yellow', 50);
$Thumb->setDescription('Thumb image filter: Yellow, 50%');

$Thumb->setFilter('magenta', 30);
$Thumb->setDescription('Thumb image filter: Magenta, 30%');

$Thumb->setFilter('cyan', 50);
$Thumb->setDescription('Thumb image filter: Cyan, 50%');



For more information send a message to info at phpclasses dot org.