From 629f9940c3f5a3417358cc28a80331158d40c286 Mon Sep 17 00:00:00 2001 From: Daku Date: Mon, 3 Feb 2014 13:59:53 +0000 Subject: [PATCH] thumbnail border-color for post relationships also removed build_thumb_html from themes (mostly old versions of the default base function) --- core/basethemelet.class.php | 9 +++++++-- ext/relatationships/style.css | 15 +++++++++++++++ themes/danbooru/themelet.class.php | 21 -------------------- themes/danbooru2/themelet.class.php | 21 -------------------- themes/futaba/themelet.class.php | 25 ------------------------ themes/lite/themelet.class.php | 30 ----------------------------- 6 files changed, 22 insertions(+), 99 deletions(-) create mode 100644 ext/relatationships/style.css diff --git a/core/basethemelet.class.php b/core/basethemelet.class.php index 83632d08..27b5d818 100644 --- a/core/basethemelet.class.php +++ b/core/basethemelet.class.php @@ -44,7 +44,6 @@ class BaseThemelet { $h_thumb_link = $image->get_thumb_link(); $h_tip = html_escape($image->get_tooltip()); $h_tags = strtolower($image->get_tag_list()); - $base = get_base_href(); $ext = strtolower($image->ext); // If the file doesn't support thumbnail generation, show it at max size. @@ -55,7 +54,13 @@ class BaseThemelet { $tsize = get_thumbnail_size($image->width, $image->height); } - return "". + $custom_classes = ""; + if(class_exists("Relationships")){ + if($image->parent_id !== NULL){ $custom_classes .= "shm-thumb-has_parent "; } + if($image->has_children == TRUE){ $custom_classes .= "shm-thumb-has_child "; } + } + + return "". "$h_tip". "\n"; } diff --git a/ext/relatationships/style.css b/ext/relatationships/style.css new file mode 100644 index 00000000..cb7e5633 --- /dev/null +++ b/ext/relatationships/style.css @@ -0,0 +1,15 @@ +.thumb IMG { + border-width: 2px !important; +} + +.shm-thumb-has_child img { + border-color: lime !important; +} + +.shm-thumb-has_parent img { + border-color: #cc0 !important; +} + +.shm-thumb-has_child.shm-thumb-has_parent img { + border-color: lime #cc0 #cc0 lime !important; +} diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index db9b4116..3fbbb24f 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -1,26 +1,5 @@ id}"); - $h_thumb_link = $image->get_thumb_link(); - $h_tip = html_escape($image->get_tooltip()); - $i_id = int_escape($image->id); - $h_tags = strtolower($image->get_tag_list()); - - // If file is flash or svg then sets thumbnail to max size. - if($image->ext == 'swf' || $image->ext == 'svg') { - $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); - } - else{ - $tsize = get_thumbnail_size($image->width, $image->height); - } - - return "$h_tip"; - } - - public function display_paginator(Page $page, $base, $query, $page_number, $total_pages) { if($total_pages == 0) $total_pages = 1; $body = $this->build_paginator($page_number, $total_pages, $base, $query); diff --git a/themes/danbooru2/themelet.class.php b/themes/danbooru2/themelet.class.php index db9b4116..3fbbb24f 100644 --- a/themes/danbooru2/themelet.class.php +++ b/themes/danbooru2/themelet.class.php @@ -1,26 +1,5 @@ id}"); - $h_thumb_link = $image->get_thumb_link(); - $h_tip = html_escape($image->get_tooltip()); - $i_id = int_escape($image->id); - $h_tags = strtolower($image->get_tag_list()); - - // If file is flash or svg then sets thumbnail to max size. - if($image->ext == 'swf' || $image->ext == 'svg') { - $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); - } - else{ - $tsize = get_thumbnail_size($image->width, $image->height); - } - - return "$h_tip"; - } - - public function display_paginator(Page $page, $base, $query, $page_number, $total_pages) { if($total_pages == 0) $total_pages = 1; $body = $this->build_paginator($page_number, $total_pages, $base, $query); diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index 5fc79d3c..3db6c45e 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -1,30 +1,5 @@ id}"); - $h_thumb_link = $image->get_thumb_link(); - $h_tip = html_escape($image->get_tooltip()); - $i_id = int_escape($image->id); - $h_tags = strtolower($image->get_tag_list()); - - // If file is flash or svg then sets thumbnail to max size. - if($image->ext == 'swf' || $image->ext == 'svg') { - $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); - } - else { - $tsize = get_thumbnail_size($image->width, $image->height); - } - - return "$h_tip"; - } - - /** * Add a generic paginator */ diff --git a/themes/lite/themelet.class.php b/themes/lite/themelet.class.php index 8788d9a2..3eadf464 100644 --- a/themes/lite/themelet.class.php +++ b/themes/lite/themelet.class.php @@ -1,34 +1,5 @@ id; - $h_view_link = make_link('post/view/'.$i_id); - $h_thumb_link = $image->get_thumb_link(); - $h_tip = html_escape($image->get_tooltip()); - $h_tags = strtolower($image->get_tag_list()); - $base = get_base_href(); - - // If file is flash or svg then sets thumbnail to max size. - if($image->ext === 'swf' || $image->ext === 'svg'){ - $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); - } - else{ - $tsize = get_thumbnail_size($image->width, $image->height); - } - - return '
\n"; - } - - /** * Put something in a rounded rectangle box; specific to the default theme */ @@ -40,7 +11,6 @@ class Themelet extends BaseThemelet { "; } - /** * Add a generic paginator */