make danbooru aware of specific extensions

This commit is contained in:
Shish 2009-12-30 07:00:47 +00:00
parent d65adf1dab
commit c7408d3445
2 changed files with 18 additions and 4 deletions

View file

@ -102,9 +102,14 @@ class Layout {
$custom_links .= "<li><a href='".make_link('post/list')."'>Posts</a></li>";
$custom_links .= "<li><a href='".make_link('comment/list')."'>Comments</a></li>";
$custom_links .= "<li><a href='".make_link('tags')."'>Tags</a></li>";
if(class_exists("Pools")) {
$custom_links .= "<li><a href='".make_link('pool/list')."'>Pools</a></li>";
}
$custom_links .= "<li><a href='".make_link('upload')."'>Upload</a></li>";
$custom_links .= "<li><a href='".make_link('wiki')."'>Wiki</a></li>";
$custom_links .= "<li><a href='".make_link('wiki/more')."'>More &raquo;</a></li>";
if(class_exists("Wiki")) {
$custom_links .= "<li><a href='".make_link('wiki')."'>Wiki</a></li>";
$custom_links .= "<li><a href='".make_link('wiki/more')."'>More &raquo;</a></li>";
}
$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 .= "<li><a href='".make_link('post/list')."'>All</a></li>";
$custom_sublinks .= "<li><a href='".make_link("post/list/favorited_by=$username/1")."'>My Favorites</a></li>";
$custom_sublinks .= "<li><a href='".make_link("wiki/posts")."'>Help</a></li>";
if($hw) $custom_sublinks .= "<li><a href='".make_link("wiki/posts")."'>Help</a></li>";
break;
case "pool":
$custom_sublinks .= "<li><a href='".make_link('pool/list')."'>List</a></li>";
$custom_sublinks .= "<li><a href='".make_link("pool/new")."'>Create</a></li>";
$custom_sublinks .= "<li><a href='".make_link("pool/updated")."'>Changes</a></li>";
if($hw) $custom_sublinks .= "<li><a href='".make_link("wiki/pools")."'>Help</a></li>";
break;
case "wiki":
$custom_sublinks .= "<li><a href='".make_link('wiki')."'>Index</a></li>";
@ -135,7 +147,7 @@ class Layout {
$custom_sublinks .= "<li><a href='".make_link('tags/popularity')."'>Popularity</a></li>";
$custom_sublinks .= "<li><a href='".make_link('tags/categories')."'>Categories</a></li>";
$custom_sublinks .= "<li><a href='".make_link('alias/list')."'>Aliases</a></li>";
$custom_sublinks .= "<li><a href='".make_link("wiki/tags")."'>Help</a></li>";
if($hw) $custom_sublinks .= "<li><a href='".make_link("wiki/tags")."'>Help</a></li>";
break;
}

View file

@ -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 .= "<li><a href='{$part["link"]}'>{$part["name"]}</a>";
}
$page->add_block(new Block("User Links", $html, "user", 90));