From 2e8e839f5c851d34b3e6481a206d367fe17a109b Mon Sep 17 00:00:00 2001 From: shish Date: Thu, 26 Jul 2007 13:19:39 +0000 Subject: [PATCH] make_link with no args links to default page git-svn-id: file:///home/shish/svn/shimmie2/trunk@373 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/home/main.php | 4 ++-- contrib/tag_history/main.php | 2 +- core/navblock.class.php | 2 +- core/util.inc.php | 5 ++++- ext/admin/main.php | 2 +- ext/comment/theme.php | 2 +- ext/index/theme.php | 4 ++-- ext/setup/theme.php | 2 +- ext/tag_list/main.php | 2 +- ext/user/main.php | 2 +- ext/user/theme.php | 2 +- ext/view/theme.php | 2 +- themes/danbooru/comment.theme.php | 2 +- themes/danbooru/index.theme.php | 2 +- themes/danbooru/upload.theme.php | 2 +- themes/danbooru/view.theme.php | 4 ++-- 16 files changed, 22 insertions(+), 19 deletions(-) diff --git a/contrib/home/main.php b/contrib/home/main.php index 5e5457a4..eec55f9a 100644 --- a/contrib/home/main.php +++ b/contrib/home/main.php @@ -68,13 +68,13 @@ class Home extends Extension { return "

- $sitename + $sitename

-
+
diff --git a/contrib/tag_history/main.php b/contrib/tag_history/main.php index 2118e6b3..f7b38aaf 100644 --- a/contrib/tag_history/main.php +++ b/contrib/tag_history/main.php @@ -73,7 +73,7 @@ class Tag_History extends Extension { // tried to set it too the same thing so ignore it (might be a bot) // go back to the index page with you $page->set_mode("redirect"); - $page->set_redirect(make_link("index")); + $page->set_redirect(make_link()); return; } diff --git a/core/navblock.class.php b/core/navblock.class.php index bc5dca64..e56cdae3 100644 --- a/core/navblock.class.php +++ b/core/navblock.class.php @@ -2,7 +2,7 @@ class NavBlock extends Block { public function NavBlock() { $this->header = "Navigation"; - $this->body = "Index"; + $this->body = "Index"; $this->section = "left"; $this->position = 0; } diff --git a/core/util.inc.php b/core/util.inc.php index 2abecb72..a3b552c4 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -92,8 +92,11 @@ function tag_explode($tags) { * HTML Generation * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -function make_link($page, $query=null) { +function make_link($page=null, $query=null) { global $config; + + if(is_null($page)) $page = $config->get_string('front_page', 'post/list'); + $base = $config->get_string('base_href', './index.php?q='); if(is_null($query)) { diff --git a/ext/admin/main.php b/ext/admin/main.php index e86d0838..354f8092 100644 --- a/ext/admin/main.php +++ b/ext/admin/main.php @@ -32,7 +32,7 @@ class AdminPage extends Extension { if($image) { send_event(new ImageDeletionEvent($image)); $event->page->set_mode("redirect"); - $event->page->set_redirect(make_link("index")); + $event->page->set_redirect(make_link()); } } } diff --git a/ext/comment/theme.php b/ext/comment/theme.php index ea6ba677..e4b74d7c 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -7,7 +7,7 @@ class CommentListTheme extends Themelet { $h_prev = ($page_number <= 1) ? "Prev" : "Prev"; - $h_index = "Index"; + $h_index = "Index"; $h_next = ($page_number >= $total_pages) ? "Next" : "Next"; diff --git a/ext/index/theme.php b/ext/index/theme.php index d52af42c..a971109f 100644 --- a/ext/index/theme.php +++ b/ext/index/theme.php @@ -54,11 +54,11 @@ class IndexTheme extends Themelet { $h_prev = ($page_number <= 1) ? "Prev" : "Prev"; - $h_index = "Index"; + $h_index = "Index"; $h_next = ($page_number >= $total_pages) ? "Next" : "Next"; $h_search_string = count($search_terms) == 0 ? "Search" : html_escape(implode(" ", $search_terms)); - $h_search_link = make_link("index"); + $h_search_link = make_link(); $h_search = "

Index + Index
Help "; } diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 2978b56f..60e82026 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -76,7 +76,7 @@ class TagList extends Extension { // }}} // maps {{{ private function build_navigation() { - $h_index = "Index"; + $h_index = "Index"; $h_map = "Map"; $h_alphabetic = "Alphabetic"; $h_popularity = "Popularity"; diff --git a/ext/user/main.php b/ext/user/main.php index 075107f7..32b196b5 100644 --- a/ext/user/main.php +++ b/ext/user/main.php @@ -54,7 +54,7 @@ class UserPage extends Extension { else if($event->get_arg(0) == "logout") { setcookie("shm_session", "", time()+60*60*24*$config->get_int('login_memory'), "/"); $page->set_mode("redirect"); - $page->set_redirect(make_link("index")); + $page->set_redirect(make_link()); } else if($event->get_arg(0) == "changepass") { $this->change_password_wrapper($event->page); diff --git a/ext/user/theme.php b/ext/user/theme.php index 84be2c1a..779a557b 100644 --- a/ext/user/theme.php +++ b/ext/user/theme.php @@ -105,7 +105,7 @@ class UserPageTheme extends Themelet { $h_comment_rate = sprintf("%3.1f", ($i_comment_count / $i_days_old2)); $u_name = url_escape($duser->name); - $images_link = make_link("index", "search=poster%3D$u_name"); + $images_link = make_link(, "search=poster%3D$u_name"); return " Join date: $h_join_date ($i_days_old days old) diff --git a/ext/view/theme.php b/ext/view/theme.php index cd0712a8..28dde43b 100644 --- a/ext/view/theme.php +++ b/ext/view/theme.php @@ -51,7 +51,7 @@ class ViewTheme extends Themelet { private function build_navigation($image_id) { $h_pin = $this->build_pin($image_id); $h_search = " -

+

diff --git a/themes/danbooru/comment.theme.php b/themes/danbooru/comment.theme.php index 905be603..74ba0ba5 100644 --- a/themes/danbooru/comment.theme.php +++ b/themes/danbooru/comment.theme.php @@ -7,7 +7,7 @@ class CommentListTheme extends Themelet { $h_prev = ($page_number <= 1) ? "Prev" : "Prev"; - $h_index = "Index"; + $h_index = "Index"; $h_next = ($page_number >= $total_pages) ? "Next" : "Next"; diff --git a/themes/danbooru/index.theme.php b/themes/danbooru/index.theme.php index d5b5309c..a52750cf 100644 --- a/themes/danbooru/index.theme.php +++ b/themes/danbooru/index.theme.php @@ -36,7 +36,7 @@ class IndexTheme extends Themelet { private function build_navigation($page_number, $total_pages, $search_terms) { $h_search_string = count($search_terms) == 0 ? "" : html_escape(implode(" ", $search_terms)); - $h_search_link = make_link("index"); + $h_search_link = make_link(); $h_search = "

set_mode("redirect"); - $page->set_redirect(make_link("index")); + $page->set_redirect(make_link()); } else { $page->set_title("Upload Status"); diff --git a/themes/danbooru/view.theme.php b/themes/danbooru/view.theme.php index 4638b30d..41329a56 100644 --- a/themes/danbooru/view.theme.php +++ b/themes/danbooru/view.theme.php @@ -41,7 +41,7 @@ class ViewTheme extends Themelet { $prev = $database->get_prev_image($image_id, $search_terms); $h_prev = (!is_null($prev) ? "Prev" : "Prev"); - $h_index = "Index"; + $h_index = "Index"; $h_next = (!is_null($next) ? "Next" : "Next"); $this->pin = "$h_prev | $h_index | $h_next"; @@ -51,7 +51,7 @@ class ViewTheme extends Themelet { private function build_navigation($image_id) { $h_pin = $this->build_pin($image_id); $h_search = " -

+