[20090] | 1 | <?php |
---|
| 2 | defined('USER_COLLEC_PATH') or die('Hacking attempt!'); |
---|
| 3 | |
---|
[20093] | 4 | |
---|
| 5 | // caddie |
---|
| 6 | if (isset($_GET['uc_caddie'])) |
---|
[20090] | 7 | { |
---|
[20093] | 8 | fill_caddie($page['items']); |
---|
| 9 | redirect($self_url); |
---|
| 10 | } |
---|
[20090] | 11 | |
---|
[20093] | 12 | // image order |
---|
| 13 | if (isset($_GET['uc_image_order'])) |
---|
| 14 | { |
---|
| 15 | if ( (int)$_GET['uc_image_order'] > 0) |
---|
| 16 | { |
---|
| 17 | pwg_set_session_var('uc_image_order', (int)$_GET['uc_image_order']); |
---|
| 18 | } |
---|
| 19 | else |
---|
| 20 | { |
---|
| 21 | pwg_unset_session_var('uc_image_order'); |
---|
| 22 | } |
---|
| 23 | redirect($self_url); |
---|
[20090] | 24 | } |
---|
| 25 | |
---|
[20093] | 26 | // get sorted elements |
---|
| 27 | $image_order_id = pwg_get_session_var('uc_image_order', 0); |
---|
| 28 | $orders = get_collection_preferred_image_orders(); |
---|
| 29 | |
---|
| 30 | $query = ' |
---|
| 31 | SELECT i.id |
---|
| 32 | FROM '.IMAGES_TABLE.' AS i |
---|
| 33 | JOIN '.COLLECTION_IMAGES_TABLE.' AS ci |
---|
| 34 | ON i.id = ci.image_id |
---|
| 35 | AND ci.col_id = '.$page['col_id'].' |
---|
| 36 | ORDER BY '.$orders[$image_order_id][1].' |
---|
| 37 | ;'; |
---|
| 38 | $page['items'] = array_from_query($query, 'id'); |
---|
| 39 | |
---|
| 40 | // image order menu |
---|
| 41 | if ( $conf['index_sort_order_input'] |
---|
| 42 | and count($page['items']) > 0) |
---|
| 43 | { |
---|
| 44 | $url = add_url_params($self_url, array('uc_image_order' => '')); |
---|
| 45 | |
---|
| 46 | foreach ($orders as $order_id => $order) |
---|
| 47 | { |
---|
| 48 | if ($order[2]) |
---|
| 49 | { |
---|
| 50 | $template->append( |
---|
| 51 | 'image_orders', |
---|
| 52 | array( |
---|
| 53 | 'DISPLAY' => $order[0], |
---|
| 54 | 'URL' => $url.$order_id, |
---|
| 55 | 'SELECTED' => ($image_order_id == $order_id ? true:false), |
---|
| 56 | ) |
---|
| 57 | ); |
---|
| 58 | } |
---|
| 59 | } |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | |
---|
[20090] | 63 | // navigation bar |
---|
| 64 | $page['start'] = isset($_GET['start']) ? $_GET['start'] : 0; |
---|
| 65 | if (count($page['items']) > $page['nb_image_page']) |
---|
| 66 | { |
---|
| 67 | $page['navigation_bar'] = create_navigation_bar( |
---|
| 68 | $self_url, |
---|
| 69 | count($page['items']), |
---|
| 70 | $page['start'], |
---|
| 71 | $page['nb_image_page'], |
---|
| 72 | false |
---|
| 73 | ); |
---|
| 74 | $template->assign('navbar', $page['navigation_bar']); |
---|
| 75 | } |
---|
| 76 | |
---|
[20097] | 77 | // add links for colorbox |
---|
| 78 | add_event_handler('loc_end_index_thumbnails', 'user_collections_thumbnails_in_collection', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
[20093] | 79 | |
---|
[20090] | 80 | include(PHPWG_ROOT_PATH . 'include/category_default.inc.php'); |
---|
| 81 | |
---|
| 82 | |
---|
[20093] | 83 | // multisize menu |
---|
| 84 | if ( !empty($page['items']) ) |
---|
[20090] | 85 | { |
---|
[20093] | 86 | $url = add_url_params($self_url, array('display' => '')); |
---|
| 87 | |
---|
| 88 | $selected_type = $template->get_template_vars('derivative_params')->type; |
---|
| 89 | $template->clear_assign( 'derivative_params' ); |
---|
| 90 | $type_map = ImageStdParams::get_defined_type_map(); |
---|
| 91 | unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]); |
---|
| 92 | |
---|
| 93 | foreach($type_map as $params) |
---|
| 94 | { |
---|
| 95 | $template->append( |
---|
| 96 | 'image_derivatives', |
---|
| 97 | array( |
---|
| 98 | 'DISPLAY' => l10n($params->type), |
---|
| 99 | 'URL' => $url.$params->type, |
---|
| 100 | 'SELECTED' => ($params->type == $selected_type ? true:false), |
---|
| 101 | ) |
---|
| 102 | ); |
---|
| 103 | } |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | // caddie link |
---|
| 108 | if (is_admin() and !empty($page['items'])) |
---|
| 109 | { |
---|
| 110 | $template->assign('U_CADDIE', |
---|
| 111 | add_url_params($self_url, array('uc_caddie'=>1) ) |
---|
[20090] | 112 | ); |
---|
| 113 | } |
---|
| 114 | |
---|
| 115 | ?> |
---|