Change param size number bye litteral size, like s for small, m for medium ...

This commit is contained in:
Knah Tsaeb 2013-04-02 16:09:57 +02:00
parent 1dbf462108
commit 58c2d9d4e9

View file

@ -18,7 +18,7 @@ $GLOBALS['config']['defaultThumbSize'] = '120x90';
// default size for thumbnail
$GLOBALS['config']['onlyThumb'] = TRUE;
// generate only thumbnail or generate thumbnail + 1280x1024 image
$GLOBALS['config']['thumbSize'] = array(1 => '100x80', '120x90', '200x160', '300x240', '400x320', '500x400');
$GLOBALS['config']['thumbSize'] = array('s' => '120x90', 'm' => '200x160', 'l' => '300x240', 'xl' => '400x320', 'xxl' => '500x400');
// list of available size for thumb
if (!file_exists('cache/config/genConf.php')) {
@ -233,7 +233,7 @@ if ($_GET) {
}
$defUrl = $ui['url'];
if (isset($ui['s']) && (int)$ui['s']) {
if (isset($ui['s']) && array_key_exists($ui['s'], $GLOBALS['config']['thumbSize'])) {
$width = $GLOBALS['config']['thumbSize'][$ui['s']];
} else {
$width = $GLOBALS['config']['defaultThumbSize'];
@ -282,7 +282,7 @@ if ($_POST) {
$defUrl = $ui['url'];
if (isset($ui['s']) && (int)$ui['s']) {
if (isset($ui['s']) && array_key_exists($ui['s'], $GLOBALS['config']['thumbSize'])) {
$width = $GLOBALS['config']['thumbSize'][$ui['s']];
} else {
$width = $GLOBALS['config']['defaultThumbSize'];
@ -347,7 +347,7 @@ if (empty($width)) {
<?php
if (!empty($success)) {
echo '<div id="result">';
echo '<img src="', $success['thumb'], '?r=', time(), '"/>';
echo '<img src="', $success['thumb'], '?r=', time(), '"/>';
echo '<p><label>', $width, '</label><input type="text" value="http://', $_SERVER['SERVER_NAME'], '/', $success['thumb'], '" onclick="this.select()"/></p>';
if ($GLOBALS['config']['onlyThumb'] === false) {
echo '<p><label>1280x1024</label><input type="text" value="http://', $_SERVER['SERVER_NAME'], '/', $success['normal'], '" onclick="this.select()"/></p>';