Пример #1
0
        $data['date_creation'] = null;
    }
    $data = trigger_change('picture_modify_before_update', $data);
    single_update(IMAGES_TABLE, $data, array('id' => $data['id']));
    // time to deal with tags
    $tag_ids = array();
    if (!empty($_POST['tags'])) {
        $tag_ids = get_tag_ids($_POST['tags']);
    }
    set_tags($tag_ids, $_GET['image_id']);
    // association to albums
    if (!isset($_POST['associate'])) {
        $_POST['associate'] = array();
    }
    check_input_parameter('associate', $_POST, true, PATTERN_ID);
    move_images_to_categories(array($_GET['image_id']), $_POST['associate']);
    invalidate_user_cache();
    // thumbnail for albums
    if (!isset($_POST['represent'])) {
        $_POST['represent'] = array();
    }
    check_input_parameter('represent', $_POST, true, PATTERN_ID);
    $no_longer_thumbnail_for = array_diff($represented_albums, $_POST['represent']);
    if (count($no_longer_thumbnail_for) > 0) {
        set_random_representant($no_longer_thumbnail_for);
    }
    $new_thumbnail_for = array_diff($_POST['represent'], $represented_albums);
    if (count($new_thumbnail_for) > 0) {
        $query = '
UPDATE ' . CATEGORIES_TABLE . '
  SET representative_picture_id = ' . $_GET['image_id'] . '
Пример #2
0
     associate_images_to_categories($collection, array($_POST['associate']));
     $_SESSION['page_infos'] = array(l10n('Information data registered in database'));
     // let's refresh the page because we the current set might be modified
     if ('no_album' == $page['prefilter']) {
         $redirect = true;
     } else {
         if ('no_virtual_album' == $page['prefilter']) {
             $category_info = get_cat_info($_POST['associate']);
             if (empty($category_info['dir'])) {
                 $redirect = true;
             }
         }
     }
 } else {
     if ('move' == $action) {
         move_images_to_categories($collection, array($_POST['move']));
         $_SESSION['page_infos'] = array(l10n('Information data registered in database'));
         // let's refresh the page because we the current set might be modified
         if ('no_album' == $page['prefilter']) {
             $redirect = true;
         } else {
             if ('no_virtual_album' == $page['prefilter']) {
                 $category_info = get_cat_info($_POST['move']);
                 if (empty($category_info['dir'])) {
                     $redirect = true;
                 }
             } else {
                 if (isset($_SESSION['bulk_manager_filter']['category']) and $_POST['move'] != $_SESSION['bulk_manager_filter']['category']) {
                     $redirect = true;
                 }
             }