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 *
|
* CAPTCHA abstraction *
|
||||||
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
|
use ReCaptcha\ReCaptcha;
|
||||||
|
|
||||||
function captcha_get_html(): string
|
function captcha_get_html(): string
|
||||||
{
|
{
|
||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
@ -37,7 +39,7 @@ function captcha_check(): bool
|
||||||
if ($user->is_anonymous() && $config->get_bool("comment_captcha")) {
|
if ($user->is_anonymous() && $config->get_bool("comment_captcha")) {
|
||||||
$r_privatekey = $config->get_string('api_recaptcha_privkey');
|
$r_privatekey = $config->get_string('api_recaptcha_privkey');
|
||||||
if (!empty($r_privatekey)) {
|
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']);
|
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
|
||||||
|
|
||||||
if (!$resp->isSuccess()) {
|
if (!$resp->isSuccess()) {
|
||||||
|
|
|
@ -395,7 +395,7 @@ abstract class DataHandlerExtension extends Extension
|
||||||
throw new UploadException("Unable to scan media properties: ".$e->getMessage());
|
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;
|
$event->image_id = $image_id;
|
||||||
} else {
|
} else {
|
||||||
$image = $this->create_image_from_data(warehouse_path(Image::IMAGE_DIR, $event->hash), $event->metadata);
|
$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;
|
global $page;
|
||||||
if ($this->supported_ext($event->image->ext)) {
|
if ($this->supported_ext($event->image->ext)) {
|
||||||
|
/** @noinspection PhpPossiblePolymorphicInvocationInspection */
|
||||||
$this->theme->display_image($page, $event->image);
|
$this->theme->display_image($page, $event->image);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,10 @@ function get_dsn()
|
||||||
{
|
{
|
||||||
if (file_exists("data/config/auto_install.conf.php")) {
|
if (file_exists("data/config/auto_install.conf.php")) {
|
||||||
$dsn = null;
|
$dsn = null;
|
||||||
|
/** @noinspection PhpIncludeInspection */
|
||||||
require_once "data/config/auto_install.conf.php";
|
require_once "data/config/auto_install.conf.php";
|
||||||
} elseif (@$_POST["database_type"] == DatabaseDriver::SQLITE) {
|
} elseif (@$_POST["database_type"] == DatabaseDriver::SQLITE) {
|
||||||
|
/** @noinspection PhpUnhandledExceptionInspection */
|
||||||
$id = bin2hex(random_bytes(5));
|
$id = bin2hex(random_bytes(5));
|
||||||
$dsn = "sqlite:data/shimmie.{$id}.sqlite";
|
$dsn = "sqlite:data/shimmie.{$id}.sqlite";
|
||||||
} elseif (isset($_POST['database_type']) && isset($_POST['database_host']) && isset($_POST['database_user']) && isset($_POST['database_name'])) {
|
} 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>
|
<h3>Database Install</h3>
|
||||||
<form action="index.php" method="POST">
|
<form action="index.php" method="POST">
|
||||||
<center>
|
<div style="text-align: center;">
|
||||||
<table class='form'>
|
<table class='form'>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Type:</th>
|
<th>Type:</th>
|
||||||
|
@ -164,7 +166,7 @@ function ask_questions()
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td colspan="2"><input type="submit" value="Go!"></td></tr>
|
<tr><td colspan="2"><input type="submit" value="Go!"></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</center>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', update_qs);
|
document.addEventListener('DOMContentLoaded', update_qs);
|
||||||
function q(n) {
|
function q(n) {
|
||||||
|
@ -342,7 +344,7 @@ function write_config($dsn)
|
||||||
function exit_with_page($title, $body, $code=0)
|
function exit_with_page($title, $body, $code=0)
|
||||||
{
|
{
|
||||||
print("<!DOCTYPE html>
|
print("<!DOCTYPE html>
|
||||||
<html>
|
<html lang='en'>
|
||||||
<head>
|
<head>
|
||||||
<title>Shimmie Installer</title>
|
<title>Shimmie Installer</title>
|
||||||
<link rel=\"shortcut icon\" href=\"ext/static_files/static/favicon.ico\">
|
<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);
|
return ($ext ? $ext : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @noinspection PhpUnhandledExceptionInspection */
|
||||||
function getSubclassesOf(string $parent)
|
function getSubclassesOf(string $parent)
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
require_once "core/basepage.php";
|
require_once "core/basepage.php";
|
||||||
|
|
||||||
class BasePageTest extends \PHPUnit\Framework\TestCase
|
class BasePageTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test_page()
|
public function test_page()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
require_once "core/block.php";
|
require_once "core/block.php";
|
||||||
|
|
||||||
class BlockTest extends \PHPUnit\Framework\TestCase
|
class BlockTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test_basic()
|
public function test_basic()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
require_once "core/polyfills.php";
|
require_once "core/polyfills.php";
|
||||||
|
|
||||||
class PolyfillsTest extends \PHPUnit\Framework\TestCase
|
class PolyfillsTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test_html_escape()
|
public function test_html_escape()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
require_once "core/imageboard/tag.php";
|
require_once "core/imageboard/tag.php";
|
||||||
|
|
||||||
class TagTest extends \PHPUnit\Framework\TestCase
|
class TagTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test_caret()
|
public function test_caret()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
require_once "core/urls.php";
|
require_once "core/urls.php";
|
||||||
|
|
||||||
class UrlsTest extends \PHPUnit\Framework\TestCase
|
class UrlsTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test_make_link()
|
public function test_make_link()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
require_once "core/util.php";
|
require_once "core/util.php";
|
||||||
|
|
||||||
class UtilTest extends \PHPUnit\Framework\TestCase
|
class UtilTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test_warehouse_path()
|
public function test_warehouse_path()
|
||||||
{
|
{
|
||||||
|
|
|
@ -214,7 +214,7 @@ class User
|
||||||
$d = urlencode($config->get_string("avatar_gravatar_default"));
|
$d = urlencode($config->get_string("avatar_gravatar_default"));
|
||||||
$r = $config->get_string("avatar_gravatar_rating");
|
$r = $config->get_string("avatar_gravatar_rating");
|
||||||
$cb = date("Y-m-d");
|
$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 "";
|
return "";
|
||||||
|
|
|
@ -468,7 +468,9 @@ function get_debug_info(): string
|
||||||
* Request initialisation stuff *
|
* Request initialisation stuff *
|
||||||
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
/** @privatesection */
|
/** @privatesection
|
||||||
|
* @noinspection PhpIncludeInspection
|
||||||
|
*/
|
||||||
|
|
||||||
function require_all(array $files): void
|
function require_all(array $files): void
|
||||||
{
|
{
|
||||||
|
@ -493,7 +495,7 @@ function _load_theme_files()
|
||||||
|
|
||||||
function _sanitise_environment(): void
|
function _sanitise_environment(): void
|
||||||
{
|
{
|
||||||
global $_tracer, $tracer_enabled;
|
global $tracer_enabled;
|
||||||
|
|
||||||
$min_php = "7.3";
|
$min_php = "7.3";
|
||||||
if (version_compare(phpversion(), $min_php, ">=") === false) {
|
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
|
// 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.
|
// check if tracer output is enabled before making use of it.
|
||||||
$tracer_enabled = constant('TRACE_FILE')!==null;
|
$tracer_enabled = constant('TRACE_FILE')!==null;
|
||||||
$_tracer = new EventTracer();
|
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
|
@ -553,12 +554,14 @@ function _get_themelet_files(string $_theme): array
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to display fatal errors to the web user.
|
* Used to display fatal errors to the web user.
|
||||||
|
* @noinspection PhpPossiblePolymorphicInvocationInspection
|
||||||
*/
|
*/
|
||||||
function _fatal_error(Exception $e): void
|
function _fatal_error(Exception $e): void
|
||||||
{
|
{
|
||||||
$version = VERSION;
|
$version = VERSION;
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
$phpver = phpversion();
|
$phpver = phpversion();
|
||||||
|
$query = is_subclass_of($e, "SCoreException") ? $e->query : null;
|
||||||
|
|
||||||
//$hash = exec("git rev-parse HEAD");
|
//$hash = exec("git rev-parse HEAD");
|
||||||
//$h_hash = $hash ? "<p><b>Hash:</b> $hash" : "";
|
//$h_hash = $hash ? "<p><b>Hash:</b> $hash" : "";
|
||||||
|
@ -576,13 +579,13 @@ function _fatal_error(Exception $e): void
|
||||||
|
|
||||||
print("Message: $message\n");
|
print("Message: $message\n");
|
||||||
|
|
||||||
if (isset($e->query)) {
|
if ($query) {
|
||||||
print("Query: {$e->query}\n");
|
print("Query: {$query}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Version: $version (on $phpver)\n");
|
print("Version: $version (on $phpver)\n");
|
||||||
} else {
|
} 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");
|
header("HTTP/1.0 500 Internal Error");
|
||||||
echo '
|
echo '
|
||||||
<!doctype html>
|
<!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
|
* Sent when the admin page is ready to be added to
|
||||||
|
|
|
@ -37,7 +37,7 @@ class AdminPageTheme extends Themelet
|
||||||
*/
|
*/
|
||||||
public function display_form()
|
public function display_form()
|
||||||
{
|
{
|
||||||
global $page, $database;
|
global $page;
|
||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
$html .= $this->button("All tags to lowercase", "lowercase_all_tags", true);
|
$html .= $this->button("All tags to lowercase", "lowercase_all_tags", true);
|
||||||
|
|
|
@ -14,8 +14,7 @@ ul.tagit li.tagit-choice {
|
||||||
-webkit-border-radius: 6px;
|
-webkit-border-radius: 6px;
|
||||||
border: 1px solid #CAD8F3;
|
border: 1px solid #CAD8F3;
|
||||||
|
|
||||||
background: none;
|
background: #DEE7F8 none;
|
||||||
background-color: #DEE7F8;
|
|
||||||
|
|
||||||
font-weight: normal;
|
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">$2</a>', $text);
|
||||||
$text = preg_replace('!\[url\]((?:https?|ftp|irc|mailto)://.*?)\[/url\]!s', '<a href="$1">$1</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('!\[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').'">$2</a>', $text);
|
||||||
$text = preg_replace('!\[\[([^\]]+)\]\]!s', '<a href="'.make_link('wiki/$1').'">$1</a>', $text);
|
$text = preg_replace('!\[\[([^\]]+)\]\]!s', '<a href="'.make_link('wiki/$1').'">$1</a>', $text);
|
||||||
$text = preg_replace("!\n\s*\n!", "\n\n", $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));
|
$clean_date = date("y/m/d", strtotime($messy_date));
|
||||||
$entry_text = $entries[$i]['entry_text'];
|
$entry_text = $entries[$i]['entry_text'];
|
||||||
if ($entries[$i]['important'] == 'Y') {
|
if ($entries[$i]['important'] == 'Y') {
|
||||||
$i_open = "<font color='#{$i_color}'>";
|
$i_open = "<span style='color: #$i_color;'>";
|
||||||
$i_close="</font>";
|
$i_close="</span>";
|
||||||
}
|
}
|
||||||
$html .= "{$i_open}{$clean_date} - {$entry_text}{$i_close}<br /><br />";
|
$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));
|
$clean_date = date("m/d/y", strtotime($messy_date));
|
||||||
$entry_text = $entries[$i]['entry_text'];
|
$entry_text = $entries[$i]['entry_text'];
|
||||||
if ($entries[$i]['important'] == 'Y') {
|
if ($entries[$i]['important'] == 'Y') {
|
||||||
$i_open = "<font color='#{$i_color}'>";
|
$i_open = "<span style='color: #$i_color'>";
|
||||||
$i_close="</font>";
|
$i_close="</span>";
|
||||||
}
|
}
|
||||||
$entries_list .= "<li>{$i_open}{$clean_date} - {$entry_text}{$i_close}</li>";
|
$entries_list .= "<li>{$i_open}{$clean_date} - {$entry_text}{$i_close}</li>";
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
background: #DDD;
|
background: #DDD;
|
||||||
border: 1px solid #CCC;
|
border: 1px solid #CCC;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0;
|
||||||
left: -195px;
|
left: -195px;
|
||||||
width: 180px;
|
width: 180px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
box-shadow: 0px 0px 4px #000;
|
box-shadow: 0 0 4px #000;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.comment:hover .info {
|
.comment:hover .info {
|
||||||
|
@ -39,6 +39,6 @@
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,13 +94,13 @@ class CommentListTest extends ShimmiePHPUnitTestCase
|
||||||
|
|
||||||
# make a comment
|
# make a comment
|
||||||
send_event(new CommentPostingEvent($image_id, $user, "Test Comment ASDFASDF"));
|
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");
|
$this->assert_text("ASDFASDF");
|
||||||
|
|
||||||
# delete a comment
|
# delete a comment
|
||||||
$comment_id = (int)$database->get_one("SELECT id FROM comments");
|
$comment_id = (int)$database->get_one("SELECT id FROM comments");
|
||||||
send_event(new CommentDeletionEvent($comment_id));
|
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");
|
$this->assert_no_text("ASDFASDF");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ class CommentListTheme extends Themelet
|
||||||
if (!empty($comment->owner_email)) {
|
if (!empty($comment->owner_email)) {
|
||||||
$hash = md5(strtolower($comment->owner_email));
|
$hash = md5(strtolower($comment->owner_email));
|
||||||
$cb = date("Y-m-d");
|
$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_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}") : "";
|
$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'])) {
|
elseif (false && isset($_GET['tags'])) {
|
||||||
$start = isset($_GET['after_id']) ? int_escape($_GET['offset']) : 0;
|
$start = isset($_GET['after_id']) ? int_escape($_GET['offset']) : 0;
|
||||||
$tags = Tag::explode($_GET['tags']);
|
$tags = Tag::explode($_GET['tags']);
|
||||||
|
assert(!is_null($start) && !is_null($tags));
|
||||||
} else {
|
} else {
|
||||||
$start = isset($_GET['after_id']) ? int_escape($_GET['offset']) : 0;
|
$start = isset($_GET['after_id']) ? int_escape($_GET['offset']) : 0;
|
||||||
$sqlresult = $database->get_all(
|
$sqlresult = $database->get_all(
|
||||||
|
|
|
@ -9,7 +9,7 @@ class DowntimeTheme extends Themelet
|
||||||
{
|
{
|
||||||
$page->add_block(new Block(
|
$page->add_block(new Block(
|
||||||
"Downtime",
|
"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",
|
"left",
|
||||||
0
|
0
|
||||||
));
|
));
|
||||||
|
@ -30,7 +30,7 @@ class DowntimeTheme extends Themelet
|
||||||
$page->set_code(503);
|
$page->set_code(503);
|
||||||
$page->set_data(
|
$page->set_data(
|
||||||
<<<EOD
|
<<<EOD
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Downtime</title>
|
<title>Downtime</title>
|
||||||
<link rel="stylesheet" href="$data_href/themes/$theme_name/style.css" type="text/css">
|
<link rel="stylesheet" href="$data_href/themes/$theme_name/style.css" type="text/css">
|
||||||
|
@ -38,7 +38,7 @@ class DowntimeTheme extends Themelet
|
||||||
<body>
|
<body>
|
||||||
<div id="downtime">
|
<div id="downtime">
|
||||||
<section>
|
<section>
|
||||||
<h1><center>Down for Maintenance</center></h1>
|
<h1 style="text-align: center;">Down for Maintenance</h1>
|
||||||
<div id="message" class="blockbody">
|
<div id="message" class="blockbody">
|
||||||
$message
|
$message
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Emoticons extends FormatterExtension
|
||||||
public function format(string $text): string
|
public function format(string $text): string
|
||||||
{
|
{
|
||||||
$data_href = get_base_href();
|
$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;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,13 @@ class EmoticonListTheme extends Themelet
|
||||||
{
|
{
|
||||||
global $page;
|
global $page;
|
||||||
$data_href = get_base_href();
|
$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>";
|
$html .= "<table><tr>";
|
||||||
$n = 1;
|
$n = 1;
|
||||||
foreach ($list as $item) {
|
foreach ($list as $item) {
|
||||||
$pathinfo = pathinfo($item);
|
$pathinfo = pathinfo($item);
|
||||||
$name = $pathinfo["filename"];
|
$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) {
|
if ($n++ % 3 == 0) {
|
||||||
$html .= "</tr><tr>";
|
$html .= "</tr><tr>";
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ class CBZFileHandlerTheme extends Themelet
|
||||||
</div>
|
</div>
|
||||||
<div id='comicView'>
|
<div id='comicView'>
|
||||||
<a id='comicPrev'><span><</span></a>
|
<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>
|
<a id='comicNext'><span>></span></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,14 @@ class SVGFileHandlerTheme extends Themelet
|
||||||
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
|
$ilink = make_link("get_svg/{$image->id}/{$image->id}.svg");
|
||||||
// $ilink = $image->get_image_link();
|
// $ilink = $image->get_image_link();
|
||||||
$html = "
|
$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));
|
$page->add_block(new Block("Image", $html, "main", 10));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,15 +13,6 @@ class VideoFileHandlerTheme extends Themelet
|
||||||
$loop = $config->get_bool("video_playback_loop");
|
$loop = $config->get_bool("video_playback_loop");
|
||||||
$player = make_link('vendor/bower-asset/mediaelement/build/flashmediaelement.swf');
|
$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/>";
|
$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
|
//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}"
|
. "&poster={$thumb_url}"
|
||||||
. "&file={$full_url}"
|
. "&file={$full_url}"
|
||||||
. "&loop=" . ($loop ? 'true' : 'false') . "\" />
|
. "&loop=" . ($loop ? 'true' : 'false') . "\" />
|
||||||
<img src=\"{$thumb_url}\" />
|
<img alt='thumb' src=\"{$thumb_url}\" />
|
||||||
</object>";
|
</object>";
|
||||||
|
|
||||||
if ($ext == "flv") {
|
if ($ext == "flv") {
|
||||||
|
|
|
@ -64,7 +64,6 @@ class HelpPages extends Extension
|
||||||
} else {
|
} else {
|
||||||
$page->set_mode(PageMode::PAGE);
|
$page->set_mode(PageMode::PAGE);
|
||||||
$name = $event->get_arg(0);
|
$name = $event->get_arg(0);
|
||||||
$title = $name;
|
|
||||||
if (array_key_exists($name, $pages)) {
|
if (array_key_exists($name, $pages)) {
|
||||||
$title = $pages[$name];
|
$title = $pages[$name];
|
||||||
} else {
|
} 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;}
|
div#front-page {text-align:center;}
|
||||||
.space {margin-bottom: 1em;}
|
.space {margin-bottom: 1em;}
|
||||||
div#front-page div#links a {margin: 0 0.5em;}
|
div#front-page div#links a {margin: 0 0.5em;}
|
||||||
|
|
|
@ -10,7 +10,7 @@ class HomeTheme extends Themelet
|
||||||
$page->set_data(
|
$page->set_data(
|
||||||
<<<EOD
|
<<<EOD
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>$sitename</title>
|
<title>$sitename</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
|
|
|
@ -37,7 +37,7 @@ class ImageBanTest extends ShimmiePHPUnitTestCase
|
||||||
$this->assertEquals(200, $page->code);
|
$this->assertEquals(200, $page->code);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onNotSuccessfulTest(\Throwable $t): void
|
public function onNotSuccessfulTest(Throwable $t): void
|
||||||
{
|
{
|
||||||
send_event(new RemoveImageHashBanEvent($this->hash));
|
send_event(new RemoveImageHashBanEvent($this->hash));
|
||||||
parent::onNotSuccessfulTest($t); // TODO: Change the autogenerated stub
|
parent::onNotSuccessfulTest($t); // TODO: Change the autogenerated stub
|
||||||
|
|
|
@ -172,7 +172,6 @@ class IndexTest extends ShimmiePHPUnitTestCase
|
||||||
/** @depends testUpload */
|
/** @depends testUpload */
|
||||||
public function testMixedSearchTagMeta($image_ids)
|
public function testMixedSearchTagMeta($image_ids)
|
||||||
{
|
{
|
||||||
global $database;
|
|
||||||
// multiple tags, many results
|
// multiple tags, many results
|
||||||
$this->assert_search_results(["computer", "size=640x480"], [$image_ids[1], $image_ids[0]]);
|
$this->assert_search_results(["computer", "size=640x480"], [$image_ids[1], $image_ids[0]]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ class LinkImageTheme extends Themelet
|
||||||
{
|
{
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case "html":
|
case "html":
|
||||||
$text = "<img src=\"$src\" />";
|
$text = "<img src=\"$src\" alt=\"\" />";
|
||||||
break;
|
break;
|
||||||
case "ubb":
|
case "ubb":
|
||||||
$text = "[img]".$src."[/img]";
|
$text = "[img]".$src."[/img]";
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
background-color: #fffdef;
|
background-color: #fffdef;
|
||||||
border: #412a21 1px solid;
|
border: #412a21 1px solid;
|
||||||
font-size: 8pt;
|
font-size: 8pt;
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 175px;
|
width: 175px;
|
||||||
|
|
|
@ -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])))));
|
$f_dte = make_link("popular_by_".$dte[3]."?".date($dte[2], (strtotime('+1 '.$dte[3], strtotime($dte[0])))));
|
||||||
|
|
||||||
$html = "\n".
|
$html = "\n".
|
||||||
"<center>\n".
|
"<h3 style='text-align: center;'>\n".
|
||||||
" <h3>\n".
|
|
||||||
" <a href='{$b_dte}'>«</a> {$dte[1]} <a href='{$f_dte}'>»</a>\n".
|
" <a href='{$b_dte}'>«</a> {$dte[1]} <a href='{$f_dte}'>»</a>\n".
|
||||||
"</h3>\n".
|
"</h3>\n".
|
||||||
"</center>\n".
|
|
||||||
"<br/>\n".$pop_images;
|
"<br/>\n".$pop_images;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -239,6 +239,7 @@ class OuroborosPost extends _SafeOuroborosImage
|
||||||
/**
|
/**
|
||||||
* Initialize an OuroborosPost for creation
|
* Initialize an OuroborosPost for creation
|
||||||
* Mainly just acts as a wrapper and validation layer
|
* Mainly just acts as a wrapper and validation layer
|
||||||
|
* @noinspection PhpMissingParentConstructorInspection
|
||||||
*/
|
*/
|
||||||
public function __construct(array $post, string $md5 = '')
|
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("s", "Safe", "safe", 0));
|
||||||
add_rating(new ImageRating("q", "Questionable", "questionable", 500));
|
add_rating(new ImageRating("q", "Questionable", "questionable", 500));
|
||||||
add_rating(new ImageRating("e", "Explicit", "explicit", 1000));
|
add_rating(new ImageRating("e", "Explicit", "explicit", 1000));
|
||||||
|
/** @noinspection PhpIncludeInspection */
|
||||||
@include_once "data/config/ratings.conf.php";
|
@include_once "data/config/ratings.conf.php";
|
||||||
|
|
||||||
class RatingSetEvent extends Event
|
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_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_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>
|
<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>
|
<option value=''>All</option>
|
||||||
".implode($types)."
|
".implode($types)."
|
||||||
</select>
|
</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?')")."
|
<p>".make_form(make_link("admin/delete_thumbs"), "POST", false, "", "return confirm('Are you sure you want to delete all thumbnails?')")."
|
||||||
<table class='form'>
|
<table class='form'>
|
||||||
<tr><th><label for='delete_thumb_type'>Type</label></th><td>
|
<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>
|
<option value=''>All</option>
|
||||||
".implode($types)."
|
".implode($types)."
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -182,6 +182,7 @@ class RelationshipsTest extends ShimmiePHPUnitTestCase
|
||||||
public function testRemoveParentByTag($imgs)
|
public function testRemoveParentByTag($imgs)
|
||||||
{
|
{
|
||||||
[$image_1, $image_2, $image_3] = $imgs;
|
[$image_1, $image_2, $image_3] = $imgs;
|
||||||
|
assert(!is_null($image_3));
|
||||||
|
|
||||||
// check parent is set
|
// check parent is set
|
||||||
$this->assertEquals($image_2->parent_id, $image_1->id);
|
$this->assertEquals($image_2->parent_id, $image_1->id);
|
||||||
|
|
|
@ -4,7 +4,7 @@ class RSSImagesTest extends ShimmiePHPUnitTestCase
|
||||||
public function testImageFeed()
|
public function testImageFeed()
|
||||||
{
|
{
|
||||||
$this->log_in_as_user();
|
$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->log_out();
|
||||||
|
|
||||||
$this->get_page('rss/images');
|
$this->get_page('rss/images');
|
||||||
|
|
|
@ -6,10 +6,10 @@ BODY.censored FOOTER {
|
||||||
}
|
}
|
||||||
.tnc_bg {
|
.tnc_bg {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0px;
|
top: 0;
|
||||||
left: 0px;
|
left: 0;
|
||||||
right: 0px;
|
right: 0;
|
||||||
bottom: 0px;
|
bottom: 0;
|
||||||
background: #ACE4A3;
|
background: #ACE4A3;
|
||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
z-index: 999999999999999999999;
|
z-index: 999999999999999999999;
|
||||||
|
|
|
@ -271,6 +271,9 @@ class SetupBlock extends Block
|
||||||
|
|
||||||
class Setup extends Extension
|
class Setup extends Extension
|
||||||
{
|
{
|
||||||
|
/** @var SetupTheme */
|
||||||
|
protected $theme;
|
||||||
|
|
||||||
public function onInitExt(InitExtEvent $event)
|
public function onInitExt(InitExtEvent $event)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
|
@ -38,6 +38,6 @@
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,10 +107,12 @@ class XMLSitemap extends Extension
|
||||||
|
|
||||||
/* --- Add all other images to sitemap with lower priority --- */
|
/* --- Add all other images to sitemap with lower priority --- */
|
||||||
$otherimages = Image::find_images(51, 10000000, []);
|
$otherimages = Image::find_images(51, 10000000, []);
|
||||||
|
$image = null;
|
||||||
foreach ($otherimages as $arrayid => $image) {
|
foreach ($otherimages as $arrayid => $image) {
|
||||||
// create url from image id's
|
// create url from image id's
|
||||||
$otherimages[$arrayid] = "post/view/$image->id";
|
$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)));
|
$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;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
IMG {border: none;}
|
IMG {border: none;}
|
||||||
FORM {margin: 0px;}
|
FORM {margin: 0;}
|
||||||
IMG.lazy {display: none;}
|
IMG.lazy {display: none;}
|
||||||
|
|
||||||
#flash {
|
#flash {
|
||||||
|
@ -54,12 +54,12 @@ IMG.lazy {display: none;}
|
||||||
#installer H1, #installer H3 {
|
#installer H1, #installer H3 {
|
||||||
background: #DDD;
|
background: #DDD;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
#installer H1 {
|
#installer H1 {
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
border-radius: 16px 16px 0px 0px;
|
border-radius: 16px 16px 0 0;
|
||||||
}
|
}
|
||||||
#installer H3 {
|
#installer H3 {
|
||||||
border-bottom: 1px solid black;
|
border-bottom: 1px solid black;
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#tagger_toolbar, #tagger_body {
|
#tagger_toolbar, #tagger_body {
|
||||||
padding:2px 2px 0 2px;
|
padding:2px 2px 0 2px;
|
||||||
border-style:solid;
|
border-style:solid;
|
||||||
border-width: 0px 2px 0px 2px;
|
border-width: 0 2px 0 2px;
|
||||||
}
|
}
|
||||||
#tagger_body {
|
#tagger_body {
|
||||||
max-height:175px;
|
max-height:175px;
|
||||||
|
|
|
@ -79,7 +79,7 @@ class TipsTheme extends Themelet
|
||||||
(
|
(
|
||||||
empty($tip['image']) ?
|
empty($tip['image']) ?
|
||||||
"<td></td>" :
|
"<td></td>" :
|
||||||
"<td><img src=".$url.$tip['image']." /></td>"
|
"<td><img alt='' src=".$url.$tip['image']." /></td>"
|
||||||
).
|
).
|
||||||
"<td class='left'>".$tip['text']."</td>";
|
"<td class='left'>".$tip['text']."</td>";
|
||||||
|
|
||||||
|
|
|
@ -131,11 +131,10 @@ if(document.getElementById("image-container") !== null) {
|
||||||
|
|
||||||
if(supext.search(furl.match("[a-zA-Z0-9]+$")[0]) !== -1){
|
if(supext.search(furl.match("[a-zA-Z0-9]+$")[0]) !== -1){
|
||||||
history.pushState(history.state, document.title, location.href);
|
history.pushState(history.state, document.title, location.href);
|
||||||
var href = ste + furl +
|
location.href = ste + furl +
|
||||||
"&tags=" + encodeURIComponent(tag) +
|
"&tags=" + encodeURIComponent(tag) +
|
||||||
"&rating=" + encodeURIComponent(rating) +
|
"&rating=" + encodeURIComponent(rating) +
|
||||||
"&source=" + encodeURIComponent(source);
|
"&source=" + encodeURIComponent(source);
|
||||||
location.href = href;
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
alert(notsup);
|
alert(notsup);
|
||||||
|
|
|
@ -17,6 +17,7 @@ class VarnishPurger extends Extension
|
||||||
$result = curl_exec($ch);
|
$result = curl_exec($ch);
|
||||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
assert(!is_null($result) && !is_null($httpCode));
|
||||||
//return $result;
|
//return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,6 @@ class ViewImageTest extends ShimmiePHPUnitTestCase
|
||||||
{
|
{
|
||||||
$this->log_in_as_user();
|
$this->log_in_as_user();
|
||||||
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
$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->get_page("post/view/$image_id_1");
|
||||||
$this->assert_title("Image $image_id_1: test");
|
$this->assert_title("Image $image_id_1: test");
|
||||||
|
@ -52,10 +49,8 @@ class ViewImageTest extends ShimmiePHPUnitTestCase
|
||||||
public function testView404()
|
public function testView404()
|
||||||
{
|
{
|
||||||
$this->log_in_as_user();
|
$this->log_in_as_user();
|
||||||
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "test");
|
$image_id_1 = $this->post_image("tests/favicon.png", "test");
|
||||||
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "test2");
|
$idp1 = $image_id_1 + 1;
|
||||||
$image_id_3 = $this->post_image("tests/favicon.png", "test");
|
|
||||||
$idp1 = $image_id_3 + 1;
|
|
||||||
|
|
||||||
$this->get_page("post/view/$idp1");
|
$this->get_page("post/view/$idp1");
|
||||||
$this->assert_title('Image not found');
|
$this->assert_title('Image not found');
|
||||||
|
|
|
@ -10,7 +10,7 @@ class WordFilterTest extends ShimmiePHPUnitTestCase
|
||||||
|
|
||||||
public function _doThings($in, $out)
|
public function _doThings($in, $out)
|
||||||
{
|
{
|
||||||
global $user, $_tracer;
|
global $user;
|
||||||
$this->log_in_as_user();
|
$this->log_in_as_user();
|
||||||
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
|
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
|
||||||
send_event(new CommentPostingEvent($image_id, $user, $in));
|
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.
|
//CHECK: Should we just point to install.php instead? Seems unsafe though.
|
||||||
print <<<EOD
|
print <<<EOD
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Shimmie Error</title>
|
<title>Shimmie Error</title>
|
||||||
<link rel="shortcut icon" href="ext/static_files/static/favicon.ico">
|
<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;
|
global $cache, $config, $database, $user, $page, $_tracer;
|
||||||
_sanitise_environment();
|
_sanitise_environment();
|
||||||
|
$_tracer = new EventTracer();
|
||||||
$_tracer->begin("Bootstrap");
|
$_tracer->begin("Bootstrap");
|
||||||
_load_core_files();
|
_load_core_files();
|
||||||
$cache = new Cache(CACHE_DSN);
|
$cache = new Cache(CACHE_DSN);
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<?php declare(strict_types=1);
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
chdir(dirname(dirname(__FILE__)));
|
chdir(dirname(dirname(__FILE__)));
|
||||||
require_once "vendor/autoload.php";
|
require_once "vendor/autoload.php";
|
||||||
require_once "tests/defines.php";
|
require_once "tests/defines.php";
|
||||||
|
@ -14,6 +17,7 @@ if (file_exists("tests/trace.json")) {
|
||||||
global $cache, $config, $database, $user, $page, $_tracer;
|
global $cache, $config, $database, $user, $page, $_tracer;
|
||||||
_sanitise_environment();
|
_sanitise_environment();
|
||||||
$tracer_enabled = true;
|
$tracer_enabled = true;
|
||||||
|
$_tracer = new EventTracer();
|
||||||
$_tracer->begin("bootstrap");
|
$_tracer->begin("bootstrap");
|
||||||
_load_core_files();
|
_load_core_files();
|
||||||
$cache = new Cache(CACHE_DSN);
|
$cache = new Cache(CACHE_DSN);
|
||||||
|
@ -34,7 +38,7 @@ send_event(new DatabaseUpgradeEvent());
|
||||||
send_event(new InitExtEvent());
|
send_event(new InitExtEvent());
|
||||||
$_tracer->end();
|
$_tracer->end();
|
||||||
|
|
||||||
abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
|
abstract class ShimmiePHPUnitTestCase extends TestCase
|
||||||
{
|
{
|
||||||
protected static $anon_name = "anonymous";
|
protected static $anon_name = "anonymous";
|
||||||
protected static $admin_name = "demo";
|
protected static $admin_name = "demo";
|
||||||
|
@ -44,7 +48,7 @@ abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
|
||||||
public static function setUpBeforeClass(): void
|
public static function setUpBeforeClass(): void
|
||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
global $_tracer, $config;
|
global $_tracer;
|
||||||
$_tracer->begin(get_called_class());
|
$_tracer->begin(get_called_class());
|
||||||
|
|
||||||
self::create_user(self::$admin_name);
|
self::create_user(self::$admin_name);
|
||||||
|
|
|
@ -15,3 +15,4 @@ define("TRACE_THRESHOLD", 0.0);
|
||||||
define("TIMEZONE", 'UTC');
|
define("TIMEZONE", 'UTC');
|
||||||
define("BASE_HREF", "/test");
|
define("BASE_HREF", "/test");
|
||||||
define("CLI_LOG_LEVEL", 50);
|
define("CLI_LOG_LEVEL", 50);
|
||||||
|
define("STATSD_HOST", null);
|
||||||
|
|
|
@ -7,7 +7,7 @@ BODY {
|
||||||
background: #EEE;
|
background: #EEE;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
H1 {
|
H1 {
|
||||||
background: #BBB;
|
background: #BBB;
|
||||||
|
@ -19,7 +19,7 @@ H1 A {
|
||||||
}
|
}
|
||||||
H3 {
|
H3 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
SECTION>H3 {
|
SECTION>H3 {
|
||||||
background: #CCC;
|
background: #CCC;
|
||||||
|
@ -46,7 +46,7 @@ TD {
|
||||||
text-align: center;
|
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 TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
|
||||||
TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #CCC;}
|
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;}
|
TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #CCC;}
|
||||||
|
@ -89,11 +89,11 @@ NAV TABLE {
|
||||||
}
|
}
|
||||||
NAV INPUT {
|
NAV INPUT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
NAV SELECT {
|
NAV SELECT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TABLE.tag_list {
|
TABLE.tag_list {
|
||||||
|
|
|
@ -37,7 +37,7 @@ class CustomCommentListTheme extends CommentListTheme
|
||||||
$comment_html .= $this->comment_to_html($comment, false);
|
$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 .= "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 .= html_escape($image->get_tag_list());
|
||||||
$html .= "<div style='text-align: left'>";
|
$html .= "<div style='text-align: left'>";
|
||||||
|
|
|
@ -10,8 +10,8 @@ BODY {
|
||||||
color: #800000;
|
color: #800000;
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
margin-right: 0px;
|
margin-right: 0;
|
||||||
margin-left: 0px;
|
margin-left: 0;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
H1 {
|
H1 {
|
||||||
|
@ -30,7 +30,7 @@ FOOTER {
|
||||||
|
|
||||||
A, A:visited {text-decoration: none; color: #0000EE;}
|
A, A:visited {text-decoration: none; color: #0000EE;}
|
||||||
A:hover {text-decoration: underline; color: #DD0000;}
|
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 {
|
NAV {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
|
@ -45,11 +45,11 @@ NAV TD {
|
||||||
}
|
}
|
||||||
NAV INPUT {
|
NAV INPUT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
NAV SELECT {
|
NAV SELECT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
NAV H3 {
|
NAV H3 {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
@ -92,7 +92,7 @@ TABLE.tag_list>TBODY>TR>TD:after {
|
||||||
}
|
}
|
||||||
.comment {
|
.comment {
|
||||||
/*background: #FFFFEE;*/
|
/*background: #FFFFEE;*/
|
||||||
border-width: 0px;
|
border-width: 0;
|
||||||
}
|
}
|
||||||
.reply, .paginator {
|
.reply, .paginator {
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
|
@ -106,7 +106,7 @@ TABLE.tag_list>TBODY>TR>TD:after {
|
||||||
}
|
}
|
||||||
.reply P {
|
.reply P {
|
||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.setupblock {
|
.setupblock {
|
||||||
|
|
|
@ -7,15 +7,15 @@ BODY {
|
||||||
background: #F0F7FF;
|
background: #F0F7FF;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
3 menu bar *
|
3 menu bar *
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
.menu {
|
.menu {
|
||||||
border-bottom: 1px solid #C3D2E0;
|
border-bottom: 1px solid #C3D2E0;
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
background: #E3EFFA;
|
background: #E3EFFA;
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ a.tab:hover, a.tab:active, .tab-selected {
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
.sbar {
|
.sbar {
|
||||||
border-bottom: 1px solid #C3D2E0;
|
border-bottom: 1px solid #C3D2E0;
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
background: #CEDFF0;
|
background: #CEDFF0;
|
||||||
|
@ -53,8 +53,8 @@ a.tab:hover, a.tab:active, .tab-selected {
|
||||||
}
|
}
|
||||||
.sfoot {
|
.sfoot {
|
||||||
border-top: 1px solid #C3D2E0;
|
border-top: 1px solid #C3D2E0;
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
background: #CEDFF0;
|
background: #CEDFF0;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
@ -83,14 +83,14 @@ a.tab:hover, a.tab:active, .tab-selected {
|
||||||
margin:0 0 2px 0; /* top right bottom left */
|
margin:0 0 2px 0; /* top right bottom left */
|
||||||
padding:2px 10px;
|
padding:2px 10px;
|
||||||
position:relative;
|
position:relative;
|
||||||
left:0px;
|
left:0;
|
||||||
width:50%;
|
width:50%;
|
||||||
}
|
}
|
||||||
.navtop {
|
.navtop {
|
||||||
top:7px;
|
top:7px;
|
||||||
}
|
}
|
||||||
.maintop {
|
.maintop {
|
||||||
top:0px;
|
top:0;
|
||||||
margin-top:5px;
|
margin-top:5px;
|
||||||
margin-bottom:5px;
|
margin-bottom:5px;
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ A, A:hover, A:active, A:visited {
|
||||||
}
|
}
|
||||||
H3 {
|
H3 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
THEAD {
|
THEAD {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -132,7 +132,7 @@ CODE {
|
||||||
background: #DDD;
|
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 TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
|
||||||
TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #C3D2E0;}
|
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;}
|
TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #C3D2E0;}
|
||||||
|
@ -198,11 +198,11 @@ NAV TD {
|
||||||
}
|
}
|
||||||
NAV INPUT, nav button {
|
NAV INPUT, nav button {
|
||||||
width: 95%;
|
width: 95%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
NAV SELECT {
|
NAV SELECT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#comments P {
|
#comments P {
|
||||||
|
@ -334,7 +334,7 @@ NAV .thumbblock {
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
NAV .thumb {
|
NAV .thumb {
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
.thumbblock {
|
.thumbblock {
|
||||||
width: 220px;
|
width: 220px;
|
||||||
|
|
|
@ -411,7 +411,7 @@ function tt_MkMainDivHtm()
|
||||||
{
|
{
|
||||||
return(
|
return(
|
||||||
'<div id="WzTtDiV"></div>' +
|
'<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>')
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ class CustomHomeTheme extends HomeTheme
|
||||||
$hh = $page->get_all_html_headers();
|
$hh = $page->get_all_html_headers();
|
||||||
$page->set_data(
|
$page->set_data(
|
||||||
<<<EOD
|
<<<EOD
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>$sitename</title>
|
<title>$sitename</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Page extends BasePage
|
||||||
{
|
{
|
||||||
global $config;
|
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');
|
$theme_name = $config->get_string(SetupConfig::THEME, 'material');
|
||||||
$site_name = $config->get_string(SetupConfig::TITLE);
|
$site_name = $config->get_string(SetupConfig::TITLE);
|
||||||
$data_href = get_base_href();
|
$data_href = get_base_href();
|
||||||
|
|
|
@ -9,7 +9,7 @@ class CustomHomeTheme extends HomeTheme
|
||||||
$hh = $page->get_all_html_headers();
|
$hh = $page->get_all_html_headers();
|
||||||
$page->set_data(
|
$page->set_data(
|
||||||
<<<EOD
|
<<<EOD
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>$sitename</title>
|
<title>$sitename</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
<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">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
$hh
|
$hh
|
||||||
<style>
|
<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;}
|
div#front-page {text-align:center;}
|
||||||
.space {margin-bottom: 1em;}
|
.space {margin-bottom: 1em;}
|
||||||
div#front-page div#links a {margin: 0 0.5em;}
|
div#front-page div#links a {margin: 0 0.5em;}
|
||||||
|
|
|
@ -15,7 +15,7 @@ a:active.menu { color: #FF0000; text-decoration: none; }
|
||||||
top:0;
|
top:0;
|
||||||
left: 5%;
|
left: 5%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menuh
|
#menuh
|
||||||
|
@ -23,7 +23,7 @@ a:active.menu { color: #FF0000; text-decoration: none; }
|
||||||
font-size: small;
|
font-size: small;
|
||||||
font-family: arial, helvetica, sans-serif;
|
font-family: arial, helvetica, sans-serif;
|
||||||
width:100%;
|
width:100%;
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menuh a.sub_option
|
#menuh a.sub_option
|
||||||
|
@ -39,7 +39,6 @@ a:active.menu { color: #FF0000; text-decoration: none; }
|
||||||
display:block;
|
display:block;
|
||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-top:0;
|
|
||||||
padding: 0.2em;
|
padding: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,15 +38,15 @@ class Page extends BasePage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# used in header.inc
|
|
||||||
$query = !empty($this->_search_query) ? html_escape(Tag::implode($this->_search_query)) : "";
|
$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>" : "";
|
$flash_html = $this->flash ? "<b id='flash'>".nl2br(html_escape(implode("\n", $this->flash)))."</b>" : "";
|
||||||
$generated = autodate(date('c'));
|
$generated = autodate(date('c'));
|
||||||
$footer_html = $this->footer_html();
|
$footer_html = $this->footer_html();
|
||||||
|
|
||||||
print <<<EOD
|
print <<<EOD
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>{$this->title}</title>
|
<title>{$this->title}</title>
|
||||||
<meta name="description" content="Rule 34, if it exists there is porn of it."/>
|
<meta name="description" content="Rule 34, if it exists there is porn of it."/>
|
||||||
|
@ -93,10 +93,18 @@ EOD;
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<footer>
|
<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 />
|
<hr />
|
||||||
<font size="2px">BTC: <b>193gutWtgirF7js14ivcXfnfQgXv9n5BZo</b>
|
<span style="font-size: 2px;">
|
||||||
ETH: <b>0x68B88a00e69Bde88E9db1b9fC10b8011226e26aF</b></font>
|
BTC: <b>193gutWtgirF7js14ivcXfnfQgXv9n5BZo</b>
|
||||||
|
ETH: <b>0x68B88a00e69Bde88E9db1b9fC10b8011226e26aF</b>
|
||||||
|
</span>
|
||||||
<hr />
|
<hr />
|
||||||
<br>
|
<br>
|
||||||
Thank you!
|
Thank you!
|
||||||
|
|
|
@ -7,11 +7,11 @@ BODY {
|
||||||
background: url(bg.png) #ACE4A3;
|
background: url(bg.png) #ACE4A3;
|
||||||
font-family: "Arial", sans-serif;
|
font-family: "Arial", sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
#header {
|
#header {
|
||||||
border-bottom: 1px solid #7EB977;
|
border-bottom: 1px solid #7EB977;
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
background: #ACE4A3;
|
background: #ACE4A3;
|
||||||
|
@ -19,15 +19,15 @@ BODY {
|
||||||
}
|
}
|
||||||
H1 {
|
H1 {
|
||||||
font-size: 5em;
|
font-size: 5em;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
H1 A {
|
H1 A {
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
H3 {
|
H3 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
THEAD {
|
THEAD {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -40,8 +40,7 @@ TD {
|
||||||
#subtitle {
|
#subtitle {
|
||||||
width: 256px;
|
width: 256px;
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
margin: auto;
|
margin: -16px auto auto;
|
||||||
margin-top: -16px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
border-top: none;
|
border-top: none;
|
||||||
|
@ -56,7 +55,7 @@ TD {
|
||||||
}
|
}
|
||||||
|
|
||||||
TABLE.zebra {background: #ACE4A3; border-collapse: collapse; border: 1px solid #7EB977;}
|
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(odd) {background: #9CD493;}
|
||||||
TABLE.zebra TR:nth-child(even) {background: #ACE4A3;}
|
TABLE.zebra TR:nth-child(even) {background: #ACE4A3;}
|
||||||
|
|
||||||
|
@ -100,11 +99,11 @@ NAV TD {
|
||||||
}
|
}
|
||||||
NAV INPUT {
|
NAV INPUT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
NAV SELECT {
|
NAV SELECT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,13 +135,13 @@ NAV SELECT {
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#commentlistimage .blockbody .comment,
|
#commentlistimage .blockbody .comment,
|
||||||
#commentlistrecent .blockbody .comment {
|
#commentlistrecent .blockbody .comment {
|
||||||
margin-left: 0px;
|
margin-left: 0;
|
||||||
margin-right: 0px;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -162,7 +161,7 @@ ARTICLE TABLE {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
NAV SECTION:first-child H3 {
|
NAV SECTION:first-child H3 {
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -209,7 +208,7 @@ SECTION>H3 {
|
||||||
|
|
||||||
div#twitter_update_list li {
|
div#twitter_update_list li {
|
||||||
list-style:none;
|
list-style:none;
|
||||||
padding-bottom:0px;
|
padding-bottom:0;
|
||||||
text-align:left;
|
text-align:left;
|
||||||
margin-top:5px;
|
margin-top:5px;
|
||||||
margin-bottom:5px;
|
margin-bottom:5px;
|
||||||
|
@ -241,7 +240,7 @@ div#twitter_update_list li {
|
||||||
}
|
}
|
||||||
|
|
||||||
UL.tagit {
|
UL.tagit {
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
ul.tagit li.tagit-new {
|
ul.tagit li.tagit-new {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
@ -276,12 +275,12 @@ ul.tagit li.tagit-new {
|
||||||
|
|
||||||
/* responsive padding */
|
/* responsive padding */
|
||||||
@media (max-width: 1024px) {
|
@media (max-width: 1024px) {
|
||||||
NAV {margin-left: 0px;}
|
NAV {margin-left: 0;}
|
||||||
ARTICLE {margin-right: 0px; margin-left: 242px;}
|
ARTICLE {margin-right: 0; margin-left: 242px;}
|
||||||
}
|
}
|
||||||
@media (max-width: 750px) {
|
@media (max-width: 750px) {
|
||||||
NAV {margin-left: 0px;}
|
NAV {margin-left: 0;}
|
||||||
ARTICLE {margin-right: 0px; margin-left: 250px;}
|
ARTICLE {margin-right: 0; margin-left: 250px;}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* responsive navbar */
|
/* responsive navbar */
|
||||||
|
@ -293,15 +292,15 @@ ul.tagit li.tagit-new {
|
||||||
|
|
||||||
NAV>SECTION>.blockbody,
|
NAV>SECTION>.blockbody,
|
||||||
NAV>SECTION>.blockbody>.comment {
|
NAV>SECTION>.blockbody>.comment {
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
NAV>SECTION>H3 {
|
NAV>SECTION>H3 {
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BODY.navHidden #menuh-container {display: none;}
|
BODY.navHidden #menuh-container {display: none;}
|
||||||
BODY.navHidden NAV {display: none;}
|
BODY.navHidden NAV {display: none;}
|
||||||
BODY.navHidden ARTICLE {margin-left: 0px;}
|
BODY.navHidden ARTICLE {margin-left: 0;}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
NAV {
|
NAV {
|
||||||
|
@ -318,7 +317,7 @@ ul.tagit li.tagit-new {
|
||||||
BODY.navHidden {padding-top: 5.4em}
|
BODY.navHidden {padding-top: 5.4em}
|
||||||
}
|
}
|
||||||
@media (max-width: 750px) {
|
@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;}
|
.ui-autocomplete {z-index: 999999999999;}
|
||||||
BODY {padding-top: 7em}
|
BODY {padding-top: 7em}
|
||||||
}
|
}
|
||||||
|
@ -347,7 +346,7 @@ ul.tagit li.tagit-new {
|
||||||
#mini-logo {display: table-cell; width: 100px;}
|
#mini-logo {display: table-cell; width: 100px;}
|
||||||
|
|
||||||
/* hide nav-search when header-search is sticky */
|
/* hide nav-search when header-search is sticky */
|
||||||
ARTICLE {margin-top: 0px;}
|
ARTICLE {margin-top: 0;}
|
||||||
#Navigationleft .blockbody {font-size: 1.5em;}
|
#Navigationleft .blockbody {font-size: 1.5em;}
|
||||||
#Navigationleft .blockbody P,
|
#Navigationleft .blockbody P,
|
||||||
#Navigationleft .blockbody FORM
|
#Navigationleft .blockbody FORM
|
||||||
|
|
|
@ -3,7 +3,7 @@ class Themelet extends BaseThemelet
|
||||||
{
|
{
|
||||||
public function build_thumb_html(Image $image): string
|
public function build_thumb_html(Image $image): string
|
||||||
{
|
{
|
||||||
global $cache, $config, $database, $user;
|
global $cache, $config;
|
||||||
|
|
||||||
$cached = $cache->get("thumb-block:{$image->id}");
|
$cached = $cache->get("thumb-block:{$image->id}");
|
||||||
if ($cached) {
|
if ($cached) {
|
||||||
|
|
|
@ -7,11 +7,11 @@ BODY {
|
||||||
background: url(bg.png);
|
background: url(bg.png);
|
||||||
font-family: "Arial", sans-serif;
|
font-family: "Arial", sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
HEADER {
|
HEADER {
|
||||||
border-bottom: 1px solid #B89F7C;
|
border-bottom: 1px solid #B89F7C;
|
||||||
margin-top: 0px;
|
margin-top: 0;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
background: #FCD9A9;
|
background: #FCD9A9;
|
||||||
|
@ -19,15 +19,15 @@ HEADER {
|
||||||
}
|
}
|
||||||
H1 {
|
H1 {
|
||||||
font-size: 5em;
|
font-size: 5em;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
H1 A {
|
H1 A {
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
H3 {
|
H3 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0px;
|
margin: 0;
|
||||||
}
|
}
|
||||||
THEAD {
|
THEAD {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
@ -50,7 +50,7 @@ CODE {
|
||||||
background: #DDD;
|
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 TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;}
|
||||||
TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #B89F7C;}
|
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;}
|
TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #B89F7C;}
|
||||||
|
@ -109,11 +109,11 @@ NAV TD {
|
||||||
}
|
}
|
||||||
NAV INPUT {
|
NAV INPUT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
NAV SELECT {
|
NAV SELECT {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0px;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TABLE.tag_list {
|
TABLE.tag_list {
|
||||||
|
|
Reference in a new issue