aboutsummaryrefslogtreecommitdiffstats
path: root/admin/update.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/update.php')
-rw-r--r--admin/update.php16
1 files changed, 1 insertions, 15 deletions
diff --git a/admin/update.php b/admin/update.php
index 45bef3bce..aca5307ea 100644
--- a/admin/update.php
+++ b/admin/update.php
@@ -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;
}