aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-10-23 12:38:34 +0000
committerz0rglub <z0rglub@piwigo.org>2004-10-23 12:38:34 +0000
commit18fc366d6d33b637fc4ef237f70548595903b046 (patch)
tree1f117ff875a6430affe7dd800d0cba693997af4f /admin
parentab73295294ea499b7988e585a9f203053e54c76a (diff)
can display thumbnail for non picture elements
git-svn-id: http://piwigo.org/svn/trunk@577 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/infos_images.php27
-rw-r--r--admin/picture_modify.php22
2 files changed, 37 insertions, 12 deletions
diff --git a/admin/infos_images.php b/admin/infos_images.php
index 1362da906..caa7d07d9 100644
--- a/admin/infos_images.php
+++ b/admin/infos_images.php
@@ -248,9 +248,12 @@ if (isset($page['cat']))
// Navigation path
$current_category = get_cat_info($_GET['cat_id']);
$url = PHPWG_ROOT_PATH.'admin.php?page=infos_images&amp;cat_id=';
- $category_path = get_cat_display_name($current_category['name'], '-&gt;', $url);
+ $category_path = get_cat_display_name($current_category['name'],
+ '-&gt;',
+ $url);
- $form_action = PHPWG_ROOT_PATH.'admin.php?page=infos_images&amp;cat_id='.$_GET['cat_id'];
+ $form_action = PHPWG_ROOT_PATH.'admin.php';
+ $form_action.= '?page=infos_images&amp;cat_id='.$_GET['cat_id'];
if($page['start'])
{
$form_action.= '&amp;start='.$_GET['start'];
@@ -321,11 +324,21 @@ SELECT *
$array_cat_directories[$row['storage_category_id']] =
get_complete_dir($row['storage_category_id']);
}
- $thumbnail_url = $array_cat_directories[$row['storage_category_id']];
- $thumbnail_url.= 'thumbnail/';
- $thumbnail_url.= $conf['prefix_thumbnail'];
- $thumbnail_url.= get_filename_wo_extension($row['file']);
- $thumbnail_url.= '.'.$row['tn_ext'];
+
+ // thumbnail url
+ if (isset($row['tn_ext']) and $row['tn_ext'] != '')
+ {
+ $thumbnail_url = $array_cat_directories[$row['storage_category_id']];
+ $thumbnail_url.= 'thumbnail/'.$conf['prefix_thumbnail'];
+ $thumbnail_url.= get_filename_wo_extension($row['file']);
+ $thumbnail_url.= '.'.$row['tn_ext'];
+ }
+ else
+ {
+ $thumbnail_url = PHPWG_ROOT_PATH;
+ $thumbnail_url = 'template/'.$user['template'].'/mimetypes/';
+ $thumbnail_url.= strtolower(get_extension($row['file'])).'.png';
+ }
// some fields are nullable in the images table
$nullables = array('name','author','keywords','date_creation','comment');
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index 94cc580e6..42259dd9e 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -188,7 +188,8 @@ SELECT *
$row = mysql_fetch_array(mysql_query($query));
// some fields are nullable in the images table
-$nullables = array('name','author','keywords','date_creation','comment');
+$nullables = array('name','author','keywords','date_creation','comment',
+ 'width','height');
foreach ($nullables as $field)
{
if (!isset($row[$field]))
@@ -209,10 +210,21 @@ else
$current_category = get_cat_info($row['storage_category_id']);
$dir_path = get_cat_display_name($current_category['name'], '-&gt;', '');
-$thumbnail_url = get_complete_dir($row['storage_category_id']);
-$file_wo_ext = get_filename_wo_extension($row['file']);
-$thumbnail_url.= '/thumbnail/';
-$thumbnail_url.= $conf['prefix_thumbnail'].$file_wo_ext.'.'.$row['tn_ext'];
+// thumbnail url
+if (isset($row['tn_ext']) and $row['tn_ext'] != '')
+{
+ $thumbnail_url = get_complete_dir($row['storage_category_id']);
+ $thumbnail_url.= 'thumbnail/'.$conf['prefix_thumbnail'];
+ $thumbnail_url.= get_filename_wo_extension($row['file']);
+ $thumbnail_url.= '.'.$row['tn_ext'];
+}
+else
+{
+ $thumbnail_url = PHPWG_ROOT_PATH;
+ $thumbnail_url = 'template/'.$user['template'].'/mimetypes/';
+ $thumbnail_url.= strtolower(get_extension($row['file'])).'.png';
+}
+
$url_img = PHPWG_ROOT_PATH.'picture.php?image_id='.$_GET['image_id'];
$url_img .= '&amp;cat='.$row['storage_category_id'];
$date = isset($_POST['date_creation']) && empty($errors)