1 | <?php |
---|
2 | defined('USER_COLLEC_PATH') or die('Hacking attempt!'); |
---|
3 | |
---|
4 | |
---|
5 | // caddie |
---|
6 | if (isset($_GET['uc_caddie'])) |
---|
7 | { |
---|
8 | fill_caddie($page['items']); |
---|
9 | redirect($self_url); |
---|
10 | } |
---|
11 | |
---|
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); |
---|
24 | } |
---|
25 | |
---|
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 | |
---|
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 | |
---|
77 | |
---|
78 | // display |
---|
79 | if (defined('USER_COLLEC_REMOVE_GTHUMB')) |
---|
80 | { |
---|
81 | global $uc_nb_image_page_save; |
---|
82 | |
---|
83 | $user['nb_image_page'] = $uc_nb_image_page_save['user']; |
---|
84 | $page['nb_image_page'] = $uc_nb_image_page_save['page']; |
---|
85 | remove_event_handler('loc_end_index_thumbnails', 'process_GThumb', 50); |
---|
86 | remove_event_handler('loc_end_index', 'GThumb_remove_thumb_size'); |
---|
87 | } |
---|
88 | |
---|
89 | include(PHPWG_ROOT_PATH . 'include/category_default.inc.php'); |
---|
90 | |
---|
91 | |
---|
92 | // multisize menu |
---|
93 | if ( !empty($page['items']) ) |
---|
94 | { |
---|
95 | $url = add_url_params($self_url, array('display' => '')); |
---|
96 | |
---|
97 | $selected_type = $template->get_template_vars('derivative_params')->type; |
---|
98 | $template->clear_assign( 'derivative_params' ); |
---|
99 | $type_map = ImageStdParams::get_defined_type_map(); |
---|
100 | unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]); |
---|
101 | |
---|
102 | foreach($type_map as $params) |
---|
103 | { |
---|
104 | $template->append( |
---|
105 | 'image_derivatives', |
---|
106 | array( |
---|
107 | 'DISPLAY' => l10n($params->type), |
---|
108 | 'URL' => $url.$params->type, |
---|
109 | 'SELECTED' => ($params->type == $selected_type ? true:false), |
---|
110 | ) |
---|
111 | ); |
---|
112 | } |
---|
113 | } |
---|
114 | |
---|
115 | |
---|
116 | // caddie link |
---|
117 | if (is_admin() and !empty($page['items'])) |
---|
118 | { |
---|
119 | $template->assign('U_CADDIE', |
---|
120 | add_url_params($self_url, array('uc_caddie'=>1) ) |
---|
121 | ); |
---|
122 | } |
---|
123 | |
---|
124 | ?> |
---|