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/image_view_counter/theme.php

32 lines
791 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class ImageViewCounterTheme extends Themelet
{
2024-01-03 03:45:06 +00:00
/**
* @param Image[] $images
*/
public function view_popular(array $images): void
{
global $page, $config;
$pop_images = "";
foreach ($images as $image) {
2020-10-24 21:33:29 +00:00
$pop_images .= $this->build_thumb_html($image) . "\n";
}
$nav_html = "<a href=".make_link().">Index</a>";
$page->set_heading($config->get_string(SetupConfig::TITLE));
$page->add_block(new Block("Navigation", $nav_html, "left", 10));
2020-10-24 21:33:29 +00:00
$page->add_block(new Block(null, $pop_images, "main", 30));
}
public function get_help_html(): string
{
2020-10-26 15:13:28 +00:00
return '<p>Search for posts that have received views by users.</p>';
}
}