PHP Classes
elePHPant
Icontem

File: test.cafepressbox.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Andrew Collington  >  CafePress Random Product  >  test.cafepressbox.php  >  Download  
File: test.cafepressbox.php
Role: Example script
Content type: text/plain
Description: A simple example file.
Class: CafePress Random Product
Display a random product from your CafePress store
Author: By
Last change: Updated to reflect new function calls.
Date: 11 years ago
Size: 1,670 bytes
 

Contents

Class file image Download
<?php

   
include 'class.cafepressbox.php';
   
$cp = new cafePressBox;
   
$cp->setCacheDir('./cache');
   
$cp->setCacheTime(86400);
   
$cp->setCacheImages(true);

?>
<html>

<body>

<table border="0" width="100%" cellpadding="10">
<tr>
    <td align="center">'amnuts' with link on</td>
    <td align="center">'amnuts' with link off</td>
</tr>
<tr>
    <td align="center">
    <?php

        $cp
->setResizeCachedImages(75);
       
$cp->setStore('amnuts');
       
$cp->displayItem(true);

   
?>
</td>
    <td align="center">
    <?php
   
        $cp
->setTemplate('<table border="0" cellpadding="5" cellspacing="0" width="150" style="border:3px solid #99CCFF;"><tr><td align="center">[IMG]</td></tr><tr><td align="center" style="background-color: #99CCFF; color: black; font-family : Verdana, Arial, sans-serif; font-size : 11px; text-decoration : none;">[TXT]</td></tr></table>');
       
$cp->displayItem(false);
   
   
?>
</td>
</tr>
<tr>
    <td align="center">'collingtons' with link on</td>
    <td align="center">'collingtons' with link off</td>
</tr>
<tr>
    <td align="center">
    <?php

        $cp
->setResizeCachedImages(0);
       
$cp->setStore('collingtons');
       
$cp->setTemplate('<div style="width:250px;">[TXT]</div><br>[IMG]');
       
$cp->displayItem(true);

   
?>
</td>
    <td align="center">
    <?php
   
        $cp
->setTemplate('<table width="300" cellpadding="10" style="border:1px solid silver;"><tr><td>[IMG]</td><td valign="middle">[TXT]</td></tr></table>');
       
$cp->displayItem(false);
   
   
?>
</td>
</tr>
</table>

</body>

</html>