From a38327b6d3784b1ee3be41ae1606a4b1e42c4c91 Mon Sep 17 00:00:00 2001 From: Daku Date: Fri, 16 Dec 2011 16:34:23 +0000 Subject: [PATCH 1/9] Made flash thumbnails have a default 192x192 resolution. --- themes/danbooru/themelet.class.php | 5 ++++- themes/default/themelet.class.php | 5 ++++- themes/flat/themelet.class.php | 5 ++++- themes/futaba/themelet.class.php | 5 ++++- themes/lite/themelet.class.php | 5 ++++- themes/old_default/themelet.class.php | 5 ++++- themes/warm/themelet.class.php | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index 2fa978a5..7cd8631c 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -20,7 +20,10 @@ class Themelet { $h_view_link = make_link("post/view/{$image->id}", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); + if($image->ext == 'swf'){ + $tsize = get_thumbnail_size(192, 192); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } return "$h_tip"; } diff --git a/themes/default/themelet.class.php b/themes/default/themelet.class.php index 159f8881..4fd5e56d 100644 --- a/themes/default/themelet.class.php +++ b/themes/default/themelet.class.php @@ -33,7 +33,10 @@ class Themelet { $h_view_link = make_link("post/view/$i_id", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); + if($image->ext == 'swf'){ + $tsize = get_thumbnail_size(192, 192); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } return "
diff --git a/themes/flat/themelet.class.php b/themes/flat/themelet.class.php index b79ccc73..5376e6fc 100644 --- a/themes/flat/themelet.class.php +++ b/themes/flat/themelet.class.php @@ -33,7 +33,10 @@ class Themelet { $h_view_link = make_link("post/view/$i_id", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); + if($image->ext == 'swf'){ + $tsize = get_thumbnail_size(192, 192); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } return "
diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index 706f3f1b..c5a902cf 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -21,7 +21,10 @@ class Themelet { $h_view_link = make_link("post/view/{$image->id}", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); + if($image->ext == 'swf'){ + $tsize = get_thumbnail_size(192, 192); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } return "$h_tip"; } diff --git a/themes/lite/themelet.class.php b/themes/lite/themelet.class.php index 8d57b147..2714233f 100644 --- a/themes/lite/themelet.class.php +++ b/themes/lite/themelet.class.php @@ -33,7 +33,10 @@ class Themelet { $h_view_link = make_link("post/view/$i_id", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); + if($image->ext == 'swf'){ + $tsize = get_thumbnail_size(192, 192); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } return "
diff --git a/themes/old_default/themelet.class.php b/themes/old_default/themelet.class.php index 41c5cf5e..5b25a843 100644 --- a/themes/old_default/themelet.class.php +++ b/themes/old_default/themelet.class.php @@ -31,7 +31,10 @@ class Themelet { $h_view_link = make_link("post/view/$i_id", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); + if($image->ext == 'swf'){ + $tsize = get_thumbnail_size(192, 192); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } return "$h_tip"; } diff --git a/themes/warm/themelet.class.php b/themes/warm/themelet.class.php index 89f4dcf8..7f90ba8a 100644 --- a/themes/warm/themelet.class.php +++ b/themes/warm/themelet.class.php @@ -34,7 +34,10 @@ class Themelet { $h_tip = html_escape($image->get_tooltip()); $h_image_link = $image->get_image_link(); $h_thumb_link = $image->get_thumb_link(); - $tsize = get_thumbnail_size($image->width, $image->height); + if($image->ext == 'swf'){ + $tsize = get_thumbnail_size(192, 192); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } return "
From 56931b0eaa80dc07d097b1b9629a3b4b68918942 Mon Sep 17 00:00:00 2001 From: Daku Date: Fri, 16 Dec 2011 18:36:08 +0000 Subject: [PATCH 2/9] Changed the 192x192 default to use the max thumbnail size. Made this work with SVG aswell. --- themes/danbooru/themelet.class.php | 4 ++-- themes/default/themelet.class.php | 4 ++-- themes/flat/themelet.class.php | 4 ++-- themes/futaba/themelet.class.php | 4 ++-- themes/lite/themelet.class.php | 4 ++-- themes/old_default/themelet.class.php | 4 ++-- themes/warm/themelet.class.php | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index 7cd8631c..a848352b 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -20,8 +20,8 @@ class Themelet { $h_view_link = make_link("post/view/{$image->id}", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf'){ - $tsize = get_thumbnail_size(192, 192); } + if($image->ext == 'swf' || 'svg'){ + $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } return "$h_tipget_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf'){ - $tsize = get_thumbnail_size(192, 192); } + if($image->ext == 'swf' || 'svg'){ + $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } return " diff --git a/themes/flat/themelet.class.php b/themes/flat/themelet.class.php index 5376e6fc..1724f329 100644 --- a/themes/flat/themelet.class.php +++ b/themes/flat/themelet.class.php @@ -33,8 +33,8 @@ class Themelet { $h_view_link = make_link("post/view/$i_id", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf'){ - $tsize = get_thumbnail_size(192, 192); } + if($image->ext == 'swf' || 'svg'){ + $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } return " diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index c5a902cf..5985f2e2 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -21,8 +21,8 @@ class Themelet { $h_view_link = make_link("post/view/{$image->id}", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf'){ - $tsize = get_thumbnail_size(192, 192); } + if($image->ext == 'swf' || 'svg'){ + $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } return "$h_tipget_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf'){ - $tsize = get_thumbnail_size(192, 192); } + if($image->ext == 'swf' || 'svg'){ + $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } return " diff --git a/themes/old_default/themelet.class.php b/themes/old_default/themelet.class.php index 5b25a843..e7ed8967 100644 --- a/themes/old_default/themelet.class.php +++ b/themes/old_default/themelet.class.php @@ -31,8 +31,8 @@ class Themelet { $h_view_link = make_link("post/view/$i_id", $query); $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf'){ - $tsize = get_thumbnail_size(192, 192); } + if($image->ext == 'swf' || 'svg'){ + $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } return "$h_tipget_tooltip()); $h_image_link = $image->get_image_link(); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf'){ - $tsize = get_thumbnail_size(192, 192); } + if($image->ext == 'swf' || 'svg'){ + $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } return " From c7852423d42b2536511f03aed1cd437df47e99e7 Mon Sep 17 00:00:00 2001 From: Daku Date: Fri, 16 Dec 2011 21:29:46 +0000 Subject: [PATCH 3/9] Added a feature which removes the size tag from mp3 tooltips. --- themes/danbooru/themelet.class.php | 25 +++++++++++++++++++++++-- themes/default/themelet.class.php | 25 +++++++++++++++++++++++-- themes/flat/themelet.class.php | 25 +++++++++++++++++++++++-- themes/futaba/themelet.class.php | 25 +++++++++++++++++++++++-- themes/lite/themelet.class.php | 25 +++++++++++++++++++++++-- themes/old_default/themelet.class.php | 25 +++++++++++++++++++++++-- themes/warm/themelet.class.php | 25 +++++++++++++++++++++++-- 7 files changed, 161 insertions(+), 14 deletions(-) diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index a848352b..9b634942 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -18,12 +18,33 @@ class Themelet { public function build_thumb_html(Image $image, $query=null) { global $config; $h_view_link = make_link("post/view/{$image->id}", $query); - $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf' || 'svg'){ + + + // Removes the size tag if the file is an mp3 + if($image->ext == 'mp3'){ + $iitip = $image->get_tooltip(); + $mp3tip = array("0x0"); + $h_tip = str_replace($mp3tip, " ", $iitip); + + // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size) + $justincase = array(" //", "// ", " //", "// ", " "); + if(strstr($h_tip, " ")){ + $h_tip = html_escape(str_replace($justincase, "", $h_tip)); + }else{ + $h_tip = html_escape($h_tip); + } + }else{ + $h_tip = html_escape($image->get_tooltip()); + } + + + // If file is flash or svg then sets thumbnail to max size. + if($image->ext == 'swf' || $image->ext == 'svg'){ $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } + return "$h_tip"; } diff --git a/themes/default/themelet.class.php b/themes/default/themelet.class.php index d45610b2..e0ee012e 100644 --- a/themes/default/themelet.class.php +++ b/themes/default/themelet.class.php @@ -31,12 +31,33 @@ class Themelet { global $config; $i_id = int_escape($image->id); $h_view_link = make_link("post/view/$i_id", $query); - $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf' || 'svg'){ + + + // Removes the size tag if the file is an mp3 + if($image->ext == 'mp3'){ + $iitip = $image->get_tooltip(); + $mp3tip = array("0x0"); + $h_tip = str_replace($mp3tip, " ", $iitip); + + // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size) + $justincase = array(" //", "// ", " //", "// ", " "); + if(strstr($h_tip, " ")){ + $h_tip = html_escape(str_replace($justincase, "", $h_tip)); + }else{ + $h_tip = html_escape($h_tip); + } + }else{ + $h_tip = html_escape($image->get_tooltip()); + } + + + // If file is flash or svg then sets thumbnail to max size. + if($image->ext == 'swf' || $image->ext == 'svg'){ $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } + return "
diff --git a/themes/flat/themelet.class.php b/themes/flat/themelet.class.php index 1724f329..13e1424b 100644 --- a/themes/flat/themelet.class.php +++ b/themes/flat/themelet.class.php @@ -31,12 +31,33 @@ class Themelet { global $config; $i_id = int_escape($image->id); $h_view_link = make_link("post/view/$i_id", $query); - $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf' || 'svg'){ + + + // Removes the size tag if the file is an mp3 + if($image->ext == 'mp3'){ + $iitip = $image->get_tooltip(); + $mp3tip = array("0x0"); + $h_tip = str_replace($mp3tip, " ", $iitip); + + // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size) + $justincase = array(" //", "// ", " //", "// ", " "); + if(strstr($h_tip, " ")){ + $h_tip = html_escape(str_replace($justincase, "", $h_tip)); + }else{ + $h_tip = html_escape($h_tip); + } + }else{ + $h_tip = html_escape($image->get_tooltip()); + } + + + // If file is flash or svg then sets thumbnail to max size. + if($image->ext == 'swf' || $image->ext == 'svg'){ $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } + return "
diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index 5985f2e2..b88fdec6 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -19,12 +19,33 @@ class Themelet { public function build_thumb_html(Image $image, $query=null) { global $config; $h_view_link = make_link("post/view/{$image->id}", $query); - $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf' || 'svg'){ + + + // Removes the size tag if the file is an mp3 + if($image->ext == 'mp3'){ + $iitip = $image->get_tooltip(); + $mp3tip = array("0x0"); + $h_tip = str_replace($mp3tip, " ", $iitip); + + // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size) + $justincase = array(" //", "// ", " //", "// ", " "); + if(strstr($h_tip, " ")){ + $h_tip = html_escape(str_replace($justincase, "", $h_tip)); + }else{ + $h_tip = html_escape($h_tip); + } + }else{ + $h_tip = html_escape($image->get_tooltip()); + } + + + // If file is flash or svg then sets thumbnail to max size. + if($image->ext == 'swf' || $image->ext == 'svg'){ $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } + return "$h_tip"; } diff --git a/themes/lite/themelet.class.php b/themes/lite/themelet.class.php index d5539d23..ea0297e0 100644 --- a/themes/lite/themelet.class.php +++ b/themes/lite/themelet.class.php @@ -31,12 +31,33 @@ class Themelet { global $config; $i_id = int_escape($image->id); $h_view_link = make_link("post/view/$i_id", $query); - $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf' || 'svg'){ + + + // Removes the size tag if the file is an mp3 + if($image->ext == 'mp3'){ + $iitip = $image->get_tooltip(); + $mp3tip = array("0x0"); + $h_tip = str_replace($mp3tip, " ", $iitip); + + // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size) + $justincase = array(" //", "// ", " //", "// ", " "); + if(strstr($h_tip, " ")){ + $h_tip = html_escape(str_replace($justincase, "", $h_tip)); + }else{ + $h_tip = html_escape($h_tip); + } + }else{ + $h_tip = html_escape($image->get_tooltip()); + } + + + // If file is flash or svg then sets thumbnail to max size. + if($image->ext == 'swf' || $image->ext == 'svg'){ $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } + return "
diff --git a/themes/old_default/themelet.class.php b/themes/old_default/themelet.class.php index e7ed8967..35c7dc53 100644 --- a/themes/old_default/themelet.class.php +++ b/themes/old_default/themelet.class.php @@ -29,12 +29,33 @@ class Themelet { global $config; $i_id = int_escape($image->id); $h_view_link = make_link("post/view/$i_id", $query); - $h_tip = html_escape($image->get_tooltip()); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf' || 'svg'){ + + + // Removes the size tag if the file is an mp3 + if($image->ext == 'mp3'){ + $iitip = $image->get_tooltip(); + $mp3tip = array("0x0"); + $h_tip = str_replace($mp3tip, " ", $iitip); + + // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size) + $justincase = array(" //", "// ", " //", "// ", " "); + if(strstr($h_tip, " ")){ + $h_tip = html_escape(str_replace($justincase, "", $h_tip)); + }else{ + $h_tip = html_escape($h_tip); + } + }else{ + $h_tip = html_escape($image->get_tooltip()); + } + + + // If file is flash or svg then sets thumbnail to max size. + if($image->ext == 'swf' || $image->ext == 'svg'){ $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } + return "$h_tip"; } diff --git a/themes/warm/themelet.class.php b/themes/warm/themelet.class.php index 8a3df34a..041274e1 100644 --- a/themes/warm/themelet.class.php +++ b/themes/warm/themelet.class.php @@ -31,13 +31,34 @@ class Themelet { global $config; $i_id = int_escape($image->id); $h_view_link = make_link("post/view/$i_id", $query); - $h_tip = html_escape($image->get_tooltip()); $h_image_link = $image->get_image_link(); $h_thumb_link = $image->get_thumb_link(); - if($image->ext == 'swf' || 'svg'){ + + + // Removes the size tag if the file is an mp3 + if($image->ext == 'mp3'){ + $iitip = $image->get_tooltip(); + $mp3tip = array("0x0"); + $h_tip = str_replace($mp3tip, " ", $iitip); + + // Makes it work with a variation of the default tooltips (I.E $tags // $filesize // $size) + $justincase = array(" //", "// ", " //", "// ", " "); + if(strstr($h_tip, " ")){ + $h_tip = html_escape(str_replace($justincase, "", $h_tip)); + }else{ + $h_tip = html_escape($h_tip); + } + }else{ + $h_tip = html_escape($image->get_tooltip()); + } + + + // If file is flash or svg then sets thumbnail to max size. + if($image->ext == 'swf' || $image->ext == 'svg'){ $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } + return "
From fbe0df29ed0689174fcc5f70dc1d694c305f901e Mon Sep 17 00:00:00 2001 From: Daku Date: Fri, 16 Dec 2011 21:35:30 +0000 Subject: [PATCH 4/9] Fixed scaling with the theme patch. --- contrib/handle_flash/main.php | 1 - contrib/handle_mp3/main.php | 1 - contrib/handle_svg/main.php | 1 - 3 files changed, 3 deletions(-) diff --git a/contrib/handle_flash/main.php b/contrib/handle_flash/main.php index f63f988d..8ee32fc0 100644 --- a/contrib/handle_flash/main.php +++ b/contrib/handle_flash/main.php @@ -7,7 +7,6 @@ class FlashFileHandler extends DataHandlerExtension { protected function create_thumb($hash) { - // FIXME: scale image, as not all boards use 192x192 copy("ext/handle_flash/thumb.jpg", warehouse_path("thumbs", $hash)); } diff --git a/contrib/handle_mp3/main.php b/contrib/handle_mp3/main.php index ba02b3c5..76187638 100644 --- a/contrib/handle_mp3/main.php +++ b/contrib/handle_mp3/main.php @@ -7,7 +7,6 @@ class MP3FileHandler extends DataHandlerExtension { protected function create_thumb($hash) { - // FIXME: scale image, as not all boards use 192x192 copy("ext/handle_mp3/thumb.jpg", warehouse_path("thumbs", $hash)); } diff --git a/contrib/handle_svg/main.php b/contrib/handle_svg/main.php index e9e94c25..f028e178 100644 --- a/contrib/handle_svg/main.php +++ b/contrib/handle_svg/main.php @@ -40,7 +40,6 @@ class SVGFileHandler implements Extension { // exec("convert images/{$ha}/{$hash}[0] -geometry {$w}x{$h} -quality {$q} jpg:thumbs/{$ha}/{$hash}"); // } // else { - // FIXME: scale image, as not all boards use 192x192 copy("ext/handle_svg/thumb.jpg", warehouse_path("thumbs", $hash)); // } } From c125c4ba927c7ba12921219cc15f89efce48b6de Mon Sep 17 00:00:00 2001 From: Daku Date: Mon, 19 Dec 2011 01:43:46 +0000 Subject: [PATCH 5/9] Making the upload form look a bit nicer. --- ext/upload/style.css | 9 +++++++-- ext/upload/theme.php | 30 ++++++++++++++++++------------ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/ext/upload/style.css b/ext/upload/style.css index c4b1e63e..1fe3f45d 100644 --- a/ext/upload/style.css +++ b/ext/upload/style.css @@ -1,4 +1,9 @@ - -#large_upload_form INPUT { +/* Only need to change the file/url inputs */ +#large_upload_form INPUT.wid { width: 100%; } +#radio_button { + width: auto; +} +/* This is needed since the theme style.css forcibly sets vertical align to "top". */ +TABLE.vert TD, TABLE.vert TH {vertical-align: middle;} diff --git a/ext/upload/theme.php b/ext/upload/theme.php index 9d42098e..3575d569 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -12,22 +12,28 @@ class UploadTheme extends Themelet { public function display_page(Page $page) { global $config; $tl_enabled = ($config->get_string("transload_engine", "none") != "none"); - + + // Uploader 2.0! $upload_list = ""; for($i=0; $i<$config->get_int('upload_count'); $i++) { $n = $i + 1; $width = $tl_enabled ? "35%" : "80%"; $upload_list .= " - File $n - - "; - if($tl_enabled) { - $upload_list .= " - URL $n - - "; - } +
File
"; + if($tl_enabled) { + $upload_list .=" + URL
+ + + "; + } + else { + $upload_list .= " + + "; + } + $upload_list .= " "; @@ -51,7 +57,7 @@ class UploadTheme extends Themelet { }); ".make_form(make_link("upload"), "POST", $multipart=True)." - +
$upload_list @@ -60,7 +66,7 @@ class UploadTheme extends Themelet { (Max file size is $max_kb) "; - + if($tl_enabled) { $link = make_http(make_link("upload")); if($config->get_bool('nice_urls')){ From dab67ea1bbdcf6fc5c6e5b074547153021d9181c Mon Sep 17 00:00:00 2001 From: Daku Date: Tue, 20 Dec 2011 21:56:07 +0000 Subject: [PATCH 6/9] Updated recaptcha. --- lib/recaptchalib.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/recaptchalib.php b/lib/recaptchalib.php index 897c5098..32c4f4d7 100644 --- a/lib/recaptchalib.php +++ b/lib/recaptchalib.php @@ -4,7 +4,7 @@ * - Documentation and latest version * http://recaptcha.net/plugins/php/ * - Get a reCAPTCHA API Key - * http://recaptcha.net/api/getkey + * https://www.google.com/recaptcha/admin/create * - Discussion group * http://groups.google.com/group/recaptcha * @@ -35,9 +35,9 @@ /** * The reCAPTCHA server URL's */ -define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net"); -define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net"); -define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net"); +define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api"); +define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api"); +define("RECAPTCHA_VERIFY_SERVER", "www.google.com"); /** * Encodes the given data into a query string format @@ -106,7 +106,7 @@ function _recaptcha_http_post($host, $path, $data, $port = 80) { function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) { if ($pubkey == null || $pubkey == '') { - die ("To use reCAPTCHA you must get an API key from http://recaptcha.net/api/getkey"); + die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); } if ($use_ssl) { @@ -152,7 +152,7 @@ class ReCaptchaResponse { function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array()) { if ($privkey == null || $privkey == '') { - die ("To use reCAPTCHA you must get an API key from http://recaptcha.net/api/getkey"); + die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); } if ($remoteip == null || $remoteip == '') { @@ -169,7 +169,7 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ex return $recaptcha_response; } - $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/verify", + $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify", array ( 'privatekey' => $privkey, 'remoteip' => $remoteip, @@ -200,7 +200,7 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ex * @param string $appname The name of your application */ function recaptcha_get_signup_url ($domain = null, $appname = null) { - return "http://recaptcha.net/api/getkey?" . _recaptcha_qsencode (array ('domain' => $domain, 'app' => $appname)); + return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname)); } function _recaptcha_aes_pad($val) { @@ -230,14 +230,14 @@ function _recaptcha_mailhide_urlbase64 ($x) { function recaptcha_mailhide_url($pubkey, $privkey, $email) { if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) { die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " . - "you can do so at http://mailhide.recaptcha.net/apikey"); + "you can do so at http://www.google.com/recaptcha/mailhide/apikey"); } $ky = pack('H*', $privkey); $cryptmail = _recaptcha_aes_encrypt ($email, $ky); - return "http://mailhide.recaptcha.net/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail); + return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail); } /** @@ -262,7 +262,7 @@ function _recaptcha_mailhide_email_parts ($email) { * Gets html to display an email address given a public an private key. * to get a key, go to: * - * http://mailhide.recaptcha.net/apikey + * http://www.google.com/recaptcha/mailhide/apikey */ function recaptcha_mailhide_html($pubkey, $privkey, $email) { $emailparts = _recaptcha_mailhide_email_parts ($email); From c37569f3d453d43cb88b289e9d9b27203a1c1a6d Mon Sep 17 00:00:00 2001 From: Daku Date: Wed, 21 Dec 2011 02:28:39 +0000 Subject: [PATCH 7/9] Fixed reCaptcha. --- core/util.inc.php | 8 ++++---- ext/setup/main.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/util.inc.php b/core/util.inc.php index d6ce5354..c1333151 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -253,8 +253,8 @@ function captcha_get_html() { if(DEBUG && ip_in_range($_SERVER['REMOTE_ADDR'], "127.0.0.0/8")) return ""; $captcha = ""; - if($user->is_anonymous() && $config->get_bool("use_captchas")) { - $rpk = $config->get_string("api_recaptcha_pubkey"); + if($user->is_anonymous() && $config->get_bool("comment_captcha")) { + $rpk = $config->get_string("api_recaptcha_privkey"); if(!empty($rpk)) { $captcha = recaptcha_get_html($rpk); } @@ -274,8 +274,8 @@ function captcha_check() { if(DEBUG && ip_in_range($_SERVER['REMOTE_ADDR'], "127.0.0.0/8")) return true; - if($user->is_anonymous() && $config->get_bool("use_captchas")) { - $rpk = $config->get_string('api_recaptcha_privkey'); + if($user->is_anonymous() && $config->get_bool("comment_captcha")) { + $rpk = $config->get_string('api_recaptcha_pubkey'); if(!empty($rpk)) { $resp = recaptcha_check_answer( $rpk, diff --git a/ext/setup/main.php b/ext/setup/main.php index e53061b1..f1885568 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -171,7 +171,7 @@ class Setup extends SimpleExtension { $config->set_default_string("theme", "default"); $config->set_default_bool("use_autodate", true); $config->set_default_bool("word_wrap", true); - $config->set_default_bool("use_captchas", false); + $config->set_default_bool("comment_captcha", false); $config->set_default_string("autodate_format", "F j, Y"); // Automatic caching is disabled by default $config->set_default_string("autocache_location", "data/cache"); From 9a2d694b6a6939ab5245d137de73b77b7f48c404 Mon Sep 17 00:00:00 2001 From: Daku Date: Wed, 21 Dec 2011 02:40:30 +0000 Subject: [PATCH 8/9] Made the replace form look similar to the new upload form. --- ext/upload/theme.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/ext/upload/theme.php b/ext/upload/theme.php index 3575d569..a18adbe5 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -17,7 +17,6 @@ class UploadTheme extends Themelet { $upload_list = ""; for($i=0; $i<$config->get_int('upload_count'); $i++) { $n = $i + 1; - $width = $tl_enabled ? "35%" : "80%"; $upload_list .= " - - - - "; - if($tl_enabled) { - $upload_list .= " - - - - - "; - } + + + + "; + } else { + $upload_list .= " + "; + } $max_size = $config->get_int('upload_size'); $max_kb = to_shorthand_int($max_size); @@ -133,7 +129,7 @@ class UploadTheme extends Themelet { .$thumbnail."
" .make_form(make_link("upload/replace/".$image_id), "POST", $multipart=True)." -
Tags
Source
File
"; @@ -105,21 +104,18 @@ class UploadTheme extends Themelet { $tl_enabled = ($config->get_string("transload_engine", "none") != "none"); $upload_list = ''; - $width = $tl_enabled ? "35%" : "80%"; $upload_list .= " -
File
URL
File
"; + if($tl_enabled) { + $upload_list .=" + URL
+
$upload_list From 660f9ca4b06a03e34406b3fcc21fb8626dde89ba Mon Sep 17 00:00:00 2001 From: Daku Date: Wed, 21 Dec 2011 20:52:06 +0000 Subject: [PATCH 9/9] Changed "'thumb_width', 'thumb_height'" > "$config->get_int('thumb_width'), $config->get_int('thumb_height')" --- themes/danbooru/themelet.class.php | 2 +- themes/default/themelet.class.php | 2 +- themes/flat/themelet.class.php | 2 +- themes/futaba/themelet.class.php | 2 +- themes/lite/themelet.class.php | 2 +- themes/old_default/themelet.class.php | 2 +- themes/warm/themelet.class.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index 9b634942..ed738f7e 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -41,7 +41,7 @@ class Themelet { // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg'){ - $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } diff --git a/themes/default/themelet.class.php b/themes/default/themelet.class.php index e0ee012e..08b4b694 100644 --- a/themes/default/themelet.class.php +++ b/themes/default/themelet.class.php @@ -54,7 +54,7 @@ class Themelet { // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg'){ - $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } diff --git a/themes/flat/themelet.class.php b/themes/flat/themelet.class.php index 13e1424b..0aaa32b0 100644 --- a/themes/flat/themelet.class.php +++ b/themes/flat/themelet.class.php @@ -54,7 +54,7 @@ class Themelet { // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg'){ - $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index b88fdec6..20e7e2fb 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -42,7 +42,7 @@ class Themelet { // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg'){ - $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } diff --git a/themes/lite/themelet.class.php b/themes/lite/themelet.class.php index ea0297e0..d5b5e479 100644 --- a/themes/lite/themelet.class.php +++ b/themes/lite/themelet.class.php @@ -54,7 +54,7 @@ class Themelet { // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg'){ - $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } diff --git a/themes/old_default/themelet.class.php b/themes/old_default/themelet.class.php index 35c7dc53..ff48817b 100644 --- a/themes/old_default/themelet.class.php +++ b/themes/old_default/themelet.class.php @@ -52,7 +52,7 @@ class Themelet { // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg'){ - $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); } else{ $tsize = get_thumbnail_size($image->width, $image->height); } diff --git a/themes/warm/themelet.class.php b/themes/warm/themelet.class.php index 041274e1..38170d2e 100644 --- a/themes/warm/themelet.class.php +++ b/themes/warm/themelet.class.php @@ -55,7 +55,7 @@ class Themelet { // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg'){ - $tsize = get_thumbnail_size('thumb_width', 'thumb_height'); } + $tsize = get_thumbnail_size($config->get_int('thumb_width'), $config->get_int('thumb_height')); } else{ $tsize = get_thumbnail_size($image->width, $image->height); }
Source