aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/cat_modify.php4
-rw-r--r--admin/element_set_global.php6
-rw-r--r--admin/element_set_unit.php38
-rw-r--r--admin/picture_modify.php6
-rw-r--r--admin/waiting.php43
5 files changed, 45 insertions, 52 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index a543d0d77..e87a6aee5 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -388,12 +388,12 @@ if ($category['nb_images'] > 0
if (!empty($category['representative_picture_id']))
{
$query = '
-SELECT tn_ext,path
+SELECT id,tn_ext,path
FROM '.IMAGES_TABLE.'
WHERE id = '.$category['representative_picture_id'].'
;';
$row = mysql_fetch_array(pwg_query($query));
- $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
+ $src = get_thumbnail_url($row);
$url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify';
$url.= '&image_id='.$category['representative_picture_id'];
diff --git a/admin/element_set_global.php b/admin/element_set_global.php
index c6a522106..fc4f7c172 100644
--- a/admin/element_set_global.php
+++ b/admin/element_set_global.php
@@ -122,7 +122,7 @@ DELETE
AND image_id IN ('.implode(',', $dissociables).')
';
pwg_query($query);
-
+
update_category($_POST['dissociate']);
}
@@ -399,9 +399,9 @@ SELECT id,path,tn_ext
$template->assign_block_vars('thumbnails', array());
}
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
- $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
+ $src = get_thumbnail_url($row);
$template->assign_block_vars(
'thumbnails.thumbnail',
diff --git a/admin/element_set_unit.php b/admin/element_set_unit.php
index 163602ad9..c58c53649 100644
--- a/admin/element_set_unit.php
+++ b/admin/element_set_unit.php
@@ -28,9 +28,9 @@
/**
* Management of elements set. Elements can belong to a category or to the
* user caddie.
- *
+ *
*/
-
+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
@@ -50,9 +50,9 @@ check_status(ACCESS_ADMINISTRATOR);
if (isset($_POST['submit']))
{
$collection = explode(',', $_POST['list']);
-
+
$datas = array();
-
+
$query = '
SELECT id, date_creation
FROM '.IMAGES_TABLE.'
@@ -75,7 +75,7 @@ SELECT id, date_creation
$data{$field} = strip_tags($_POST[$field.'-'.$row['id']]);
}
}
-
+
if ($conf['allow_html_descriptions'])
{
$data{'comment'} = @$_POST['description-'.$row['id']];
@@ -103,7 +103,7 @@ SELECT id, date_creation
{
$data{'date_creation'} = $row['date_creation'];
}
-
+
array_push($datas, $data);
// tags management
@@ -112,7 +112,7 @@ SELECT id, date_creation
set_tags($_POST[ 'tags-'.$row['id'] ], $row['id']);
}
}
-
+
mass_updates(
IMAGES_TABLE,
array(
@@ -121,7 +121,7 @@ SELECT id, date_creation
),
$datas
);
-
+
array_push($page['infos'], l10n('Picture informations updated'));
}
@@ -141,16 +141,16 @@ $template->assign_vars(
'CATEGORIES_NAV'=>$page['title'],
'L_SUBMIT'=>$lang['submit'],
-
+
'U_ELEMENTS_PAGE'
=>$base_url.get_query_string_diff(array('display','start')),
-
+
'U_GLOBAL_MODE'
=>
$base_url
.get_query_string_diff(array('mode','display'))
.'&mode=global',
-
+
'F_ACTION'=>$base_url.get_query_string_diff(array()),
)
);
@@ -190,7 +190,7 @@ if (count($page['cat_elements_id']) > 0)
// tags
$all_tags = get_all_tags();
-
+
$element_ids = array();
$query = '
@@ -202,12 +202,12 @@ SELECT id,path,tn_ext,name,date_creation,comment,author,file
;';
$result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ while ($row = mysql_fetch_assoc($result))
{
// echo '<pre>'; print_r($row); echo '</pre>';
array_push($element_ids, $row['id']);
-
- $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
+
+ $src = get_thumbnail_url($row);
$query = '
SELECT tag_id
@@ -215,7 +215,7 @@ SELECT tag_id
WHERE image_id = '.$row['id'].'
;';
$selected_tags = array_from_query($query, 'tag_id');
-
+
// creation date
if (!empty($row['date_creation']))
{
@@ -241,7 +241,7 @@ SELECT tag_id
l10n('No tag defined. Use Administration>Pictures>Tags').
'</p>';
}
-
+
$template->assign_block_vars(
'element',
array(
@@ -258,11 +258,11 @@ SELECT tag_id
'AUTHOR' => @$row['author'],
'DESCRIPTION' => @$row['comment'],
'DATE_CREATION_YEAR' => $year,
-
+
'TAG_SELECTION' => $tag_selection,
)
);
-
+
get_day_list('element.date_creation_day', $day);
get_month_list('element.date_creation_month', $month);
}
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index 291d41bd0..664503281 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -141,7 +141,7 @@ DELETE FROM '.IMAGE_CATEGORY_TABLE.'
AND category_id IN ('.implode(',', $_POST['cat_associated']).')
';
pwg_query($query);
-
+
update_category($_POST['cat_associated']);
}
// elect the element to represent the given categories
@@ -223,7 +223,7 @@ else
l10n('No tag defined. Use Administration>Pictures>Tags').
'</p>';
}
-
+
$template->assign_vars(
array(
'U_SYNC' =>
@@ -234,7 +234,7 @@ $template->assign_vars(
'PATH'=>$row['path'],
- 'TN_SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']),
+ 'TN_SRC' => get_thumbnail_url($row),
'NAME' =>
isset($_POST['name']) ?
diff --git a/admin/waiting.php b/admin/waiting.php
index b5cfb13b5..36f1b3a01 100644
--- a/admin/waiting.php
+++ b/admin/waiting.php
@@ -42,9 +42,9 @@ if (isset($_POST))
{
$to_validate = array();
$to_reject = array();
-
+
if (isset($_POST['submit']))
- {
+ {
foreach (explode(',', $_POST['list']) as $waiting_id)
{
if (isset($_POST['action-'.$waiting_id]))
@@ -106,26 +106,19 @@ SELECT id, storage_category_id, file, tn_ext
{
$dir = get_complete_dir($row['storage_category_id']);
unlink($dir.$row['file']);
- if (isset($row['tn_ext']) and $row['tn_ext'] != '')
- {
- unlink(
- get_thumbnail_src(
- $dir.$row['file'],
- $row['tn_ext']
- )
- );
- }
- else if (@is_file(get_thumbnail_src($dir.$row['file'], 'jpg')))
+ $element_info = array(
+ 'path' => $dir.$row['file'],
+ 'tn_ext' =>
+ (isset($row['tn_ext']) and $row['tn_ext']!='') ? $row['tn_ext']:'jpg'
+ );
+ $tn_path = get_thumbnail_path( $element_info );
+
+ if ( @is_file($tn_path) )
{
- unlink(
- get_thumbnail_src(
- $dir.$row['file'],
- 'jpg'
- )
- );
+ unlink( $tn_path );
}
}
-
+
$query = '
DELETE
FROM '.WAITING_TABLE.'
@@ -154,10 +147,10 @@ $template->assign_vars(array(
'L_SUBMIT'=>$lang['submit'],
'L_RESET'=>$lang['reset'],
'L_DELETE'=>$lang['delete'],
-
+
'F_ACTION'=>str_replace( '&', '&amp;', $_SERVER['REQUEST_URI'])
));
-
+
//---------------------------------------------------------------- form display
$cat_names = array();
$list = array();
@@ -182,7 +175,7 @@ while ( $row = mysql_fetch_array( $result ) )
$preview_url = PHPWG_ROOT_PATH.$cat_names[$row['storage_category_id']]['dir'].$row['file'];
$class='row1';
if ( $i++ % 2== 0 ) $class='row2';
-
+
$template->assign_block_vars(
'picture',
array(
@@ -194,7 +187,7 @@ while ( $row = mysql_fetch_array( $result ) )
'FILE_IMG' =>
(strlen($row['file']) > 10) ?
(substr($row['file'], 0, 10)).'...' : $row['file'],
- 'PREVIEW_URL_IMG'=>$preview_url,
+ 'PREVIEW_URL_IMG'=>$preview_url,
'UPLOAD_EMAIL'=>get_email_address_as_display_text($row['mail_address']),
'UPLOAD_USERNAME'=>$row['username']
)
@@ -208,7 +201,7 @@ while ( $row = mysql_fetch_array( $result ) )
$thumbnail.= '.'.$row['tn_ext'];
$url = $cat_names[$row['storage_category_id']]['dir'];
$url.= 'thumbnail/'.$thumbnail;
-
+
$template->assign_block_vars(
'picture.thumbnail',
array(
@@ -229,7 +222,7 @@ $template->assign_vars(
'LIST' => implode(',', $list)
)
);
-
+
//----------------------------------------------------------- sending html code
$template->assign_var_from_handle('ADMIN_CONTENT', 'waiting');
?>