diff --git a/doc/ChangeLog b/doc/ChangeLog index b1fcdc06c..eea7a2d71 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,11 @@ +2005-08-14 Pierrick LE GALL + + * 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. + 2005-08-14 Pierrick LE GALL * new : maintenance screen in administration. There you can update 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'].''; 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()) + .'&representative=1' + ) + ); +} //------------------------------------------------------- favorite manipulation if ( !$user['is_the_guest'] ) { diff --git a/template/default/category.tpl b/template/default/category.tpl index 437652138..0d523c129 100644 --- a/template/default/category.tpl +++ b/template/default/category.tpl @@ -88,7 +88,14 @@
+
+