This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/featured/theme.php

38 lines
1 KiB
PHP
Raw Normal View History

<?php
class FeaturedTheme extends Themelet {
/*
* Show $text on the $page
*/
2009-01-04 19:54:16 +00:00
public function display_featured(Page $page, Image $image) {
$page->add_block(new Block("Featured Image", $this->build_featured_html($image), "left", 3));
}
2012-02-10 04:04:37 +00:00
public function get_buttons_html(/*int*/ $image_id) {
2010-05-28 13:26:46 +00:00
global $user;
return "
".make_form(make_link("featured_image/set"))."
2011-03-23 11:12:55 +00:00
".$user->get_auth_html()."
<input type='hidden' name='image_id' value='$image_id'>
<input type='submit' value='Feature This'>
</form>
";
}
public function build_featured_html(Image $image, $query=null) {
global $config;
$i_id = int_escape($image->id);
$h_view_link = make_link("post/view/$i_id", $query);
$h_thumb_link = $image->get_thumb_link();
$h_tip = html_escape($image->get_tooltip());
$tsize = get_thumbnail_size($image->width, $image->height);
return "
2012-03-13 07:01:01 +00:00
<a href='$h_view_link'>
<img id='thumb_$i_id' title='$h_tip' alt='$h_tip' class='highlighted' style='height: {$tsize[1]}px; width: {$tsize[0]}px;' src='$h_thumb_link'>
</a>
";
}
}
?>