forked from Cavemanon/cavepaintings
PSR-2. I'm not a huge fan, but ugly consistency beats no consistency...
This commit is contained in:
@ -1,19 +1,21 @@
|
||||
<?php
|
||||
|
||||
class RandomImageTheme extends Themelet {
|
||||
public function display_random(Page $page, Image $image) {
|
||||
$page->add_block(new Block("Random Image", $this->build_random_html($image), "left", 8));
|
||||
}
|
||||
class RandomImageTheme extends Themelet
|
||||
{
|
||||
public function display_random(Page $page, Image $image)
|
||||
{
|
||||
$page->add_block(new Block("Random Image", $this->build_random_html($image), "left", 8));
|
||||
}
|
||||
|
||||
public function build_random_html(Image $image, ?string $query = null): string {
|
||||
public function build_random_html(Image $image, ?string $query = null): string
|
||||
{
|
||||
$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);
|
||||
|
||||
$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 "
|
||||
return "
|
||||
<center><div>
|
||||
|
||||
<a href='$h_view_link' style='position: relative; height: {$tsize[1]}px; width: {$tsize[0]}px;'>
|
||||
@ -22,6 +24,5 @@ class RandomImageTheme extends Themelet {
|
||||
|
||||
</div></center>
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user