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)); // } } 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"); 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..a18adbe5 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -12,22 +12,27 @@ 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 +56,7 @@ class UploadTheme extends Themelet { }); ".make_form(make_link("upload"), "POST", $multipart=True)." - +
$upload_list @@ -60,7 +65,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')){ @@ -99,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 .= " - - - - - "; - if($tl_enabled) { - $upload_list .= " - - - - - "; - } + + + + "; + } else { + $upload_list .= " + "; + } $max_size = $config->get_int('upload_size'); $max_kb = to_shorthand_int($max_size); @@ -127,7 +129,7 @@ class UploadTheme extends Themelet { .$thumbnail."
" .make_form(make_link("upload/replace/".$image_id), "POST", $multipart=True)." -
Tags
Source
File
URL
File
"; + if($tl_enabled) { + $upload_list .=" + URL
+
$upload_list 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); diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index 2fa978a5..ed738f7e 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -18,9 +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(); - $tsize = get_thumbnail_size($image->width, $image->height); + + + // 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($config->get_int('thumb_width'), $config->get_int('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 159f8881..08b4b694 100644 --- a/themes/default/themelet.class.php +++ b/themes/default/themelet.class.php @@ -31,9 +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(); - $tsize = get_thumbnail_size($image->width, $image->height); + + + // 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($config->get_int('thumb_width'), $config->get_int('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 b79ccc73..0aaa32b0 100644 --- a/themes/flat/themelet.class.php +++ b/themes/flat/themelet.class.php @@ -31,9 +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(); - $tsize = get_thumbnail_size($image->width, $image->height); + + + // 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($config->get_int('thumb_width'), $config->get_int('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 706f3f1b..20e7e2fb 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -19,9 +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(); - $tsize = get_thumbnail_size($image->width, $image->height); + + + // 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($config->get_int('thumb_width'), $config->get_int('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 8d57b147..d5b5e479 100644 --- a/themes/lite/themelet.class.php +++ b/themes/lite/themelet.class.php @@ -31,9 +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(); - $tsize = get_thumbnail_size($image->width, $image->height); + + + // 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($config->get_int('thumb_width'), $config->get_int('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 41c5cf5e..ff48817b 100644 --- a/themes/old_default/themelet.class.php +++ b/themes/old_default/themelet.class.php @@ -29,9 +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(); - $tsize = get_thumbnail_size($image->width, $image->height); + + + // 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($config->get_int('thumb_width'), $config->get_int('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 89f4dcf8..38170d2e 100644 --- a/themes/warm/themelet.class.php +++ b/themes/warm/themelet.class.php @@ -31,10 +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(); - $tsize = get_thumbnail_size($image->width, $image->height); + + + // 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($config->get_int('thumb_width'), $config->get_int('thumb_height')); } + else{ + $tsize = get_thumbnail_size($image->width, $image->height); } + return "
Source