Skip to content

Instantly share code, notes, and snippets.

@iso100
Created September 7, 2012 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iso100/3669468 to your computer and use it in GitHub Desktop.
Save iso100/3669468 to your computer and use it in GitHub Desktop.
Plugin for Statamic
<?php
class Plugin_flickholdr extends Plugin {
var $meta = array(
'name' => 'flickholdr placeholder images',
'version' => '0.1',
'author' => 'Ian Pitts',
'author_url' => 'http://ianpitts.com'
);
public function index()
{
$width = $this->fetch_param('width', '300', 'is_numeric');
$height = $this->fetch_param('height', '200', 'is_numeric');
$tags = $this->fetch_param('tags',false);
$offset = $this->fetch_param('offset',false,'is_numeric');
$image_url = "http://flickholdr.com/{$width}/{$height}";
if ($tags) {
$image_url .= '/'.$tags;
}
if ($offset) {
$image_url .= '/'.$offset;
}
$image_tag = '<img src="'.$image_url.'" width="' . $width . '" height="' . $height . '">'
return $image_tag;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment