Visit SlideShowPro.net  Community Forums
SlideShowPro Help Wiki
  

SlideShowPro Director

Format methods

The Format methods allow you to tap into the on-demand image publishing system of Director. Remember to do all of your format calls before the call for content.

add(options)

Add a format to the request. Takes a required options parameter describing the format to be returned.

<?php

   include('classes/DirectorPHP.php');
   $director = new Director('your-api-key', 'your-api-path');

   $format = array(
      'name' => 'thumb', 
      'width' => '100', 
      'height' => '100', 
      'crop' => 1, 
      'quality' => 75, 
      'sharpening' => 1
   );

   $director->format->add($format);
   $recent = $director->content->all(10);

   foreach($recent as $content) {
      echo '<img src="' . $content->thumb->url . '" />';
   }

?>

preview(options)

Similar to add(), but instead specifies the format for the album preview.

<?php

   include('classes/DirectorPHP.php');
   $director = new Director('your-api-key', 'your-api-path');

   $preview = array(
      'width' => '50', 
      'height' => '40', 
      'crop' => 1, 
      'quality' => 65, 
      'sharpening' => 1
   );			

   $director->format->preview($preview);

   $album = $director->album->get(1);
   echo '<img src="' . $album->preview->url . '" />';

?>

user(options)

Used before a call is made with the User class. Specifies how to return user profile photos.

<?php

   include('classes/DirectorPHP.php');
   $director = new Director('your-api-key', 'your-api-path');

   $format = array(
      'name' => 'thumb', 
      'width' => '100', 
      'height' => '100', 
      'crop' => 1, 
      'quality' => 75, 
      'sharpening' => 1
   );

   $director->format->user($format);

   $users = $director->user->all();
   foreach($users as $user) {
      echo '<img src="' . $user->photos->thumb->url . '" />';
   }
?>

clear()

Clears the current format settings. Useful if you need to make a separate request with different options.

<?php

   include('classes/DirectorPHP.php');
   $director = new Director('your-api-key', 'your-api-path');

   $format = array(
      'name' => 'thumb', 
      'width' => '100', 
      'height' => '100', 
      'crop' => 1, 
      'quality' => 75, 
      'sharpening' => 1
   );

   $director->format->add($format);
   $recent = $director->content->all(10);

   $director->format->clear();

   $format = array(
      'name' => 'thumb', 
      'width' => '50', 
      'height' => '50', 
      'crop' => 1, 
      'quality' => 75, 
      'sharpening' => 1
   );

   $director->format->add($format);
   $recent_smaller = $director->content->all(10);

?>


Page last modified by bdaily on April 16, 2009, at 07:24 AM
© 2010 Dominey Design Inc. All Rights Reserved.
About | Merchandise | Contact | Privacy policy | Legal | Licensing