lint fixing
This commit is contained in:
parent
591c21f3ce
commit
1597eff082
67 changed files with 304 additions and 267 deletions
|
@ -3,6 +3,8 @@
|
|||
* CAPTCHA abstraction *
|
||||
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
use ReCaptcha\ReCaptcha;
|
||||
|
||||
function captcha_get_html(): string
|
||||
{
|
||||
global $config, $user;
|
||||
|
@ -37,7 +39,7 @@ function captcha_check(): bool
|
|||
if ($user->is_anonymous() && $config->get_bool("comment_captcha")) {
|
||||
$r_privatekey = $config->get_string('api_recaptcha_privkey');
|
||||
if (!empty($r_privatekey)) {
|
||||
$recaptcha = new \ReCaptcha\ReCaptcha($r_privatekey);
|
||||
$recaptcha = new ReCaptcha($r_privatekey);
|
||||
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
if (!$resp->isSuccess()) {
|
||||
|
|
|
@ -395,7 +395,7 @@ abstract class DataHandlerExtension extends Extension
|
|||
throw new UploadException("Unable to scan media properties: ".$e->getMessage());
|
||||
}
|
||||
|
||||
$ire = send_event(new ImageReplaceEvent($image_id, $image));
|
||||
send_event(new ImageReplaceEvent($image_id, $image));
|
||||
$event->image_id = $image_id;
|
||||
} else {
|
||||
$image = $this->create_image_from_data(warehouse_path(Image::IMAGE_DIR, $event->hash), $event->metadata);
|
||||
|
@ -453,6 +453,7 @@ abstract class DataHandlerExtension extends Extension
|
|||
{
|
||||
global $page;
|
||||
if ($this->supported_ext($event->image->ext)) {
|
||||
/** @noinspection PhpPossiblePolymorphicInvocationInspection */
|
||||
$this->theme->display_image($page, $event->image);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,8 +61,10 @@ function get_dsn()
|
|||
{
|
||||
if (file_exists("data/config/auto_install.conf.php")) {
|
||||
$dsn = null;
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
require_once "data/config/auto_install.conf.php";
|
||||
} elseif (@$_POST["database_type"] == DatabaseDriver::SQLITE) {
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
$id = bin2hex(random_bytes(5));
|
||||
$dsn = "sqlite:data/shimmie.{$id}.sqlite";
|
||||
} elseif (isset($_POST['database_type']) && isset($_POST['database_host']) && isset($_POST['database_user']) && isset($_POST['database_name'])) {
|
||||
|
@ -136,7 +138,7 @@ function ask_questions()
|
|||
|
||||
<h3>Database Install</h3>
|
||||
<form action="index.php" method="POST">
|
||||
<center>
|
||||
<div style="text-align: center;">
|
||||
<table class='form'>
|
||||
<tr>
|
||||
<th>Type:</th>
|
||||
|
@ -164,7 +166,7 @@ function ask_questions()
|
|||
</tr>
|
||||
<tr><td colspan="2"><input type="submit" value="Go!"></td></tr>
|
||||
</table>
|
||||
</center>
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', update_qs);
|
||||
function q(n) {
|
||||
|
@ -342,7 +344,7 @@ function write_config($dsn)
|
|||
function exit_with_page($title, $body, $code=0)
|
||||
{
|
||||
print("<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang='en'>
|
||||
<head>
|
||||
<title>Shimmie Installer</title>
|
||||
<link rel=\"shortcut icon\" href=\"ext/static_files/static/favicon.ico\">
|
||||
|
|
|
@ -341,6 +341,7 @@ function get_extension(?string $mime_type): ?string
|
|||
return ($ext ? $ext : null);
|
||||
}
|
||||
|
||||
/** @noinspection PhpUnhandledExceptionInspection */
|
||||
function getSubclassesOf(string $parent)
|
||||
{
|
||||
$result = [];
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require_once "core/basepage.php";
|
||||
|
||||
class BasePageTest extends \PHPUnit\Framework\TestCase
|
||||
class BasePageTest extends TestCase
|
||||
{
|
||||
public function test_page()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require_once "core/block.php";
|
||||
|
||||
class BlockTest extends \PHPUnit\Framework\TestCase
|
||||
class BlockTest extends TestCase
|
||||
{
|
||||
public function test_basic()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require_once "core/polyfills.php";
|
||||
|
||||
class PolyfillsTest extends \PHPUnit\Framework\TestCase
|
||||
class PolyfillsTest extends TestCase
|
||||
{
|
||||
public function test_html_escape()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require_once "core/imageboard/tag.php";
|
||||
|
||||
class TagTest extends \PHPUnit\Framework\TestCase
|
||||
class TagTest extends TestCase
|
||||
{
|
||||
public function test_caret()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require_once "core/urls.php";
|
||||
|
||||
class UrlsTest extends \PHPUnit\Framework\TestCase
|
||||
class UrlsTest extends TestCase
|
||||
{
|
||||
public function test_make_link()
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require_once "core/util.php";
|
||||
|
||||
class UtilTest extends \PHPUnit\Framework\TestCase
|
||||
class UtilTest extends TestCase
|
||||
{
|
||||
public function test_warehouse_path()
|
||||
{
|
||||
|
|
|
@ -214,7 +214,7 @@ class User
|
|||
$d = urlencode($config->get_string("avatar_gravatar_default"));
|
||||
$r = $config->get_string("avatar_gravatar_rating");
|
||||
$cb = date("Y-m-d");
|
||||
return "<img class=\"avatar gravatar\" src=\"https://www.gravatar.com/avatar/$hash.jpg?s=$s&d=$d&r=$r&cacheBreak=$cb\">";
|
||||
return "<img alt='avatar' class=\"avatar gravatar\" src=\"https://www.gravatar.com/avatar/$hash.jpg?s=$s&d=$d&r=$r&cacheBreak=$cb\">";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
|
|
|
@ -468,7 +468,9 @@ function get_debug_info(): string
|
|||
* Request initialisation stuff *
|
||||
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/** @privatesection */
|
||||
/** @privatesection
|
||||
* @noinspection PhpIncludeInspection
|
||||
*/
|
||||
|
||||
function require_all(array $files): void
|
||||
{
|
||||
|
@ -493,7 +495,7 @@ function _load_theme_files()
|
|||
|
||||
function _sanitise_environment(): void
|
||||
{
|
||||
global $_tracer, $tracer_enabled;
|
||||
global $tracer_enabled;
|
||||
|
||||
$min_php = "7.3";
|
||||
if (version_compare(phpversion(), $min_php, ">=") === false) {
|
||||
|
@ -524,7 +526,6 @@ date and you should plan on moving elsewhere.
|
|||
// so to prevent running out of memory during complex operations code that uses it should
|
||||
// check if tracer output is enabled before making use of it.
|
||||
$tracer_enabled = constant('TRACE_FILE')!==null;
|
||||
$_tracer = new EventTracer();
|
||||
|
||||
ob_start();
|
||||
|
||||
|
@ -553,12 +554,14 @@ function _get_themelet_files(string $_theme): array
|
|||
|
||||
/**
|
||||
* Used to display fatal errors to the web user.
|
||||
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
||||
*/
|
||||
function _fatal_error(Exception $e): void
|
||||
{
|
||||
$version = VERSION;
|
||||
$message = $e->getMessage();
|
||||
$phpver = phpversion();
|
||||
$query = is_subclass_of($e, "SCoreException") ? $e->query : null;
|
||||
|
||||
//$hash = exec("git rev-parse HEAD");
|
||||
//$h_hash = $hash ? "<p><b>Hash:</b> $hash" : "";
|
||||
|
@ -576,13 +579,13 @@ function _fatal_error(Exception $e): void
|
|||
|
||||
print("Message: $message\n");
|
||||
|
||||
if (isset($e->query)) {
|
||||
print("Query: {$e->query}\n");
|
||||
if ($query) {
|
||||
print("Query: {$query}\n");
|
||||
}
|
||||
|
||||
print("Version: $version (on $phpver)\n");
|
||||
} else {
|
||||
$q = (!isset($e->query) || is_null($e->query)) ? "" : "<p><b>Query:</b> " . html_escape($e->query);
|
||||
$q = $query ? "" : "<p><b>Query:</b> " . html_escape($query);
|
||||
header("HTTP/1.0 500 Internal Error");
|
||||
echo '
|
||||
<!doctype html>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php declare(strict_types=1);
|
||||
<?php /** @noinspection PhpUnusedPrivateMethodInspection */
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Sent when the admin page is ready to be added to
|
||||
|
|
|
@ -37,7 +37,7 @@ class AdminPageTheme extends Themelet
|
|||
*/
|
||||
public function display_form()
|
||||
{
|
||||
global $page, $database;
|
||||
global $page;
|
||||
|
||||
$html = "";
|
||||
$html .= $this->button("All tags to lowercase", "lowercase_all_tags", true);
|
||||
|
|
|
@ -14,8 +14,7 @@ ul.tagit li.tagit-choice {
|
|||
-webkit-border-radius: 6px;
|
||||
border: 1px solid #CAD8F3;
|
||||
|
||||
background: none;
|
||||
background-color: #DEE7F8;
|
||||
background: #DEE7F8 none;
|
||||
|
||||
font-weight: normal;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class BBCode extends FormatterExtension
|
|||
$text = preg_replace('!\[url=((?:https?|ftp|irc|mailto)://.*?)\](.*?)\[/url\]!s', '<a href="$1">$2</a>', $text);
|
||||
$text = preg_replace('!\[url\]((?:https?|ftp|irc|mailto)://.*?)\[/url\]!s', '<a href="$1">$1</a>', $text);
|
||||
$text = preg_replace('!\[email\](.*?)\[/email\]!s', '<a href="mailto:$1">$1</a>', $text);
|
||||
$text = preg_replace('!\[img\](https?:\/\/.*?)\[/img\]!s', '<img src="$1">', $text);
|
||||
$text = preg_replace('!\[img\](https?:\/\/.*?)\[/img\]!s', '<img alt="user image" src="$1">', $text);
|
||||
$text = preg_replace('!\[\[([^\|\]]+)\|([^\]]+)\]\]!s', '<a href="'.make_link('wiki/$1').'">$2</a>', $text);
|
||||
$text = preg_replace('!\[\[([^\]]+)\]\]!s', '<a href="'.make_link('wiki/$1').'">$1</a>', $text);
|
||||
$text = preg_replace("!\n\s*\n!", "\n\n", $text);
|
||||
|
|
|
@ -121,8 +121,8 @@ class BlotterTheme extends Themelet
|
|||
$clean_date = date("y/m/d", strtotime($messy_date));
|
||||
$entry_text = $entries[$i]['entry_text'];
|
||||
if ($entries[$i]['important'] == 'Y') {
|
||||
$i_open = "<font color='#{$i_color}'>";
|
||||
$i_close="</font>";
|
||||
$i_open = "<span style='color: #$i_color;'>";
|
||||
$i_close="</span>";
|
||||
}
|
||||
$html .= "{$i_open}{$clean_date} - {$entry_text}{$i_close}<br /><br />";
|
||||
}
|
||||
|
@ -149,8 +149,8 @@ class BlotterTheme extends Themelet
|
|||
$clean_date = date("m/d/y", strtotime($messy_date));
|
||||
$entry_text = $entries[$i]['entry_text'];
|
||||
if ($entries[$i]['important'] == 'Y') {
|
||||
$i_open = "<font color='#{$i_color}'>";
|
||||
$i_close="</font>";
|
||||
$i_open = "<span style='color: #$i_color'>";
|
||||
$i_close="</span>";
|
||||
}
|
||||
$entries_list .= "<li>{$i_open}{$clean_date} - {$entry_text}{$i_close}</li>";
|
||||
}
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
background: #DDD;
|
||||
border: 1px solid #CCC;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
top: 0;
|
||||
left: -195px;
|
||||
width: 180px;
|
||||
z-index: 1;
|
||||
box-shadow: 0px 0px 4px #000;
|
||||
box-shadow: 0 0 4px #000;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.comment:hover .info {
|
||||
|
@ -39,6 +39,6 @@
|
|||
background: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
|
|
@ -94,13 +94,13 @@ class CommentListTest extends ShimmiePHPUnitTestCase
|
|||
|
||||
# make a comment
|
||||
send_event(new CommentPostingEvent($image_id, $user, "Test Comment ASDFASDF"));
|
||||
$page = $this->get_page("post/view/$image_id");
|
||||
$this->get_page("post/view/$image_id");
|
||||
$this->assert_text("ASDFASDF");
|
||||
|
||||
# delete a comment
|
||||
$comment_id = (int)$database->get_one("SELECT id FROM comments");
|
||||
send_event(new CommentDeletionEvent($comment_id));
|
||||
$page = $this->get_page("post/view/$image_id");
|
||||
$this->get_page("post/view/$image_id");
|
||||
$this->assert_no_text("ASDFASDF");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ class CommentListTheme extends Themelet
|
|||
if (!empty($comment->owner_email)) {
|
||||
$hash = md5(strtolower($comment->owner_email));
|
||||
$cb = date("Y-m-d");
|
||||
$h_avatar = "<img src=\"//www.gravatar.com/avatar/$hash.jpg?cacheBreak=$cb\"><br>";
|
||||
$h_avatar = "<img alt='avatar' src=\"//www.gravatar.com/avatar/$hash.jpg?cacheBreak=$cb\"><br>";
|
||||
}
|
||||
$h_reply = " - <a href='javascript: replyTo($i_image_id, $i_comment_id, \"$h_name\")'>Reply</a>";
|
||||
$h_ip = $user->can(Permissions::VIEW_IP) ? "<br>".show_ip($comment->poster_ip, "Comment posted {$comment->posted}") : "";
|
||||
|
|
|
@ -97,6 +97,7 @@ class DanbooruApi extends Extension
|
|||
elseif (false && isset($_GET['tags'])) {
|
||||
$start = isset($_GET['after_id']) ? int_escape($_GET['offset']) : 0;
|
||||
$tags = Tag::explode($_GET['tags']);
|
||||
assert(!is_null($start) && !is_null($tags));
|
||||
} else {
|
||||
$start = isset($_GET['after_id']) ? int_escape($_GET['offset']) : 0;
|
||||
$sqlresult = $database->get_all(
|
||||
|
|
|
@ -9,7 +9,7 @@ class DowntimeTheme extends Themelet
|
|||
{
|
||||
$page->add_block(new Block(
|
||||
"Downtime",
|
||||
"<span style='font-size: 1.5em'><b><center>DOWNTIME MODE IS ON!</center></b></span>",
|
||||
"<span style='font-size: 1.5em; text-align: center;'><b>DOWNTIME MODE IS ON!</b></span>",
|
||||
"left",
|
||||
0
|
||||
));
|
||||
|
@ -30,7 +30,7 @@ class DowntimeTheme extends Themelet
|
|||
$page->set_code(503);
|
||||
$page->set_data(
|
||||
<<<EOD
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Downtime</title>
|
||||
<link rel="stylesheet" href="$data_href/themes/$theme_name/style.css" type="text/css">
|
||||
|
@ -38,7 +38,7 @@ class DowntimeTheme extends Themelet
|
|||
<body>
|
||||
<div id="downtime">
|
||||
<section>
|
||||
<h1><center>Down for Maintenance</center></h1>
|
||||
<h1 style="text-align: center;">Down for Maintenance</h1>
|
||||
<div id="message" class="blockbody">
|
||||
$message
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@ class Emoticons extends FormatterExtension
|
|||
public function format(string $text): string
|
||||
{
|
||||
$data_href = get_base_href();
|
||||
$text = preg_replace("/:([a-z]*?):/s", "<img src='$data_href/ext/emoticons/default/\\1.gif'>", $text);
|
||||
$text = preg_replace("/:([a-z]*?):/s", "<img alt='\1' src='$data_href/ext/emoticons/default/\\1.gif'>", $text);
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,13 +5,13 @@ class EmoticonListTheme extends Themelet
|
|||
{
|
||||
global $page;
|
||||
$data_href = get_base_href();
|
||||
$html = "<html><head><title>Emoticon list</title></head><body>";
|
||||
$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"];
|
||||
$html .= "<td><img src='$data_href/$item'> :$name:</td>";
|
||||
$html .= "<td><img alt='$name' src='$data_href/$item'> :$name:</td>";
|
||||
if ($n++ % 3 == 0) {
|
||||
$html .= "</tr><tr>";
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ class CBZFileHandlerTheme extends Themelet
|
|||
</div>
|
||||
<div id='comicView'>
|
||||
<a id='comicPrev'><span><</span></a>
|
||||
<img id='comicPage' src='{$data_href}/ext/handle_cbz/spinner.gif' />
|
||||
<img alt='comic' id='comicPage' src='{$data_href}/ext/handle_cbz/spinner.gif' />
|
||||
<a id='comicNext'><span>></span></a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,14 @@ class SVGFileHandlerTheme extends Themelet
|
|||
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
|
||||
// $ilink = $image->get_image_link();
|
||||
$html = "
|
||||
<img src='$ilink' id='main_image' class='shm-main-image' data-width='{$image->width}' data-height='{$image->height}' />
|
||||
<img
|
||||
alt='main image'
|
||||
src='$ilink'
|
||||
id='main_image'
|
||||
class='shm-main-image'
|
||||
data-width='{$image->width}'
|
||||
data-height='{$image->height}'
|
||||
/>
|
||||
";
|
||||
$page->add_block(new Block("Image", $html, "main", 10));
|
||||
}
|
||||
|
|
|
@ -13,15 +13,6 @@ class VideoFileHandlerTheme extends Themelet
|
|||
$loop = $config->get_bool("video_playback_loop");
|
||||
$player = make_link('vendor/bower-asset/mediaelement/build/flashmediaelement.swf');
|
||||
|
||||
$width="auto";
|
||||
if ($image->width>1) {
|
||||
$width = $image->width."px";
|
||||
}
|
||||
$height="auto";
|
||||
if ($image->height>1) {
|
||||
$height = $image->height."px";
|
||||
}
|
||||
|
||||
$html = "Video not playing? <a href='$ilink'>Click here</a> to download the file.<br/>";
|
||||
|
||||
//Browser media format support: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
|
||||
|
@ -46,7 +37,7 @@ class VideoFileHandlerTheme extends Themelet
|
|||
. "&poster={$thumb_url}"
|
||||
. "&file={$full_url}"
|
||||
. "&loop=" . ($loop ? 'true' : 'false') . "\" />
|
||||
<img src=\"{$thumb_url}\" />
|
||||
<img alt='thumb' src=\"{$thumb_url}\" />
|
||||
</object>";
|
||||
|
||||
if ($ext == "flv") {
|
||||
|
@ -57,7 +48,7 @@ class VideoFileHandlerTheme extends Themelet
|
|||
$loop = ($loop ? ' loop' : '');
|
||||
|
||||
$html .= "
|
||||
<video controls class='shm-main-image' id='main_image' alt='main image' poster='$thumb_url' {$autoplay} {$loop}
|
||||
<video controls class='shm-main-image' id='main_image' alt='main image' poster='$thumb_url' {$autoplay} {$loop}
|
||||
style='max-width: 100%'>
|
||||
<source src='{$ilink}' type='{$supportedExts[$ext]}'>
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ class HelpPages extends Extension
|
|||
} else {
|
||||
$page->set_mode(PageMode::PAGE);
|
||||
$name = $event->get_arg(0);
|
||||
$title = $name;
|
||||
if (array_key_exists($name, $pages)) {
|
||||
$title = $pages[$name];
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
div#front-page h1 {font-size: 4em; margin-top: 2em; margin-bottom: 0px; text-align: center; border: none; background: none; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none;}
|
||||
div#front-page h1 {font-size: 4em; margin-top: 2em; margin-bottom: 0; text-align: center; border: none; background: none; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none;}
|
||||
div#front-page {text-align:center;}
|
||||
.space {margin-bottom: 1em;}
|
||||
div#front-page div#links a {margin: 0 0.5em;}
|
||||
|
|
|
@ -10,7 +10,7 @@ class HomeTheme extends Themelet
|
|||
$page->set_data(
|
||||
<<<EOD
|
||||
<!doctype html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>$sitename</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
|
|
|
@ -37,7 +37,7 @@ class ImageBanTest extends ShimmiePHPUnitTestCase
|
|||
$this->assertEquals(200, $page->code);
|
||||
}
|
||||
|
||||
public function onNotSuccessfulTest(\Throwable $t): void
|
||||
public function onNotSuccessfulTest(Throwable $t): void
|
||||
{
|
||||
send_event(new RemoveImageHashBanEvent($this->hash));
|
||||
parent::onNotSuccessfulTest($t); // TODO: Change the autogenerated stub
|
||||
|
|
|
@ -172,7 +172,6 @@ class IndexTest extends ShimmiePHPUnitTestCase
|
|||
/** @depends testUpload */
|
||||
public function testMixedSearchTagMeta($image_ids)
|
||||
{
|
||||
global $database;
|
||||
// multiple tags, many results
|
||||
$this->assert_search_results(["computer", "size=640x480"], [$image_ids[1], $image_ids[0]]);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ class LinkImageTheme extends Themelet
|
|||
{
|
||||
switch ($type) {
|
||||
case "html":
|
||||
$text = "<img src=\"$src\" />";
|
||||
$text = "<img src=\"$src\" alt=\"\" />";
|
||||
break;
|
||||
case "ubb":
|
||||
$text = "[img]".$src."[/img]";
|
||||
|
|
|
@ -1,87 +1,87 @@
|
|||
.note {
|
||||
display: block;
|
||||
|
||||
background-color: #FFE;
|
||||
border: 1px dashed black;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
|
||||
filter:alpha(opacity=50);
|
||||
-moz-opacity:0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.notep {
|
||||
display: none;
|
||||
color: #412a21;
|
||||
background-color: #fffdef;
|
||||
border: #412a21 1px solid;
|
||||
font-size: 8pt;
|
||||
margin-top: 0px;
|
||||
padding: 2px;
|
||||
position: absolute;
|
||||
width: 175px;
|
||||
}
|
||||
|
||||
#noteform, #noteEditForm {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
#noteform textarea, #noteEditForm textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* imgAreaSelect default style
|
||||
*/
|
||||
|
||||
.imgareaselect-border1 {
|
||||
background: url(border-v.gif) repeat-y left top;
|
||||
}
|
||||
|
||||
.imgareaselect-border2 {
|
||||
background: url(border-h.gif) repeat-x left top;
|
||||
}
|
||||
|
||||
.imgareaselect-border3 {
|
||||
background: url(border-v.gif) repeat-y right top;
|
||||
}
|
||||
|
||||
.imgareaselect-border4 {
|
||||
background: url(border-h.gif) repeat-x left bottom;
|
||||
}
|
||||
|
||||
.imgareaselect-border1, .imgareaselect-border2,
|
||||
.imgareaselect-border3, .imgareaselect-border4 {
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.imgareaselect-handle {
|
||||
background-color: #fff;
|
||||
border: solid 1px #000;
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.imgareaselect-outer {
|
||||
/*background-color: #000;*/
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.imgareaselect-selection {
|
||||
}
|
||||
|
||||
/* Makes sure the note block is hidden */
|
||||
section#note_system {
|
||||
height: 0;
|
||||
}
|
||||
section#note_system > .blockbody {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
.note {
|
||||
display: block;
|
||||
|
||||
background-color: #FFE;
|
||||
border: 1px dashed black;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
|
||||
filter:alpha(opacity=50);
|
||||
-moz-opacity:0.5;
|
||||
-khtml-opacity: 0.5;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.notep {
|
||||
display: none;
|
||||
color: #412a21;
|
||||
background-color: #fffdef;
|
||||
border: #412a21 1px solid;
|
||||
font-size: 8pt;
|
||||
margin-top: 0;
|
||||
padding: 2px;
|
||||
position: absolute;
|
||||
width: 175px;
|
||||
}
|
||||
|
||||
#noteform, #noteEditForm {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
#noteform textarea, #noteEditForm textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* imgAreaSelect default style
|
||||
*/
|
||||
|
||||
.imgareaselect-border1 {
|
||||
background: url(border-v.gif) repeat-y left top;
|
||||
}
|
||||
|
||||
.imgareaselect-border2 {
|
||||
background: url(border-h.gif) repeat-x left top;
|
||||
}
|
||||
|
||||
.imgareaselect-border3 {
|
||||
background: url(border-v.gif) repeat-y right top;
|
||||
}
|
||||
|
||||
.imgareaselect-border4 {
|
||||
background: url(border-h.gif) repeat-x left bottom;
|
||||
}
|
||||
|
||||
.imgareaselect-border1, .imgareaselect-border2,
|
||||
.imgareaselect-border3, .imgareaselect-border4 {
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.imgareaselect-handle {
|
||||
background-color: #fff;
|
||||
border: solid 1px #000;
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.imgareaselect-outer {
|
||||
/*background-color: #000;*/
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.imgareaselect-selection {
|
||||
}
|
||||
|
||||
/* Makes sure the note block is hidden */
|
||||
section#note_system {
|
||||
height: 0;
|
||||
}
|
||||
section#note_system > .blockbody {
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
|
|
@ -80,11 +80,9 @@ class NumericScoreTheme extends Themelet
|
|||
$f_dte = make_link("popular_by_".$dte[3]."?".date($dte[2], (strtotime('+1 '.$dte[3], strtotime($dte[0])))));
|
||||
|
||||
$html = "\n".
|
||||
"<center>\n".
|
||||
" <h3>\n".
|
||||
" <a href='{$b_dte}'>«</a> {$dte[1]} <a href='{$f_dte}'>»</a>\n".
|
||||
" </h3>\n".
|
||||
"</center>\n".
|
||||
"<h3 style='text-align: center;'>\n".
|
||||
" <a href='{$b_dte}'>«</a> {$dte[1]} <a href='{$f_dte}'>»</a>\n".
|
||||
"</h3>\n".
|
||||
"<br/>\n".$pop_images;
|
||||
|
||||
|
||||
|
|
|
@ -239,6 +239,7 @@ class OuroborosPost extends _SafeOuroborosImage
|
|||
/**
|
||||
* Initialize an OuroborosPost for creation
|
||||
* Mainly just acts as a wrapper and validation layer
|
||||
* @noinspection PhpMissingParentConstructorInspection
|
||||
*/
|
||||
public function __construct(array $post, string $md5 = '')
|
||||
{
|
||||
|
|
|
@ -58,6 +58,7 @@ add_rating(new ImageRating("?", "Unrated", "unrated", 99999));
|
|||
add_rating(new ImageRating("s", "Safe", "safe", 0));
|
||||
add_rating(new ImageRating("q", "Questionable", "questionable", 500));
|
||||
add_rating(new ImageRating("e", "Explicit", "explicit", 1000));
|
||||
/** @noinspection PhpIncludeInspection */
|
||||
@include_once "data/config/ratings.conf.php";
|
||||
|
||||
class RatingSetEvent extends Event
|
||||
|
|
|
@ -49,7 +49,7 @@ class RegenThumbTheme extends Themelet
|
|||
<tr><th><label for='regen_thumb_force'>Force</label></th><td><input type='checkbox' name='regen_thumb_force' id='regen_thumb_force' value='true' /></td></tr>
|
||||
<tr><th><label for='regen_thumb_limit'>Limit</label></th><td><input type='number' name='regen_thumb_limit' id='regen_thumb_limit' value='1000' /></td></tr>
|
||||
<tr><th><label for='regen_thumb_type'>Type</label></th><td>
|
||||
<select name='regen_thumb_type' id='regen_thumb_type' value='1000'>
|
||||
<select name='regen_thumb_type' id='regen_thumb_type'>
|
||||
<option value=''>All</option>
|
||||
".implode($types)."
|
||||
</select>
|
||||
|
@ -60,7 +60,7 @@ class RegenThumbTheme extends Themelet
|
|||
<p>".make_form(make_link("admin/delete_thumbs"), "POST", false, "", "return confirm('Are you sure you want to delete all thumbnails?')")."
|
||||
<table class='form'>
|
||||
<tr><th><label for='delete_thumb_type'>Type</label></th><td>
|
||||
<select name='delete_thumb_type' id='delete_thumb_type' value='1000'>
|
||||
<select name='delete_thumb_type' id='delete_thumb_type'>
|
||||
<option value=''>All</option>
|
||||
".implode($types)."
|
||||
</select>
|
||||
|
|
|
@ -182,6 +182,7 @@ class RelationshipsTest extends ShimmiePHPUnitTestCase
|
|||
public function testRemoveParentByTag($imgs)
|
||||
{
|
||||
[$image_1, $image_2, $image_3] = $imgs;
|
||||
assert(!is_null($image_3));
|
||||
|
||||
// check parent is set
|
||||
$this->assertEquals($image_2->parent_id, $image_1->id);
|
||||
|
|
|
@ -4,7 +4,7 @@ class RSSImagesTest extends ShimmiePHPUnitTestCase
|
|||
public function testImageFeed()
|
||||
{
|
||||
$this->log_in_as_user();
|
||||
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
|
||||
$this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
|
||||
$this->log_out();
|
||||
|
||||
$this->get_page('rss/images');
|
||||
|
|
|
@ -6,10 +6,10 @@ BODY.censored FOOTER {
|
|||
}
|
||||
.tnc_bg {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #ACE4A3;
|
||||
opacity: 0.75;
|
||||
z-index: 999999999999999999999;
|
||||
|
|
|
@ -271,6 +271,9 @@ class SetupBlock extends Block
|
|||
|
||||
class Setup extends Extension
|
||||
{
|
||||
/** @var SetupTheme */
|
||||
protected $theme;
|
||||
|
||||
public function onInitExt(InitExtEvent $event)
|
||||
{
|
||||
global $config;
|
||||
|
|
|
@ -38,6 +38,6 @@
|
|||
background: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
|
|
@ -107,10 +107,12 @@ class XMLSitemap extends Extension
|
|||
|
||||
/* --- Add all other images to sitemap with lower priority --- */
|
||||
$otherimages = Image::find_images(51, 10000000, []);
|
||||
$image = null;
|
||||
foreach ($otherimages as $arrayid => $image) {
|
||||
// create url from image id's
|
||||
$otherimages[$arrayid] = "post/view/$image->id";
|
||||
}
|
||||
assert(!is_null($image));
|
||||
$this->add_sitemap_queue($otherimages, "monthly", "0.6", date("Y-m-d", strtotime($image->posted)));
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ H3[class~="shm-toggler"],
|
|||
cursor: pointer;
|
||||
}
|
||||
IMG {border: none;}
|
||||
FORM {margin: 0px;}
|
||||
FORM {margin: 0;}
|
||||
IMG.lazy {display: none;}
|
||||
|
||||
#flash {
|
||||
|
@ -54,12 +54,12 @@ IMG.lazy {display: none;}
|
|||
#installer H1, #installer H3 {
|
||||
background: #DDD;
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
padding: 2px;
|
||||
}
|
||||
#installer H1 {
|
||||
border-bottom: 1px solid black;
|
||||
border-radius: 16px 16px 0px 0px;
|
||||
border-radius: 16px 16px 0 0;
|
||||
}
|
||||
#installer H3 {
|
||||
border-bottom: 1px solid black;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#tagger_toolbar, #tagger_body {
|
||||
padding:2px 2px 0 2px;
|
||||
border-style:solid;
|
||||
border-width: 0px 2px 0px 2px;
|
||||
border-width: 0 2px 0 2px;
|
||||
}
|
||||
#tagger_body {
|
||||
max-height:175px;
|
||||
|
@ -47,7 +47,7 @@
|
|||
#tagger_body div {
|
||||
padding-top:2px;
|
||||
margin-top:2px;
|
||||
border-top:1px solid;
|
||||
border-top:1px solid;
|
||||
}
|
||||
|
||||
/* Tagger Styling
|
||||
|
@ -69,7 +69,7 @@
|
|||
display: block;
|
||||
}
|
||||
#tagger_parent tag {
|
||||
font-size:1.25em;
|
||||
font-size:1.25em;
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class TipsTheme extends Themelet
|
|||
(
|
||||
empty($tip['image']) ?
|
||||
"<td></td>" :
|
||||
"<td><img src=".$url.$tip['image']." /></td>"
|
||||
"<td><img alt='' src=".$url.$tip['image']." /></td>"
|
||||
).
|
||||
"<td class='left'>".$tip['text']."</td>";
|
||||
|
||||
|
|
|
@ -131,18 +131,17 @@ if(document.getElementById("image-container") !== null) {
|
|||
|
||||
if(supext.search(furl.match("[a-zA-Z0-9]+$")[0]) !== -1){
|
||||
history.pushState(history.state, document.title, location.href);
|
||||
var href = ste + furl +
|
||||
location.href = ste + furl +
|
||||
"&tags=" + encodeURIComponent(tag) +
|
||||
"&rating=" + encodeURIComponent(rating) +
|
||||
"&source=" + encodeURIComponent(source);
|
||||
location.href = href;
|
||||
}
|
||||
else{
|
||||
alert(notsup);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Shimmie
|
||||
*
|
||||
* One problem with shimmie is each theme does not show the same info
|
||||
|
@ -184,4 +183,4 @@ else if(document.getElementsByTagName("title")[0].innerHTML.search("Image [0-9.-
|
|||
alert(notsup);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ class VarnishPurger extends Extension
|
|||
$result = curl_exec($ch);
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
assert(!is_null($result) && !is_null($httpCode));
|
||||
//return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,9 +11,6 @@ class ViewImageTest extends ShimmiePHPUnitTestCase
|
|||
{
|
||||
$this->log_in_as_user();
|
||||
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
||||
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "test2");
|
||||
$image_id_3 = $this->post_image("tests/favicon.png", "test");
|
||||
$idp1 = $image_id_3 + 1;
|
||||
|
||||
$this->get_page("post/view/$image_id_1");
|
||||
$this->assert_title("Image $image_id_1: test");
|
||||
|
@ -52,10 +49,8 @@ class ViewImageTest extends ShimmiePHPUnitTestCase
|
|||
public function testView404()
|
||||
{
|
||||
$this->log_in_as_user();
|
||||
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
||||
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "test2");
|
||||
$image_id_3 = $this->post_image("tests/favicon.png", "test");
|
||||
$idp1 = $image_id_3 + 1;
|
||||
$image_id_1 = $this->post_image("tests/favicon.png", "test");
|
||||
$idp1 = $image_id_1 + 1;
|
||||
|
||||
$this->get_page("post/view/$idp1");
|
||||
$this->assert_title('Image not found');
|
||||
|
|
|
@ -10,7 +10,7 @@ class WordFilterTest extends ShimmiePHPUnitTestCase
|
|||
|
||||
public function _doThings($in, $out)
|
||||
{
|
||||
global $user, $_tracer;
|
||||
global $user;
|
||||
$this->log_in_as_user();
|
||||
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
|
||||
send_event(new CommentPostingEvent($image_id, $user, $in));
|
||||
|
|
|
@ -57,7 +57,7 @@ if (!file_exists("vendor/")) {
|
|||
//CHECK: Should we just point to install.php instead? Seems unsafe though.
|
||||
print <<<EOD
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Shimmie Error</title>
|
||||
<link rel="shortcut icon" href="ext/static_files/static/favicon.ico">
|
||||
|
@ -99,6 +99,7 @@ require_once "core/util.php";
|
|||
|
||||
global $cache, $config, $database, $user, $page, $_tracer;
|
||||
_sanitise_environment();
|
||||
$_tracer = new EventTracer();
|
||||
$_tracer->begin("Bootstrap");
|
||||
_load_core_files();
|
||||
$cache = new Cache(CACHE_DSN);
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
chdir(dirname(dirname(__FILE__)));
|
||||
require_once "vendor/autoload.php";
|
||||
require_once "tests/defines.php";
|
||||
|
@ -14,6 +17,7 @@ if (file_exists("tests/trace.json")) {
|
|||
global $cache, $config, $database, $user, $page, $_tracer;
|
||||
_sanitise_environment();
|
||||
$tracer_enabled = true;
|
||||
$_tracer = new EventTracer();
|
||||
$_tracer->begin("bootstrap");
|
||||
_load_core_files();
|
||||
$cache = new Cache(CACHE_DSN);
|
||||
|
@ -34,7 +38,7 @@ send_event(new DatabaseUpgradeEvent());
|
|||
send_event(new InitExtEvent());
|
||||
$_tracer->end();
|
||||
|
||||
abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
|
||||
abstract class ShimmiePHPUnitTestCase extends TestCase
|
||||
{
|
||||
protected static $anon_name = "anonymous";
|
||||
protected static $admin_name = "demo";
|
||||
|
@ -44,7 +48,7 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
|
|||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
parent::setUpBeforeClass();
|
||||
global $_tracer, $config;
|
||||
global $_tracer;
|
||||
$_tracer->begin(get_called_class());
|
||||
|
||||
self::create_user(self::$admin_name);
|
||||
|
|
|
@ -15,3 +15,4 @@ define("TRACE_THRESHOLD", 0.0);
|
|||
define("TIMEZONE", 'UTC');
|
||||
define("BASE_HREF", "/test");
|
||||
define("CLI_LOG_LEVEL", 50);
|
||||
define("STATSD_HOST", null);
|
||||
|
|
|
@ -7,7 +7,7 @@ BODY {
|
|||
background: #EEE;
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
H1 {
|
||||
background: #BBB;
|
||||
|
@ -19,7 +19,7 @@ H1 A {
|
|||
}
|
||||
H3 {
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
SECTION>H3 {
|
||||
background: #CCC;
|
||||
|
@ -46,7 +46,7 @@ TD {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
TABLE.zebra {border-spacing: 0px; border: 2px solid #CCC;}
|
||||
TABLE.zebra {border-spacing: 0; border: 2px solid #CCC;}
|
||||
TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
|
||||
TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #CCC;}
|
||||
TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #CCC;}
|
||||
|
@ -89,11 +89,11 @@ NAV TABLE {
|
|||
}
|
||||
NAV INPUT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
NAV SELECT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
TABLE.tag_list {
|
||||
|
|
|
@ -37,7 +37,7 @@ class CustomCommentListTheme extends CommentListTheme
|
|||
$comment_html .= $this->comment_to_html($comment, false);
|
||||
}
|
||||
|
||||
$html = "<p style='clear:both'> </p><hr height='1'>";
|
||||
$html = "<p style='clear:both'> </p><hr >";
|
||||
$html .= "File: <a href=\"".make_link("post/view/{$image->id}")."\">$h_filename</a> - ($h_filesize, {$w}x{$h}) - ";
|
||||
$html .= html_escape($image->get_tag_list());
|
||||
$html .= "<div style='text-align: left'>";
|
||||
|
@ -48,7 +48,7 @@ class CustomCommentListTheme extends CommentListTheme
|
|||
$page->add_block(new Block(null, $html, "main", $position++));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function display_recent_comments(array $comments)
|
||||
{
|
||||
// sidebar fails in this theme
|
||||
|
|
|
@ -10,8 +10,8 @@ BODY {
|
|||
color: #800000;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
margin-right: 0px;
|
||||
margin-left: 0px;
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
margin-top: 5px;
|
||||
}
|
||||
H1 {
|
||||
|
@ -30,7 +30,7 @@ FOOTER {
|
|||
|
||||
A, A:visited {text-decoration: none; color: #0000EE;}
|
||||
A:hover {text-decoration: underline; color: #DD0000;}
|
||||
HR {border: none; border-top: 1px solid #D9BFB7; height: 0px; clear: both;}
|
||||
HR {border: none; border-top: 1px solid #D9BFB7; height: 0; clear: both;}
|
||||
|
||||
NAV {
|
||||
width: 150px;
|
||||
|
@ -45,11 +45,11 @@ NAV TD {
|
|||
}
|
||||
NAV INPUT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
NAV SELECT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
NAV H3 {
|
||||
text-align: left;
|
||||
|
@ -92,7 +92,7 @@ TABLE.tag_list>TBODY>TR>TD:after {
|
|||
}
|
||||
.comment {
|
||||
/*background: #FFFFEE;*/
|
||||
border-width: 0px;
|
||||
border-width: 0;
|
||||
}
|
||||
.reply, .paginator {
|
||||
margin-bottom: 2px;
|
||||
|
@ -106,7 +106,7 @@ TABLE.tag_list>TBODY>TR>TD:after {
|
|||
}
|
||||
.reply P {
|
||||
margin-left: 32px;
|
||||
margin-bottom: 0px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.setupblock {
|
||||
|
|
|
@ -7,15 +7,15 @@ BODY {
|
|||
background: #F0F7FF;
|
||||
font-family: sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
3 menu bar *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
.menu {
|
||||
border-bottom: 1px solid #C3D2E0;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding: 4px;
|
||||
background: #E3EFFA;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ a.tab:hover, a.tab:active, .tab-selected {
|
|||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
.sbar {
|
||||
border-bottom: 1px solid #C3D2E0;
|
||||
margin-top: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
padding: 4px;
|
||||
background: #CEDFF0;
|
||||
|
@ -53,8 +53,8 @@ a.tab:hover, a.tab:active, .tab-selected {
|
|||
}
|
||||
.sfoot {
|
||||
border-top: 1px solid #C3D2E0;
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding: 4px;
|
||||
background: #CEDFF0;
|
||||
text-align: right;
|
||||
|
@ -83,14 +83,14 @@ a.tab:hover, a.tab:active, .tab-selected {
|
|||
margin:0 0 2px 0; /* top right bottom left */
|
||||
padding:2px 10px;
|
||||
position:relative;
|
||||
left:0px;
|
||||
left:0;
|
||||
width:50%;
|
||||
}
|
||||
.navtop {
|
||||
top:7px;
|
||||
}
|
||||
.maintop {
|
||||
top:0px;
|
||||
top:0;
|
||||
margin-top:5px;
|
||||
margin-bottom:5px;
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ A, A:hover, A:active, A:visited {
|
|||
}
|
||||
H3 {
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
THEAD {
|
||||
font-weight: bold;
|
||||
|
@ -132,7 +132,7 @@ CODE {
|
|||
background: #DDD;
|
||||
}
|
||||
|
||||
TABLE.zebra {border-spacing: 0px; border: 2px solid #C3D2E0;}
|
||||
TABLE.zebra {border-spacing: 0; border: 2px solid #C3D2E0;}
|
||||
TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
|
||||
TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #C3D2E0;}
|
||||
TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #C3D2E0;}
|
||||
|
@ -198,11 +198,11 @@ NAV TD {
|
|||
}
|
||||
NAV INPUT, nav button {
|
||||
width: 95%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
NAV SELECT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#comments P {
|
||||
|
@ -334,7 +334,7 @@ NAV .thumbblock {
|
|||
height: auto;
|
||||
}
|
||||
NAV .thumb {
|
||||
margin-bottom: 0px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.thumbblock {
|
||||
width: 220px;
|
||||
|
|
|
@ -411,7 +411,7 @@ function tt_MkMainDivHtm()
|
|||
{
|
||||
return(
|
||||
'<div id="WzTtDiV"></div>' +
|
||||
(tt_ie56 ? ('<iframe id="WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0px;left:0px;display:none;"></iframe>')
|
||||
(tt_ie56 ? ('<iframe id="WzTtIfRm" src="javascript:false" scrolling="no" frameborder="0" style="filter:Alpha(opacity=0);position:absolute;top:0;left:0;display:none;"></iframe>')
|
||||
: '')
|
||||
);
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ function tt_GetWndCliSiz(s)
|
|||
return(
|
||||
// document.documentElement.client+s functional, returns > 0
|
||||
((db = document.documentElement) && (y = db[sC])) ? y
|
||||
// ... not functional, in which case document.body.client+s
|
||||
// ... not functional, in which case document.body.client+s
|
||||
// is the clientarea size, fortunately
|
||||
: document.body[sC]
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@ class CustomHomeTheme extends HomeTheme
|
|||
$hh = $page->get_all_html_headers();
|
||||
$page->set_data(
|
||||
<<<EOD
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>$sitename</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
|
|
|
@ -5,7 +5,7 @@ class Page extends BasePage
|
|||
{
|
||||
global $config;
|
||||
|
||||
list($nav_links, $sub_links) = $this->get_nav_links();
|
||||
// list($nav_links, $sub_links) = $this->get_nav_links();
|
||||
$theme_name = $config->get_string(SetupConfig::THEME, 'material');
|
||||
$site_name = $config->get_string(SetupConfig::TITLE);
|
||||
$data_href = get_base_href();
|
||||
|
|
|
@ -9,7 +9,7 @@ class CustomHomeTheme extends HomeTheme
|
|||
$hh = $page->get_all_html_headers();
|
||||
$page->set_data(
|
||||
<<<EOD
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>$sitename</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
|
@ -17,7 +17,7 @@ class CustomHomeTheme extends HomeTheme
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
$hh
|
||||
<style>
|
||||
div#front-page h1 {font-size: 4em; margin-top: 2em; margin-bottom: 0px; text-align: center; border: none; background: none; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none;}
|
||||
div#front-page h1 {font-size: 4em; margin-top: 2em; margin-bottom: 0; text-align: center; border: none; background: none; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none;}
|
||||
div#front-page {text-align:center;}
|
||||
.space {margin-bottom: 1em;}
|
||||
div#front-page div#links a {margin: 0 0.5em;}
|
||||
|
|
|
@ -15,7 +15,7 @@ a:active.menu { color: #FF0000; text-decoration: none; }
|
|||
top:0;
|
||||
left: 5%;
|
||||
width: 100%;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#menuh
|
||||
|
@ -23,7 +23,7 @@ a:active.menu { color: #FF0000; text-decoration: none; }
|
|||
font-size: small;
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
width:100%;
|
||||
margin-top: 0px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#menuh a.sub_option
|
||||
|
@ -31,36 +31,35 @@ a:active.menu { color: #FF0000; text-decoration: none; }
|
|||
border: 1px solid #555;
|
||||
/*background-image:url(topban.jpg);*/
|
||||
}
|
||||
|
||||
|
||||
#menuh a
|
||||
{
|
||||
text-align: center;
|
||||
background: #ACE4A3;
|
||||
display:block;
|
||||
white-space:nowrap;
|
||||
margin:0;
|
||||
margin-top:0;
|
||||
padding: 0.2em;
|
||||
margin: 0;
|
||||
padding: 0.2em;
|
||||
}
|
||||
|
||||
|
||||
#menuh a, #menuh a:visited /* menu at rest */
|
||||
{
|
||||
color: #000099;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
|
||||
#menuh a:hover /* menu at mouse-over */
|
||||
{
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#menuh a.top_parent, #menuh a.top_parent:hover /* attaches down-arrow to all top-parents */
|
||||
{
|
||||
/*background-image: url(navdown_white.gif);*/
|
||||
background-position: right center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
#menuh a.parent, #menuh a.parent:hover /* attaches side-arrow to all parents */
|
||||
{
|
||||
/*background-image: url(nav_white.gif);*/
|
||||
|
|
|
@ -38,15 +38,15 @@ class Page extends BasePage
|
|||
}
|
||||
}
|
||||
|
||||
# used in header.inc
|
||||
$query = !empty($this->_search_query) ? html_escape(Tag::implode($this->_search_query)) : "";
|
||||
assert(!is_null($query)); # used in header.inc, do not remove :P
|
||||
$flash_html = $this->flash ? "<b id='flash'>".nl2br(html_escape(implode("\n", $this->flash)))."</b>" : "";
|
||||
$generated = autodate(date('c'));
|
||||
$footer_html = $this->footer_html();
|
||||
|
||||
print <<<EOD
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{$this->title}</title>
|
||||
<meta name="description" content="Rule 34, if it exists there is porn of it."/>
|
||||
|
@ -93,10 +93,18 @@ EOD;
|
|||
</article>
|
||||
|
||||
<footer>
|
||||
<font size="2px"><a href="http://rule34.paheal.net/wiki/Terms%20of%20use">Terms of use</a> !!! <a href="http://rule34.paheal.net/wiki/Privacy%20policy">Privacy policy</a> !!! <a href="http://rule34.paheal.net/wiki/2257">18 U.S.C. §2257</a><br /></font>
|
||||
<span style="font-size: 2px;">
|
||||
<a href="http://rule34.paheal.net/wiki/Terms%20of%20use">Terms of use</a>
|
||||
!!!
|
||||
<a href="http://rule34.paheal.net/wiki/Privacy%20policy">Privacy policy</a>
|
||||
!!!
|
||||
<a href="http://rule34.paheal.net/wiki/2257">18 U.S.C. §2257</a><br />
|
||||
</span>
|
||||
<hr />
|
||||
<font size="2px">BTC: <b>193gutWtgirF7js14ivcXfnfQgXv9n5BZo</b>
|
||||
ETH: <b>0x68B88a00e69Bde88E9db1b9fC10b8011226e26aF</b></font>
|
||||
<span style="font-size: 2px;">
|
||||
BTC: <b>193gutWtgirF7js14ivcXfnfQgXv9n5BZo</b>
|
||||
ETH: <b>0x68B88a00e69Bde88E9db1b9fC10b8011226e26aF</b>
|
||||
</span>
|
||||
<hr />
|
||||
<br>
|
||||
Thank you!
|
||||
|
|
|
@ -7,11 +7,11 @@ BODY {
|
|||
background: url(bg.png) #ACE4A3;
|
||||
font-family: "Arial", sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
#header {
|
||||
border-bottom: 1px solid #7EB977;
|
||||
margin-top: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
padding: 8px;
|
||||
background: #ACE4A3;
|
||||
|
@ -19,15 +19,15 @@ BODY {
|
|||
}
|
||||
H1 {
|
||||
font-size: 5em;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
H1 A {
|
||||
color: black;
|
||||
}
|
||||
H3 {
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
THEAD {
|
||||
font-weight: bold;
|
||||
|
@ -40,9 +40,8 @@ TD {
|
|||
#subtitle {
|
||||
width: 256px;
|
||||
font-size: 0.75em;
|
||||
margin: auto;
|
||||
margin-top: -16px;
|
||||
text-align: center;
|
||||
margin: -16px auto auto;
|
||||
text-align: center;
|
||||
border: 1px solid black;
|
||||
border-top: none;
|
||||
background: #DDD;
|
||||
|
@ -56,7 +55,7 @@ TD {
|
|||
}
|
||||
|
||||
TABLE.zebra {background: #ACE4A3; border-collapse: collapse; border: 1px solid #7EB977;}
|
||||
TABLE.zebra TD {font-size: 0.8em;margin: 0px; border-top: 1px solid #7EB977; padding: 2px;}
|
||||
TABLE.zebra TD {font-size: 0.8em;margin: 0; border-top: 1px solid #7EB977; padding: 2px;}
|
||||
TABLE.zebra TR:nth-child(odd) {background: #9CD493;}
|
||||
TABLE.zebra TR:nth-child(even) {background: #ACE4A3;}
|
||||
|
||||
|
@ -100,11 +99,11 @@ NAV TD {
|
|||
}
|
||||
NAV INPUT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
NAV SELECT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -136,13 +135,13 @@ NAV SELECT {
|
|||
background: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#commentlistimage .blockbody .comment,
|
||||
#commentlistrecent .blockbody .comment {
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -162,7 +161,7 @@ ARTICLE TABLE {
|
|||
margin: auto;
|
||||
}
|
||||
NAV SECTION:first-child H3 {
|
||||
margin-top: 0px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -209,7 +208,7 @@ SECTION>H3 {
|
|||
|
||||
div#twitter_update_list li {
|
||||
list-style:none;
|
||||
padding-bottom:0px;
|
||||
padding-bottom:0;
|
||||
text-align:left;
|
||||
margin-top:5px;
|
||||
margin-bottom:5px;
|
||||
|
@ -241,7 +240,7 @@ div#twitter_update_list li {
|
|||
}
|
||||
|
||||
UL.tagit {
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
ul.tagit li.tagit-new {
|
||||
width: 50px;
|
||||
|
@ -276,12 +275,12 @@ ul.tagit li.tagit-new {
|
|||
|
||||
/* responsive padding */
|
||||
@media (max-width: 1024px) {
|
||||
NAV {margin-left: 0px;}
|
||||
ARTICLE {margin-right: 0px; margin-left: 242px;}
|
||||
NAV {margin-left: 0;}
|
||||
ARTICLE {margin-right: 0; margin-left: 242px;}
|
||||
}
|
||||
@media (max-width: 750px) {
|
||||
NAV {margin-left: 0px;}
|
||||
ARTICLE {margin-right: 0px; margin-left: 250px;}
|
||||
NAV {margin-left: 0;}
|
||||
ARTICLE {margin-right: 0; margin-left: 250px;}
|
||||
}
|
||||
|
||||
/* responsive navbar */
|
||||
|
@ -293,15 +292,15 @@ ul.tagit li.tagit-new {
|
|||
|
||||
NAV>SECTION>.blockbody,
|
||||
NAV>SECTION>.blockbody>.comment {
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
NAV>SECTION>H3 {
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
BODY.navHidden #menuh-container {display: none;}
|
||||
BODY.navHidden NAV {display: none;}
|
||||
BODY.navHidden ARTICLE {margin-left: 0px;}
|
||||
BODY.navHidden ARTICLE {margin-left: 0;}
|
||||
|
||||
/*
|
||||
NAV {
|
||||
|
@ -318,7 +317,7 @@ ul.tagit li.tagit-new {
|
|||
BODY.navHidden {padding-top: 5.4em}
|
||||
}
|
||||
@media (max-width: 750px) {
|
||||
#header {position: fixed; top: 0px; left: 0px; z-index: 99999999999;}
|
||||
#header {position: fixed; top: 0; left: 0; z-index: 99999999999;}
|
||||
.ui-autocomplete {z-index: 999999999999;}
|
||||
BODY {padding-top: 7em}
|
||||
}
|
||||
|
@ -347,7 +346,7 @@ ul.tagit li.tagit-new {
|
|||
#mini-logo {display: table-cell; width: 100px;}
|
||||
|
||||
/* hide nav-search when header-search is sticky */
|
||||
ARTICLE {margin-top: 0px;}
|
||||
ARTICLE {margin-top: 0;}
|
||||
#Navigationleft .blockbody {font-size: 1.5em;}
|
||||
#Navigationleft .blockbody P,
|
||||
#Navigationleft .blockbody FORM
|
||||
|
|
|
@ -3,7 +3,7 @@ class Themelet extends BaseThemelet
|
|||
{
|
||||
public function build_thumb_html(Image $image): string
|
||||
{
|
||||
global $cache, $config, $database, $user;
|
||||
global $cache, $config;
|
||||
|
||||
$cached = $cache->get("thumb-block:{$image->id}");
|
||||
if ($cached) {
|
||||
|
@ -17,7 +17,7 @@ class Themelet extends BaseThemelet
|
|||
$h_tip = html_escape($image->get_tooltip());
|
||||
$h_tags = strtolower($image->get_tag_list());
|
||||
$h_ext = strtolower($image->ext);
|
||||
|
||||
|
||||
// If file is flash or svg then sets thumbnail to max size.
|
||||
if ($image->ext === 'swf' || $image->ext === 'svg') {
|
||||
$tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height'));
|
||||
|
|
|
@ -7,11 +7,11 @@ BODY {
|
|||
background: url(bg.png);
|
||||
font-family: "Arial", sans-serif;
|
||||
font-size: 14px;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
HEADER {
|
||||
border-bottom: 1px solid #B89F7C;
|
||||
margin-top: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
padding: 8px;
|
||||
background: #FCD9A9;
|
||||
|
@ -19,15 +19,15 @@ HEADER {
|
|||
}
|
||||
H1 {
|
||||
font-size: 5em;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
H1 A {
|
||||
color: black;
|
||||
}
|
||||
H3 {
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
THEAD {
|
||||
font-weight: bold;
|
||||
|
@ -50,7 +50,7 @@ CODE {
|
|||
background: #DDD;
|
||||
}
|
||||
|
||||
TABLE.zebra {border-spacing: 0px; border: 1px solid #B89F7C; }
|
||||
TABLE.zebra {border-spacing: 0; border: 1px solid #B89F7C; }
|
||||
TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
|
||||
TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #B89F7C;}
|
||||
TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #B89F7C;}
|
||||
|
@ -109,11 +109,11 @@ NAV TD {
|
|||
}
|
||||
NAV INPUT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
NAV SELECT {
|
||||
width: 100%;
|
||||
padding: 0px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
TABLE.tag_list {
|
||||
|
|
Reference in a new issue