- deprecated get_thumbnail_src (still there for compatibility). use rather

get_thumbnail_path or get_thumbnail_url (these allow plugins to override)
- plugins can hook into index thumbnail display (items only so far)

git-svn-id: http://piwigo.org/svn/trunk@1596 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2006-11-07 03:37:57 +00:00
parent eb4214096f
commit 8f52e36a6f
3 changed files with 73 additions and 40 deletions
+11 -5
View File
@@ -49,7 +49,7 @@ SELECT *
WHERE id IN ('.implode(',', $selection).')
;';
$result = pwg_query($query);
while ($row = mysql_fetch_array($result))
while ($row = mysql_fetch_assoc($result))
{
$row['rank'] = $page['rank_of'][ $row['id'] ];
@@ -60,19 +60,20 @@ SELECT *
}
// template thumbnail initialization
$template->set_filenames( array( 'thumbnails' => 'thumbnails.tpl',));
$template->set_filenames( array( 'thumbnails' => 'thumbnails.tpl',));
if (count($pictures) > 0)
{
$template->assign_block_vars('thumbnails', array());
// first line
$template->assign_block_vars('thumbnails.line', array());
// current row displayed
$row_number = 0;
}
trigger_action('loc_begin_index_thumbnails', $pictures);
foreach ($pictures as $row)
{
$thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']);
$thumbnail_url = get_thumbnail_url($row);
// message in title for the thumbnail
$thumbnail_title = $row['file'];
@@ -80,7 +81,7 @@ foreach ($pictures as $row)
{
$thumbnail_title .= ' : '.$row['filesize'].' KB';
}
// link on picture.php page
$url = duplicate_picture_url(
array(
@@ -159,6 +160,9 @@ SELECT COUNT(*) AS nb_comments
array('NB_COMMENTS'=>$row['nb_comments']));
}
//plugins need to add/modify sth in this loop ?
trigger_action('loc_index_thumbnail', $row, 'thumbnails.line.thumbnail' );
// create a new line ?
if (++$row_number == $user['nb_image_line'])
{
@@ -166,6 +170,8 @@ SELECT COUNT(*) AS nb_comments
$row_number = 0;
}
}
trigger_action('loc_end_index_thumbnails', $pictures);
$template->assign_var_from_handle('THUMBNAILS', 'thumbnails');
pwg_debug('end include/category_default.inc.php');