'.l10n('Home').''.$conf['level_separator']; if (is_a_guest()) { $page['section_title'].= l10n('Collections'); } else { $page['section_title'].= ''.l10n('Collections').''; } $page['sub_section'] = 'list'; if (in_array(@$tokens[1], array('edit','view','list'))) { $page['sub_section'] = $tokens[1]; } if ($page['sub_section']=='edit' && isset($conf['GThumb']) && is_array($conf['GThumb'])) { $conf['GThumb']['big_thumb'] = false; // big thumb is buggy with removes } if (!empty($tokens[2])) { $page['col_id'] = $tokens[2]; } } } /* collections section */ function user_collections_page() { global $page, $template; if (isset($page['section']) and $page['section'] == 'collections') { include(USER_COLLEC_PATH . 'include/collections.inc.php'); } if (!is_a_guest() && count($page['items'])) { $template->set_filename('uc_thumbnails_cssjs', realpath(USER_COLLEC_PATH . 'template/thumbnails_css_js.tpl')); $template->parse('uc_thumbnails_cssjs'); } } // +-----------------------------------------------------------------------+ // | CATEGORY PAGE // +-----------------------------------------------------------------------+ /* add buttons on thumbnails list */ function user_collections_thumbnails_list($tpl_thumbnails_var, $pictures) { if (is_a_guest()) return $tpl_thumbnails_var; global $page, $template, $user; // the content is different on collection edition page and no button on batch downloader set edition page if (empty($pictures) or (@$page['section'] == 'collections' and @$page['sub_section']=='edit') or @$page['section'] == 'download') { return $tpl_thumbnails_var; } $image_ids = array_map(create_function('$i', 'return $i["id"];'), $pictures); // get collections for each picture $query = ' SELECT image_id, GROUP_CONCAT(col_id) AS col_ids FROM '.COLLECTION_IMAGES_TABLE.' WHERE col_id IN ( SELECT id FROM '.COLLECTIONS_TABLE.' WHERE user_id = '.$user['id'].' ) AND image_id IN('.implode(',', $image_ids).') GROUP BY image_id ;'; $image_collections = simple_hash_from_query($query, 'image_id', 'col_ids'); foreach ($tpl_thumbnails_var as &$thumbnail) { $thumbnail['COLLECTIONS'] = @$image_collections[ $thumbnail['id'] ]; } unset($thumbnail); // get all collections $query = ' SELECT id, name, nb_images FROM '.COLLECTIONS_TABLE.' WHERE user_id = '.$user['id'].' ORDER BY name ASC ;'; $collections = hash_from_query($query, 'id'); foreach ($collections as &$col) { $col["name"] = trigger_event('render_category_name', $col["name"]); } unset($col); $template->assign(array( 'COLLECTIONS' => $collections, 'USER_COLLEC_PATH' => USER_COLLEC_PATH, )); // thumbnails buttons $template->set_prefilter('index_thumbnails', 'user_collections_thumbnails_list_button'); return $tpl_thumbnails_var; } // add links function user_collections_thumbnails_list_button($content, &$smarty) { $search = '#(