aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_default.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-11-07 03:37:57 +0000
committerrvelices <rv-github@modusoptimus.com>2006-11-07 03:37:57 +0000
commit8f52e36a6fdb362e204cfec4b865b0cee5735fbf (patch)
tree0b69f745a5f88b9e0148076690ca6c4962b4064e /include/category_default.inc.php
parenteb4214096f9e86a58a8991617696350bede89f7d (diff)
- 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
Diffstat (limited to 'include/category_default.inc.php')
-rw-r--r--include/category_default.inc.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/category_default.inc.php b/include/category_default.inc.php
index 652f31f50..b1f7bc46a 100644
--- a/include/category_default.inc.php
+++ b/include/category_default.inc.php
@@ -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');