- shows the element representing a non empty category in cat_modify

- possibility to set a random representing element for a category

- bug fixed : update_category function could not update nb_images

- bug fixed : mass_updates was inserting in the wrong table


git-svn-id: http://piwigo.org/svn/trunk@633 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
plegall
2004-12-04 17:42:07 +00:00
parent a383f3148c
commit b3336f57d5
5 changed files with 67 additions and 22 deletions
+1 -15
View File
@@ -515,21 +515,7 @@ INSERT INTO '.IMAGE_CATEGORY_TABLE.'
;';
pwg_query($query);
// set a new representative element for this category
$query = '
SELECT image_id
FROM '.IMAGE_CATEGORY_TABLE.'
WHERE category_id = '.$category_id.'
ORDER BY RAND()
LIMIT 0,1
;';
list($representative) = mysql_fetch_array(pwg_query($query));
$query = '
UPDATE '.CATEGORIES_TABLE.'
SET representative_picture_id = '.$representative.'
WHERE id = '.$category_id.'
;';
pwg_query($query);
set_random_representant(array($category_id));
}
return $output;
}