Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.