From f5ec3f861e76de6e6a54e0839c91df772d9c6677 Mon Sep 17 00:00:00 2001 From: shish Date: Mon, 16 Jul 2007 21:30:28 +0000 Subject: [PATCH] removal of data_href config variable -- it should be auto detected git-svn-id: file:///home/shish/svn/shimmie2/trunk@304 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/emoticons/main.php | 2 +- core/util.inc.php | 4 ++++ ext/load_ext_data/main.php | 2 +- ext/setup/main.php | 1 - themes/danbooru/layout.class.php | 2 +- themes/default/layout.class.php | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/contrib/emoticons/main.php b/contrib/emoticons/main.php index b7f666ec..d2f2359a 100644 --- a/contrib/emoticons/main.php +++ b/contrib/emoticons/main.php @@ -17,7 +17,7 @@ class Emoticons extends Extension { private function bbcode_to_html($text) { global $config; - $data_href = $config->get_string("data_href"); + $data_href = get_base_href(); $text = preg_replace("/:([a-z]*?):/s", "", $text); return $text; } diff --git a/core/util.inc.php b/core/util.inc.php index 93f9474d..ff10b4e9 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -205,6 +205,10 @@ function get_memory_limit() { return $memory; } +function get_base_href() { + return dirname($_SERVER['SCRIPT_NAME']); +} + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * Debugging functions * diff --git a/ext/load_ext_data/main.php b/ext/load_ext_data/main.php index 63ec5373..f443dd44 100644 --- a/ext/load_ext_data/main.php +++ b/ext/load_ext_data/main.php @@ -4,7 +4,7 @@ class LoadExtData extends Extension { if(is_a($event, 'PageRequestEvent')) { global $page, $config; - $data_href = $config->get_string("data_href", './'); + $data_href = get_base_href(); foreach(glob("ext/*/style.css") as $css_file) { $page->add_header(""); diff --git a/ext/setup/main.php b/ext/setup/main.php index 6db65253..13c2ba50 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -164,7 +164,6 @@ class Setup extends Extension { $sb->add_text_option("title", "Site title: "); $sb->add_text_option("front_page", "
Front page: "); $sb->add_text_option("base_href", "
Base URL: "); - $sb->add_text_option("data_href", "
Data URL: "); $sb->add_text_option("contact_link", "
Contact URL:"); $sb->add_choice_option("theme", $themes, "
Theme: "); // $sb->add_int_option("anon_id", "
Anonymous ID: "); // FIXME: create advanced options page diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php index 7ae05a60..3b9085bb 100644 --- a/themes/danbooru/layout.class.php +++ b/themes/danbooru/layout.class.php @@ -46,7 +46,7 @@ class Layout { global $config; $theme_name = $config->get_string('theme'); $base_href = $config->get_string('base_href'); - $data_href = $config->get_string('data_href'); + $data_href = get_base_href(); $contact_link = $config->get_string('contact_link'); $version = $config->get_string('version'); diff --git a/themes/default/layout.class.php b/themes/default/layout.class.php index 5ffc79d3..84744caa 100644 --- a/themes/default/layout.class.php +++ b/themes/default/layout.class.php @@ -4,7 +4,7 @@ class Layout { function display_page($page) { global $config; $theme_name = $config->get_string('theme', 'default'); - $data_href = $config->get_string('data_href', './'); + $data_href = get_base_href(); $contact_link = $config->get_string('contact_link'); $version = "Shimmie-".VERSION;