Changeset 1020 for trunk/category.php


Ignore:
Timestamp:
Feb 1, 2006, 3:46:26 AM (18 years ago)
Author:
rvelices
Message:

feature 280: Allow visitors/users to choose image ordering inside a category

improvement 82: Viewing pictures from remote galleries does not check anymore
for the high pictures (existence flag added to create_listing_file and db)

correction: link element in picture is in the head instead of body (w3c spec)

correction: in profile.php the current template was not selected by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/category.php

    r1015 r1020  
    407407      );
    408408  }
     409  if ($page['cat_nb_images']>0 and
     410       $page['cat'] != 'most_visited' and $page['cat'] != 'best_rated')
     411  {
     412    // image order
     413    $template->assign_block_vars( 'preferred_image_order', array() );
     414 
     415    if ( isset($_GET['image_order']) )
     416    {
     417      $order_idx = $_GET['image_order'];
     418    }
     419    else
     420    {
     421      $order_idx = isset($_COOKIE['pwg_image_order']) ?
     422                     $_COOKIE['pwg_image_order'] : 0;
     423    }
     424 
     425    $orders = get_category_preferred_image_orders();
     426    for ( $i = 0; $i < count($orders); $i++)
     427    {
     428      if ($orders[$i][2])
     429      {
     430        $url = PHPWG_ROOT_PATH.'category.php'
     431                 .get_query_string_diff(array('image_order'));
     432        $url .= '&amp;image_order='.$i;
     433        $template->assign_block_vars( 'preferred_image_order.order', array(
     434          'DISPLAY' => $orders[$i][0],
     435          'URL' => $url,
     436          'SELECTED_OPTION' => ($order_idx==$i ? 'SELECTED' : '' ),
     437          ) );
     438      }
     439    }
     440  }
    409441}
    410442//------------------------------------------------------------ log informations
Note: See TracChangeset for help on using the changeset viewer.