mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
- 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:
+1
-15
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user