get_string('title');
+ $title = $config->get_string(SetupConfig::TITLE);
if (count($event->search_terms) > 0) {
$search = html_escape(implode(' ', $event->search_terms));
@@ -47,7 +47,7 @@ class RSS_Images extends Extension
$data .= $this->thumb($image);
}
- $title = $config->get_string('title');
+ $title = $config->get_string(SetupConfig::TITLE);
$base_href = make_http(get_base_href());
$search = "";
if (count($search_terms) > 0) {
diff --git a/ext/setup/config.php b/ext/setup/config.php
new file mode 100644
index 00000000..2b5be64e
--- /dev/null
+++ b/ext/setup/config.php
@@ -0,0 +1,12 @@
+set_default_string("title", "Shimmie");
- $config->set_default_string("front_page", "post/list");
- $config->set_default_string("main_page", "post/list");
- $config->set_default_string("theme", "default");
- $config->set_default_bool("word_wrap", true);
- $config->set_default_bool("comment_captcha", false);
+ $config->set_default_string(SetupConfig::TITLE, "Shimmie");
+ $config->set_default_string(SetupConfig::FRONT_PAGE, "post/list");
+ $config->set_default_string(SetupConfig::MAIN_PAGE, "post/list");
+ $config->set_default_string(SetupConfig::THEME, "default");
+ $config->set_default_bool(SetupConfig::WORD_WRAP, true);
}
public function onPageRequest(PageRequestEvent $event)
@@ -368,11 +369,11 @@ class Setup extends Extension
";
$sb = new SetupBlock("General");
$sb->position = 0;
- $sb->add_text_option("title", "Site title: ");
- $sb->add_text_option("front_page", "
Front page: ");
- $sb->add_text_option("main_page", "
Main page: ");
+ $sb->add_text_option(SetupConfig::TITLE, "Site title: ");
+ $sb->add_text_option(SetupConfig::FRONT_PAGE, "
Front page: ");
+ $sb->add_text_option(SetupConfig::MAIN_PAGE, "
Main page: ");
$sb->add_text_option("contact_link", "
Contact URL: ");
- $sb->add_choice_option("theme", $themes, "
Theme: ");
+ $sb->add_choice_option(SetupConfig::THEME, $themes, "
Theme: ");
//$sb->add_multichoice_option("testarray", array("a" => "b", "c" => "d"), "
Test Array: ");
$sb->add_bool_option("nice_urls", "
Nice URLs: ");
$sb->add_label("(Javascript inactive, can't test!)$nicescript");
diff --git a/ext/sitemap/main.php b/ext/sitemap/main.php
index 4ff80f88..6bf8b4a3 100644
--- a/ext/sitemap/main.php
+++ b/ext/sitemap/main.php
@@ -74,7 +74,7 @@ class XMLSitemap extends Extension
// add index
$index = [];
- $index[0] = $config->get_string("front_page");
+ $index[0] = $config->get_string(SetupConfig::FRONT_PAGE);
$this->add_sitemap_queue($index, "weekly", "1");
/* --- Add 20 most used tags --- */
diff --git a/ext/upload/theme.php b/ext/upload/theme.php
index 6b3b503a..efa407c8 100644
--- a/ext/upload/theme.php
+++ b/ext/upload/theme.php
@@ -189,7 +189,7 @@ class UploadTheme extends Themelet
global $config;
$link = make_http(make_link("upload"));
$main_page = make_http(make_link());
- $title = $config->get_string('title');
+ $title = $config->get_string(SetupConfig::TITLE);
$max_size = $config->get_int('upload_size');
$max_kb = to_shorthand_int($max_size);
$delimiter = $config->get_bool('nice_urls') ? '?' : '&';
@@ -235,7 +235,7 @@ class UploadTheme extends Themelet
if (class_exists("VideoFileHandler")) {
$supported_ext .= " flv mp4 ogv webm m4v";
}
- $title = "Booru to " . $config->get_string('title');
+ $title = "Booru to " . $config->get_string(SetupConfig::TITLE);
// CA=0: Ask to use current or new tags | CA=1: Always use current tags | CA=2: Always use new tags
$html .= '{$this->subheading}";
}
- $site_name = $config->get_string('title'); // bzchan: change from normal default to get title for top of page
- $main_page = $config->get_string('main_page'); // bzchan: change from normal default to get main page for top of page
+ $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
- // bzchan: CUSTOM LINKS are prepared here, change these to whatever you like
$custom_links = "";
if ($user->is_anonymous()) {
$custom_links .= $this->navlinks(make_link('user_admin/login'), "My Account", ["user", "user_admin", "setup", "admin"]);
diff --git a/themes/danbooru2/index.theme.php b/themes/danbooru2/index.theme.php
index 51455d43..a62fdf8c 100644
--- a/themes/danbooru2/index.theme.php
+++ b/themes/danbooru2/index.theme.php
@@ -11,7 +11,7 @@ class CustomIndexTheme extends IndexTheme
if (count($this->search_terms) == 0) {
$query = null;
- $page_title = $config->get_string('title');
+ $page_title = $config->get_string(SetupConfig::TITLE);
} else {
$search_string = implode(' ', $this->search_terms);
$query = url_escape($search_string);
diff --git a/themes/danbooru2/layout.class.php b/themes/danbooru2/layout.class.php
index 6c4514f2..e3d0116a 100644
--- a/themes/danbooru2/layout.class.php
+++ b/themes/danbooru2/layout.class.php
@@ -48,7 +48,7 @@ class Layout
{
global $config, $user;
- //$theme_name = $config->get_string('theme');
+ //$theme_name = $config->get_string(SetupConfig::THEME);
//$base_href = $config->get_string('base_href');
//$data_href = get_base_href();
$contact_link = contact_link();
@@ -92,10 +92,9 @@ class Layout
$subheading = "{$this->subheading}
";
}
- $site_name = $config->get_string('title'); // bzchan: change from normal default to get title for top of page
- $main_page = $config->get_string('main_page'); // bzchan: change from normal default to get main page for top of page
+ $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
- // bzchan: CUSTOM LINKS are prepared here, change these to whatever you like
$custom_links = "";
if ($user->is_anonymous()) {
$custom_links .= $this->navlinks(make_link('user_admin/login'), "Sign in", ["user", "user_admin", "setup", "admin"]);
diff --git a/themes/default/layout.class.php b/themes/default/layout.class.php
index e67309bb..973c0bb0 100644
--- a/themes/default/layout.class.php
+++ b/themes/default/layout.class.php
@@ -11,7 +11,7 @@ class Layout
{
global $config;
- //$theme_name = $config->get_string('theme', 'default');
+ //$theme_name = $config->get_string(SetupConfig::THEME, 'default');
//$data_href = get_base_href();
$contact_link = contact_link();
$header_html = $page->get_all_html_headers();
diff --git a/themes/futaba/comment.theme.php b/themes/futaba/comment.theme.php
index 7647c322..5ae42be1 100644
--- a/themes/futaba/comment.theme.php
+++ b/themes/futaba/comment.theme.php
@@ -11,7 +11,7 @@ class CustomCommentListTheme extends CommentListTheme
//$prev = $page_number - 1;
//$next = $page_number + 1;
- $page_title = $config->get_string('title');
+ $page_title = $config->get_string(SetupConfig::TITLE);
$page->set_title($page_title);
$page->set_heading($page_title);
$page->disable_left();
diff --git a/themes/futaba/layout.class.php b/themes/futaba/layout.class.php
index faccb090..98076afb 100644
--- a/themes/futaba/layout.class.php
+++ b/themes/futaba/layout.class.php
@@ -6,7 +6,7 @@ class Layout
{
global $config;
- $theme_name = $config->get_string('theme', 'default');
+ $theme_name = $config->get_string(SetupConfig::THEME, 'default');
$data_href = get_base_href();
$contact_link = contact_link();
$header_html = $page->get_all_html_headers();
diff --git a/themes/lite/layout.class.php b/themes/lite/layout.class.php
index 747b0086..3c1e1b2f 100644
--- a/themes/lite/layout.class.php
+++ b/themes/lite/layout.class.php
@@ -13,8 +13,8 @@ class Layout
{
global $config, $user;
- $theme_name = $config->get_string('theme', 'lite');
- $site_name = $config->get_string('title');
+ $theme_name = $config->get_string(SetupConfig::THEME, 'lite');
+ $site_name = $config->get_string(SetupConfig::TITLE);
$data_href = get_base_href();
$contact_link = contact_link();
$header_html = $page->get_all_html_headers();
diff --git a/themes/material/layout.class.php b/themes/material/layout.class.php
index 4c923456..ada06030 100644
--- a/themes/material/layout.class.php
+++ b/themes/material/layout.class.php
@@ -11,10 +11,10 @@ class Layout
{
global $config;
- $theme_name = $config->get_string('theme', 'material');
- $site_name = $config->get_string('title');
+ $theme_name = $config->get_string(SetupConfig::THEME, 'material');
+ $site_name = $config->get_string(SetupConfig::TITLE);
$data_href = get_base_href();
- $main_page = $config->get_string('main_page');
+ $main_page = $config->get_string(SetupConfig::MAIN_PAGE);
$contact_link = contact_link();
$site_link = make_link();
$header_html = $page->get_all_html_headers();
diff --git a/themes/warm/layout.class.php b/themes/warm/layout.class.php
index 20259570..1d3017fb 100644
--- a/themes/warm/layout.class.php
+++ b/themes/warm/layout.class.php
@@ -11,10 +11,10 @@ class Layout
{
global $config;
- //$theme_name = $config->get_string('theme', 'default');
- $site_name = $config->get_string('title');
+ //$theme_name = $config->get_string(SetupConfig::THEME, 'default');
+ $site_name = $config->get_string(SetupConfig::TITLE);
$data_href = get_base_href();
- $main_page = $config->get_string('main_page');
+ $main_page = $config->get_string(SetupConfig::MAIN_PAGE);
$contact_link = contact_link();
$header_html = $page->get_all_html_headers();