aboutsummaryrefslogtreecommitdiffstats
path: root/category.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--category.php23
1 files changed, 2 insertions, 21 deletions
diff --git a/category.php b/category.php
index 5484804ee..592ca526b 100644
--- a/category.php
+++ b/category.php
@@ -78,8 +78,7 @@ initialize_category();
// caddie filling :-)
if (isset($_GET['caddie']))
{
- include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
- // You can't add in caddie elements that are already in !
+// include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
$query = '
SELECT DISTINCT(id)
@@ -87,25 +86,7 @@ SELECT DISTINCT(id)
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
'.$page['where'].'
;';
- $ids = array_from_query($query, 'id');
-
- $query = '
-SELECT element_id
- FROM '.CADDIE_TABLE.'
- WHERE user_id = '.$user['id'].'
-;';
- $in_caddie = array_from_query($query, 'element_id');
-
- $caddiables = array_diff($ids, $in_caddie);
-
- $datas = array();
-
- foreach ($caddiables as $caddiable)
- {
- array_push($datas, array('element_id' => $caddiable,
- 'user_id' => $user['id']));
- }
- mass_inserts(CADDIE_TABLE, array('element_id','user_id'), $datas);
+ fill_caddie(array_from_query($query, 'id'));
}
// creation of the array containing the cat ids to expand in the menu