aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-08-14 11:55:35 +0000
committerplegall <plg@piwigo.org>2005-08-14 11:55:35 +0000
commitc501facfa5447443be872c56377cb9141c939196 (patch)
tree98398fcb58b01c5e49a470ead3cbd75d86b6a5fa /picture.php
parent194bf3ca48dc0a8ac5fb6bcd1c777367dfa2dbcc (diff)
- new : ability to set an element as representant of its category directly
from picture.php screen. - improvement : dedicated icon to add elements into caddie. Ths icon is displayed in the category title bar. git-svn-id: http://piwigo.org/svn/trunk@811 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/picture.php b/picture.php
index 479fcf63d..b05414cf5 100644
--- a/picture.php
+++ b/picture.php
@@ -74,6 +74,22 @@ if (!$belongs)
echo $lang['thumbnails'].'</a></div>';
exit();
}
+//-------------------------------------------------------------- representative
+if ('admin' == $user['status'] and isset($_GET['representative']))
+{
+ $query = '
+UPDATE '.CATEGORIES_TABLE.'
+ SET representative_picture_id = '.$_GET['image_id'].'
+ WHERE id = '.$page['cat'].'
+;';
+ pwg_query($query);
+
+ $url =
+ PHPWG_ROOT_PATH
+ .'picture.php'
+ .get_query_string_diff(array('representative'));
+ redirect($url);
+}
//---------------------------------------------------------- related categories
$query = '
SELECT category_id,uppercats,commentable,global_rank
@@ -620,6 +636,19 @@ if (isset($picture['current']['high']))
'HEIGHT_IMG'=>($full_height + 16)
));
}
+// button to set the current picture as representative
+if ('admin' == $user['status'] and is_numeric($page['cat']))
+{
+ $template->assign_block_vars(
+ 'representative',
+ array(
+ 'URL' =>
+ PHPWG_ROOT_PATH.'picture.php'
+ .get_query_string_diff(array())
+ .'&amp;representative=1'
+ )
+ );
+}
//------------------------------------------------------- favorite manipulation
if ( !$user['is_the_guest'] )
{