Created
September 7, 2012 20:46
-
-
Save iso100/3669468 to your computer and use it in GitHub Desktop.
Plugin for Statamic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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