fembooru/themes/rule34v2/upload.theme.php

37 lines
1.1 KiB
PHP
Raw Normal View History

2020-02-01 18:22:08 +00:00
<?php
class CustomUploadTheme extends UploadTheme
{
public function display_block(Page $page)
{
$page->add_block(new Block("Upload", $this->build_upload_block(), "head", 20));
$page->add_block(new Block("Upload", $this->build_upload_block(), "left", 20));
}
public function display_full(Page $page)
{
$page->add_block(new Block("Upload", "Disk nearly full, uploads disabled", "head", 20));
}
public function display_page(Page $page)
{
parent::display_page($page);
$html = "
2022-05-14 16:44:50 -07:00
<a href='//fembooru.jp/wiki/tagging'>Tagging Guide</a>
2020-02-01 18:22:08 +00:00
";
$page->add_block(new Block(null, $html, "main", 19));
}
protected function build_upload_block(): string
{
$url = make_link("upload");
2022-05-14 16:44:50 -07:00
$streak = Image::count_upload_streak();
$streak_comma = number_format($streak);
$html = "<a href='$url' style='font-size: 2em; display: block;'>Upload</a>";
if ($streak > 0) {
$html .= "Current streak: $streak_comma days 🔥";
}
return $html;
2020-02-01 18:22:08 +00:00
}
}