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

27 lines
766 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
class EmoticonListTheme extends Themelet
{
public function display_emotes(array $list)
{
global $page;
$data_href = get_base_href();
2020-03-13 09:23:54 +00:00
$html = "<html lang='en'><head><title>Emoticon list</title></head><body>";
$html .= "<table><tr>";
$n = 1;
foreach ($list as $item) {
$pathinfo = pathinfo($item);
$name = $pathinfo["filename"];
2020-03-13 09:23:54 +00:00
$html .= "<td><img alt='$name' src='$data_href/$item'> :$name:</td>";
if ($n++ % 3 == 0) {
$html .= "</tr><tr>";
}
}
$html .= "</tr></table>";
$html .= "</body></html>";
2019-06-19 01:58:28 +00:00
$page->set_mode(PageMode::DATA);
$page->set_data($html);
}
2009-08-08 16:43:18 +00:00
}