aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-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'] )
{