aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/functions.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 903267153..5ad436b71 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -922,6 +922,25 @@ SELECT uppercats
}
/**
+ */
+function get_category_representant_properties($image_id)
+{
+ $query = '
+SELECT id,representative_ext,path
+ FROM '.IMAGES_TABLE.'
+ WHERE id = '.$image_id.'
+;';
+ $row = pwg_db_fetch_assoc(pwg_query($query));
+ $src = DerivativeImage::thumb_url($row);
+ $url = get_root_url().'admin.php?page=photo-'.$image_id;
+
+ return array(
+ 'src' => $src,
+ 'url' => $url
+ );
+}
+
+/**
* Set a new random representant to the categories.
*
* @param int[] $categories