inline thumbnails

This commit is contained in:
Marc Delisle
2003-03-05 17:56:17 +00:00
parent c431c04f3d
commit 66598d38c5
4 changed files with 65 additions and 5 deletions

View File

@@ -10,6 +10,7 @@
* 40006 instead of 4.0.6RC3
* PMA_IS_WINDOWS (bool) - mark if phpMyAdmin running on windows
* server
* PMA_IS_GD2 (bool) - true is GD2 is present
*/
// phpMyAdmin release
if (!defined('PMA_VERSION')) {
@@ -45,5 +46,19 @@ if (!defined('PMA_IS_WINDOWS')) {
}
}
// Whether GD2 is present
if (!defined('PMA_IS_GD2')) {
if (function_exists("get_extension_funcs")) {
$testGD = @get_extension_funcs("gd");
if ($testGD && in_array("imagegd2",$testGD)) {
define('PMA_IS_GD2', 1);
} else {
define('PMA_IS_GD2', 0);
}
unset($testGD);
} else {
define('PMA_IS_GD2', 0);
}
}
// $__PMA_DEFINES_PHP_LIB__
?>

View File

@@ -4,11 +4,16 @@
if (!defined('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE')){
define('PMA_TRANSFORMATION_IMAGE_JPEG__INLINE', 1);
function PMA_transformation_image_jpeg__inline($buffer, $options = array()) {
include('./libraries/transformations/global.inc.php3');
$transform_options = array ('string' => '<img src="transformation_wrapper.php3' . $options['wrapper_link'] . '" alt="[__BUFFER__]" width="320" height="240">');
if (PMA_IS_GD2) {
//$transform_options = array ('string' => '<img src="transformation_wrapper.php3' . $options['wrapper_link'] . '&resize=1&suggested_size=' . (isset($options[0]) ? $options[0] : '100') . '" alt="[__BUFFER__]">');
$transform_options = array ('string' => '<a href="transformation_wrapper.php3' . $options['wrapper_link'] . '" target="_blank"><img src="transformation_wrapper.php3' . $options['wrapper_link'] . '&resize=1&suggested_size=' . (isset($options[0]) ? $options[0] : '100') . '" alt="[__BUFFER__]" border="0"></a>');
} else {
$transform_options = array ('string' => '<img src="transformation_wrapper.php3' . $options['wrapper_link'] . '" alt="[__BUFFER__]" width="320" height="240">');
}
$buffer = PMA_transformation_global_html_replace($buffer, $transform_options);
return $buffer;