From c7408d34459af8e0c02f02bc3887e57fa5ac2133 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 30 Dec 2009 07:00:47 +0000 Subject: [PATCH] make danbooru aware of specific extensions --- themes/danbooru/layout.class.php | 20 ++++++++++++++++---- themes/danbooru/user.theme.php | 2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php index 41801a9c..ca26e920 100644 --- a/themes/danbooru/layout.class.php +++ b/themes/danbooru/layout.class.php @@ -102,9 +102,14 @@ class Layout { $custom_links .= "
  • Posts
  • "; $custom_links .= "
  • Comments
  • "; $custom_links .= "
  • Tags
  • "; + if(class_exists("Pools")) { + $custom_links .= "
  • Pools
  • "; + } $custom_links .= "
  • Upload
  • "; - $custom_links .= "
  • Wiki
  • "; - $custom_links .= "
  • More »
  • "; + if(class_exists("Wiki")) { + $custom_links .= "
  • Wiki
  • "; + $custom_links .= "
  • More »
  • "; + } $custom_sublinks = ""; // hack @@ -112,6 +117,7 @@ class Layout { $username = url_escape($user->name); // hack $qp = _get_query_parts(); + $hw = class_exists("Wiki"); // php sucks switch($qp[0]) { default: @@ -122,7 +128,13 @@ class Layout { case "upload": $custom_sublinks .= "
  • All
  • "; $custom_sublinks .= "
  • My Favorites
  • "; - $custom_sublinks .= "
  • Help
  • "; + if($hw) $custom_sublinks .= "
  • Help
  • "; + break; + case "pool": + $custom_sublinks .= "
  • List
  • "; + $custom_sublinks .= "
  • Create
  • "; + $custom_sublinks .= "
  • Changes
  • "; + if($hw) $custom_sublinks .= "
  • Help
  • "; break; case "wiki": $custom_sublinks .= "
  • Index
  • "; @@ -135,7 +147,7 @@ class Layout { $custom_sublinks .= "
  • Popularity
  • "; $custom_sublinks .= "
  • Categories
  • "; $custom_sublinks .= "
  • Aliases
  • "; - $custom_sublinks .= "
  • Help
  • "; + if($hw) $custom_sublinks .= "
  • Help
  • "; break; } diff --git a/themes/danbooru/user.theme.php b/themes/danbooru/user.theme.php index 64cf489e..0f149704 100644 --- a/themes/danbooru/user.theme.php +++ b/themes/danbooru/user.theme.php @@ -16,7 +16,9 @@ class CustomUserPageTheme extends UserPageTheme { public function display_user_block($page, $user, $parts) { $h_name = html_escape($user->name); $html = ""; + $blocked = array("Pools", "Pool Changes", "Alias Editor", "My Profile"); foreach($parts as $part) { + if(in_array($part["name"], $blocked)) continue; $html .= "
  • {$part["name"]}"; } $page->add_block(new Block("User Links", $html, "user", 90));