Internal error - SCore-'.$version.'
diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php
index f72dd233..f587fee8 100644
--- a/ext/alias_editor/main.php
+++ b/ext/alias_editor/main.php
@@ -45,6 +45,7 @@ class DeleteAliasEvent extends Event
public function __construct(string $oldtag)
{
+ parent::__construct();
$this->oldtag = $oldtag;
}
}
diff --git a/ext/artists/main.php b/ext/artists/main.php
index 81f99399..59bb175e 100644
--- a/ext/artists/main.php
+++ b/ext/artists/main.php
@@ -459,37 +459,37 @@ class Artists extends Extension
private function get_artistID_by_url(string $url): int
{
global $database;
- return $database->get_one("SELECT artist_id FROM artist_urls WHERE url = :url", ['url'=>$url]);
+ return (int)$database->get_one("SELECT artist_id FROM artist_urls WHERE url = :url", ['url'=>$url]);
}
private function get_artistID_by_memberName(string $member): int
{
global $database;
- return $database->get_one("SELECT artist_id FROM artist_members WHERE name = :name", ['name'=>$member]);
+ return (int)$database->get_one("SELECT artist_id FROM artist_members WHERE name = :name", ['name'=>$member]);
}
private function get_artistName_by_artistID(int $artistID): string
{
global $database;
- return $database->get_one("SELECT name FROM artists WHERE id = :id", ['id'=>$artistID]);
+ return (string)$database->get_one("SELECT name FROM artists WHERE id = :id", ['id'=>$artistID]);
}
private function get_artistID_by_aliasID(int $aliasID): int
{
global $database;
- return $database->get_one("SELECT artist_id FROM artist_alias WHERE id = :id", ['id'=>$aliasID]);
+ return (int)$database->get_one("SELECT artist_id FROM artist_alias WHERE id = :id", ['id'=>$aliasID]);
}
private function get_artistID_by_memberID(int $memberID): int
{
global $database;
- return $database->get_one("SELECT artist_id FROM artist_members WHERE id = :id", ['id'=>$memberID]);
+ return (int)$database->get_one("SELECT artist_id FROM artist_members WHERE id = :id", ['id'=>$memberID]);
}
private function get_artistID_by_urlID(int $urlID): int
{
global $database;
- return $database->get_one("SELECT artist_id FROM artist_urls WHERE id = :id", ['id'=>$urlID]);
+ return (int)$database->get_one("SELECT artist_id FROM artist_urls WHERE id = :id", ['id'=>$urlID]);
}
private function delete_alias(int $aliasID)
diff --git a/ext/pools/main.php b/ext/pools/main.php
index 4f6d751f..dd4d887b 100644
--- a/ext/pools/main.php
+++ b/ext/pools/main.php
@@ -692,7 +692,7 @@ class Pools extends Extension
$images .= " " . $imageID;
}
- $count = $database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
+ $count = (int)$database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
$this->add_history($poolID, 0, $images, $count);
return $poolID;
}
@@ -982,7 +982,7 @@ class Pools extends Extension
continue; // go on to the next one.
}
- $count = $database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
+ $count = (int)$database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
$this->add_history($poolID, $newAction, $imageArray, $count);
}
}
@@ -1020,7 +1020,7 @@ class Pools extends Extension
$this->update_count($poolID);
if ($history) {
- $count = $database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
+ $count = (int)$database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
$this->add_history($poolID, 1, (string)$imageID, $count);
}
return true;
@@ -1046,7 +1046,7 @@ class Pools extends Extension
$this->update_count($poolID);
if ($history) {
- $count = $database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
+ $count = (int)$database->get_one("SELECT COUNT(*) FROM pool_images WHERE pool_id=:pid", ["pid" => $poolID]);
$this->add_history($poolID, 0, (string)$imageID, $count);
}
}
diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php
deleted file mode 100644
index a7cb7d0d..00000000
--- a/themes/danbooru/layout.class.php
+++ /dev/null
@@ -1,189 +0,0 @@
-
-* Link: https://code.shishnet.org/shimmie2/
-* License: GPLv2
-* Description: This is a simple theme changing the css to make shimme
-* look more like danbooru as well as adding a custom links
-* bar and title to the top of every page.
-*/
-//Small changes added by zshall
-//Changed CSS and layout to make shimmie look even more like danbooru
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-Danbooru Theme - Notes (Bzchan)
-
-Files: default.php, style.css
-
-How to use a theme
-- Copy the danbooru folder with all its contained files into the "themes"
- directory in your shimmie installation.
-- Log into your shimmie and change the Theme in the Board Config to your
- desired theme.
-
-Changes in this theme include
-- Adding and editing various elements in the style.css file.
-- $site_name and $front_name retreival from config added.
-- $custom_link and $title_link preparation just before html is outputed.
-- Altered outputed html to include the custom links and removed heading
- from being displayed (subheading is still displayed)
-- Note that only the sidebar has been left aligned. Could not properly
- left align the main block because blocks without headers currently do
- not have ids on there div elements. (this was a problem because
- paginator block must be centered and everything else left aligned)
-
-Tips
-- You can change custom links to point to whatever pages you want as well as adding
- more custom links.
-- The main title link points to the Front Page set in your Board Config options.
-- The text of the main title is the Title set in your Board Config options.
-- Themes make no changes to your database or main code files so you can switch
- back and forward to other themes all you like.
-
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-class Layout
-{
- public function display_page(Page $page, array $nav_links, array $sub_links)
- {
- global $config;
-
- $theme_name = $config->get_string(SetupConfig::THEME);
- //$base_href = $config->get_string('base_href');
- $data_href = get_base_href();
- $contact_link = contact_link();
- $header_html = $page->get_all_html_headers();
-
- $left_block_html = "";
- $user_block_html = "";
- $main_block_html = "";
- $sub_block_html = "";
-
- foreach ($page->blocks as $block) {
- switch ($block->section) {
- case "left":
- $left_block_html .= $block->get_html(true);
- break;
- case "user":
- $user_block_html .= $block->body; // $this->block_to_html($block, true);
- break;
- case "subheading":
- $sub_block_html .= $block->body; // $this->block_to_html($block, true);
- break;
- case "main":
- if ($block->header == "Images") {
- $block->header = " ";
- }
- $main_block_html .= $block->get_html(false);
- break;
- default:
- print "
";
- }
-
- $site_name = $config->get_string(SetupConfig::TITLE); // bzchan: change from normal default to get title for top of page
- $main_page = $config->get_string(SetupConfig::MAIN_PAGE); // bzchan: change from normal default to get main page for top of page
-
- $custom_links = "";
- foreach ($nav_links as $nav_link) {
- $custom_links .= "
-
- $subheading
- $sub_block_html
- $left
-
- $flash_html
- $main_block_html
-
-
-
-
-EOD;
- }
-
- /**
- * #param string[] $pages_matched
- */
-
- public function navlinks(Link $link, string $desc, bool $active): ?string
- {
- $html = null;
- if ($active) {
- $html = "{$desc}";
- } else {
- $html = "{$desc}";
- }
-
- return $html;
- }
-}
diff --git a/themes/danbooru/page.class.php b/themes/danbooru/page.class.php
index bf0fea42..17d62c8f 100644
--- a/themes/danbooru/page.class.php
+++ b/themes/danbooru/page.class.php
@@ -1,5 +1,46 @@
+ * Link: https://code.shishnet.org/shimmie2/
+ * License: GPLv2
+ * Description: This is a simple theme changing the css to make shimme
+ * look more like danbooru as well as adding a custom links
+ * bar and title to the top of every page.
+ */
+//Small changes added by zshall
+//Changed CSS and layout to make shimmie look even more like danbooru
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+Danbooru Theme - Notes (Bzchan)
+Files: default.php, style.css
+
+How to use a theme
+- Copy the danbooru folder with all its contained files into the "themes"
+ directory in your shimmie installation.
+- Log into your shimmie and change the Theme in the Board Config to your
+ desired theme.
+
+Changes in this theme include
+- Adding and editing various elements in the style.css file.
+- $site_name and $front_name retreival from config added.
+- $custom_link and $title_link preparation just before html is outputed.
+- Altered outputed html to include the custom links and removed heading
+ from being displayed (subheading is still displayed)
+- Note that only the sidebar has been left aligned. Could not properly
+ left align the main block because blocks without headers currently do
+ not have ids on there div elements. (this was a problem because
+ paginator block must be centered and everything else left aligned)
+
+Tips
+- You can change custom links to point to whatever pages you want as well as adding
+ more custom links.
+- The main title link points to the Front Page set in your Board Config options.
+- The text of the main title is the Title set in your Board Config options.
+- Themes make no changes to your database or main code files so you can switch
+ back and forward to other themes all you like.
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
class Page extends BasePage
{
/** @var bool */
@@ -9,4 +50,117 @@ class Page extends BasePage
{
$this->left_enabled = false;
}
+
+ public function render(array $nav_links, array $sub_links)
+ {
+ global $config;
+
+ $left_block_html = "";
+ $user_block_html = "";
+ $main_block_html = "";
+ $sub_block_html = "";
+
+ foreach ($this->blocks as $block) {
+ switch ($block->section) {
+ case "left":
+ $left_block_html .= $block->get_html(true);
+ break;
+ case "user":
+ $user_block_html .= $block->body; // $this->block_to_html($block, true);
+ break;
+ case "subheading":
+ $sub_block_html .= $block->body; // $this->block_to_html($block, true);
+ break;
+ case "main":
+ if ($block->header == "Images") {
+ $block->header = " ";
+ }
+ $main_block_html .= $block->get_html(false);
+ break;
+ default:
+ print "
error: {$block->header} using an unknown section ({$block->section})";
+ break;
+ }
+ }
+
+ if (empty($this->subheading)) {
+ $subheading = "";
+ } else {
+ $subheading = "
{$this->subheading}
";
+ }
+
+ $site_name = $config->get_string(SetupConfig::TITLE); // bzchan: change from normal default to get title for top of page
+ $main_page = $config->get_string(SetupConfig::MAIN_PAGE); // bzchan: change from normal default to get main page for top of page
+
+ $custom_links = "";
+ foreach ($nav_links as $nav_link) {
+ $custom_links .= "
+
+ $subheading
+ $sub_block_html
+ $left
+
+ $flash_html
+ $main_block_html
+
+
+
+
+EOD;
+ }
+
+ public function navlinks(Link $link, string $desc, bool $active): ?string
+ {
+ $html = null;
+ if ($active) {
+ $html = "{$desc}";
+ } else {
+ $html = "{$desc}";
+ }
+
+ return $html;
+ }
}
diff --git a/themes/danbooru2/layout.class.php b/themes/danbooru2/layout.class.php
deleted file mode 100644
index a56a7f18..00000000
--- a/themes/danbooru2/layout.class.php
+++ /dev/null
@@ -1,185 +0,0 @@
-, updated by Daniel Oaks
-* Link: https://code.shishnet.org/shimmie2/
-* License: GPLv2
-* Description: This is a simple theme changing the css to make shimme
-* look more like danbooru as well as adding a custom links
-* bar and title to the top of every page.
-*/
-//Small changes added by zshall
-//Changed CSS and layout to make shimmie look even more like danbooru
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-Danbooru 2 Theme - Notes (Bzchan)
-
-Files: default.php, style.css
-
-How to use a theme
-- Copy the danbooru2 folder with all its contained files into the "themes"
- directory in your shimmie installation.
-- Log into your shimmie and change the Theme in the Board Config to your
- desired theme.
-
-Changes in this theme include
-- Adding and editing various elements in the style.css file.
-- $site_name and $front_name retreival from config added.
-- $custom_link and $title_link preparation just before html is outputed.
-- Altered outputed html to include the custom links and removed heading
- from being displayed (subheading is still displayed)
-- Note that only the sidebar has been left aligned. Could not properly
- left align the main block because blocks without headers currently do
- not have ids on there div elements. (this was a problem because
- paginator block must be centered and everything else left aligned)
-
-Tips
-- You can change custom links to point to whatever pages you want as well as adding
- more custom links.
-- The main title link points to the Front Page set in your Board Config options.
-- The text of the main title is the Title set in your Board Config options.
-- Themes make no changes to your database or main code files so you can switch
- back and forward to other themes all you like.
-
-* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-class Layout
-{
- public function display_page($page, array $nav_links, array $sub_links)
- {
- global $config;
-
- //$theme_name = $config->get_string(SetupConfig::THEME);
- //$base_href = $config->get_string('base_href');
- //$data_href = get_base_href();
- $contact_link = contact_link();
- $header_html = $page->get_all_html_headers();
-
- $left_block_html = "";
- $user_block_html = "";
- $main_block_html = "";
- $sub_block_html = "";
-
- foreach ($page->blocks as $block) {
- switch ($block->section) {
- case "left":
- $left_block_html .= $block->get_html(true);
- break;
- case "user":
- $user_block_html .= $block->body; // $this->block_to_html($block, true);
- break;
- case "subheading":
- $sub_block_html .= $block->body; // $this->block_to_html($block, true);
- break;
- case "main":
- if ($block->header == "Images") {
- $block->header = " ";
- }
- $main_block_html .= $block->get_html(false);
- break;
- default:
- print "
";
- }
-
- $site_name = $config->get_string(SetupConfig::TITLE); // bzchan: change from normal default to get title for top of page
- $main_page = $config->get_string(SetupConfig::MAIN_PAGE); // bzchan: change from normal default to get main page for top of page
-
- $custom_links = "";
- foreach ($nav_links as $nav_link) {
- $custom_links .= "
-
- $subheading
- $sub_block_html
- $left
-
- $flash_html
- $main_block_html
-
-
-
-
-EOD;
- }
-
- public function navlinks(Link $link, string $desc, bool $active): ?string
- {
- $html = null;
- if ($active) {
- $html = "{$desc}";
- } else {
- $html = "{$desc}";
- }
-
- return $html;
- }
-}
diff --git a/themes/danbooru2/page.class.php b/themes/danbooru2/page.class.php
index ad798d19..1926d839 100644
--- a/themes/danbooru2/page.class.php
+++ b/themes/danbooru2/page.class.php
@@ -1,4 +1,46 @@
, updated by Daniel Oaks
+ * Link: https://code.shishnet.org/shimmie2/
+ * License: GPLv2
+ * Description: This is a simple theme changing the css to make shimme
+ * look more like danbooru as well as adding a custom links
+ * bar and title to the top of every page.
+ */
+//Small changes added by zshall
+//Changed CSS and layout to make shimmie look even more like danbooru
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+Danbooru 2 Theme - Notes (Bzchan)
+
+Files: default.php, style.css
+
+How to use a theme
+- Copy the danbooru2 folder with all its contained files into the "themes"
+ directory in your shimmie installation.
+- Log into your shimmie and change the Theme in the Board Config to your
+ desired theme.
+
+Changes in this theme include
+- Adding and editing various elements in the style.css file.
+- $site_name and $front_name retreival from config added.
+- $custom_link and $title_link preparation just before html is outputed.
+- Altered outputed html to include the custom links and removed heading
+ from being displayed (subheading is still displayed)
+- Note that only the sidebar has been left aligned. Could not properly
+ left align the main block because blocks without headers currently do
+ not have ids on there div elements. (this was a problem because
+ paginator block must be centered and everything else left aligned)
+
+Tips
+- You can change custom links to point to whatever pages you want as well as adding
+ more custom links.
+- The main title link points to the Front Page set in your Board Config options.
+- The text of the main title is the Title set in your Board Config options.
+- Themes make no changes to your database or main code files so you can switch
+ back and forward to other themes all you like.
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
class Page extends BasePage
{
@@ -7,4 +49,117 @@ class Page extends BasePage
{
$this->left_enabled = false;
}
+
+ public function render(array $nav_links, array $sub_links)
+ {
+ global $config;
+
+ $left_block_html = "";
+ $user_block_html = "";
+ $main_block_html = "";
+ $sub_block_html = "";
+
+ foreach ($this->blocks as $block) {
+ switch ($block->section) {
+ case "left":
+ $left_block_html .= $block->get_html(true);
+ break;
+ case "user":
+ $user_block_html .= $block->body; // $this->block_to_html($block, true);
+ break;
+ case "subheading":
+ $sub_block_html .= $block->body; // $this->block_to_html($block, true);
+ break;
+ case "main":
+ if ($block->header == "Images") {
+ $block->header = " ";
+ }
+ $main_block_html .= $block->get_html(false);
+ break;
+ default:
+ print "
error: {$block->header} using an unknown section ({$block->section})";
+ break;
+ }
+ }
+
+ if (empty($this->subheading)) {
+ $subheading = "";
+ } else {
+ $subheading = "
{$this->subheading}
";
+ }
+
+ $site_name = $config->get_string(SetupConfig::TITLE); // bzchan: change from normal default to get title for top of page
+ $main_page = $config->get_string(SetupConfig::MAIN_PAGE); // bzchan: change from normal default to get main page for top of page
+
+ $custom_links = "";
+ foreach ($nav_links as $nav_link) {
+ $custom_links .= "