Changeset 2517
- Timestamp:
- Sep 11, 2008, 11:40:00 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_modify.php
r2490 r2517 275 275 if ($category['has_images']) 276 276 { 277 $template->assign( 'U_MANAGE_ELEMENTS', 278 $base_url.'element_set&cat='.$category['id'] 277 $template->assign( 278 'U_MANAGE_ELEMENTS', 279 $base_url.'element_set&cat='.$category['id'] 280 ); 281 $template->assign( 282 'U_MANAGE_RANKS', 283 $base_url.'element_set_ranks&cat_id='.$category['id'] 279 284 ); 280 285 } … … 314 319 'file' => l10n('File name'), 315 320 'id' => 'Id', 321 'rank' => l10n('Rank'), 316 322 ); 317 323 -
trunk/admin/template/yoga/admin/cat_modify.tpl
r2490 r2517 10 10 {if isset($U_MANAGE_ELEMENTS) } 11 11 <li><a href="{$U_MANAGE_ELEMENTS}" title="{'manage category elements'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/category_elements.png" class="button" alt="{'elements'|@translate}" /></a></li> 12 <li><a href="{$U_MANAGE_RANKS}" title="{'manage element ranks'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/ranks.png" class="button" alt="{'ranks'|@translate}" /></a></li> 12 13 {/if} 13 14 <li><a href="{$U_CHILDREN}" title="{'manage sub-categories'|@translate}"><img src="{$ROOT_URL}{$themeconf.icon_dir}/category_children.png" class="button" alt="{'sub-categories'|@translate}" /></a></li> -
trunk/include/config_default.inc.php
r2516 r2517 63 63 // the date_available 64 64 $conf['order_by'] = ' ORDER BY date_available DESC, file ASC, id ASC'; 65 66 // order_by_inside_category : inside a category, images can also be ordered 67 // by rank. A manually defined rank on each image for the category. 68 // 69 // In addition to fields of #images table, you can use the 70 // #image_category.rank column 71 // 72 // $conf['order_by_inside_category'] = ' ORDER BY rank'; 73 // will sort images by the manually defined rank of images in this category. 74 $conf['order_by_inside_category'] = $conf['order_by']; 65 75 66 76 // file_ext : file extensions (case sensitive) authorized -
trunk/include/functions_category.inc.php
r2433 r2517 258 258 function get_category_preferred_image_orders() 259 259 { 260 global $conf; 260 global $conf, $page; 261 261 262 return array( 262 263 array(l10n('default_sort'), '', true), … … 265 266 array(l10n('Creation date'), 'date_creation DESC', true), 266 267 array(l10n('Post date'), 'date_available DESC', true), 267 array(l10n('File name'), 'file ASC', true) 268 ); 268 array(l10n('File name'), 'file ASC', true), 269 array( 270 l10n('Rank'), 271 'rank ASC', 272 ('categories' == $page['section'] and !isset($page['flat'])) 273 ) 274 ); 269 275 } 270 276 -
trunk/include/section_init.inc.php
r2451 r2517 173 173 $page['nb_image_page'] = $user['nb_image_page']; 174 174 175 // if flat mode is active, we must consider the image set as a standard set 176 // and not as a category set because we can't use the #image_category.rank : 177 // displayed images are not directly linked to the displayed category 178 if ('categories' == $page['section'] and !isset($page['flat'])) 179 { 180 $conf['order_by'] = $conf['order_by_inside_category']; 181 } 182 175 183 if (pwg_get_session_var('image_order',0) > 0) 176 184 { 185 $image_order_id = pwg_get_session_var('image_order'); 186 177 187 $orders = get_category_preferred_image_orders(); 178 188 179 $conf['order_by'] = str_replace( 180 'ORDER BY ', 181 'ORDER BY '.$orders[ pwg_get_session_var('image_order',0) ][1].',', 182 $conf['order_by'] 189 // the current session stored image_order might be not compatible with 190 // current image set, for example if the current image_order is the rank 191 // and that we are displaying images related to a tag. 192 // 193 // In case of incompatibility, the session stored image_order is removed. 194 if ($orders[$image_order_id][2]) 195 { 196 $conf['order_by'] = str_replace( 197 'ORDER BY ', 198 'ORDER BY '.$orders[$image_order_id][1].',', 199 $conf['order_by'] 183 200 ); 184 $page['super_order_by'] = true; 201 $page['super_order_by'] = true; 202 203 } 204 else 205 { 206 pwg_unset_session_var('image_order'); 207 $page['super_order_by'] = false; 208 } 185 209 } 186 210 -
trunk/index.php
r2488 r2517 261 261 262 262 $orders = get_category_preferred_image_orders(); 263 for ($i = 0; $i < count($orders); $i++)264 { 265 if ($order s[$i][2])263 foreach ($orders as $order_id => $order) 264 { 265 if ($order[2]) 266 266 { 267 267 $template->append( 268 268 'image_orders', 269 269 array( 270 'DISPLAY' => $orders[$i][0], 271 'URL' => add_url_params( duplicate_index_url(), array('image_order'=>$i) ), 272 'SELECTED' => ($order_idx==$i ? true:false), 270 'DISPLAY' => $order[0], 271 'URL' => add_url_params( 272 duplicate_index_url(), 273 array('image_order' => $order_id) 274 ), 275 'SELECTED' => ($order_idx == $order_id ? true:false), 273 276 ) 274 277 ); -
trunk/install/piwigo_structure.sql
r2448 r2517 151 151 `image_id` mediumint(8) unsigned NOT NULL default '0', 152 152 `category_id` smallint(5) unsigned NOT NULL default '0', 153 `rank` mediumint(8) unsigned default NULL, 153 154 PRIMARY KEY (`image_id`,`category_id`), 154 155 KEY `image_category_i1` (`category_id`)
Note: See TracChangeset
for help on using the changeset viewer.