Changeset 12396


Ignore:
Timestamp:
2006-08-03T16:39:13+12:00 (18 years ago)
Author:
mdewsnip
Message:

Now uses the Image_Order field of tblImages to sort the place images, and no longer assigns the same place multiple times to a designer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cic-hcap/perllib/plugins/CICPlug.pm

    r12233 r12396  
    336336    $institution_best_place_image_location_sql_handle->{LongReadLen} = 65536;
    337337
    338     # Prepare SQL statement for getting the Institution places images
     338    # Prepare SQL statement for getting the Institution places images (only used to check if an institution has some images)
    339339    my $institution_places_images_sql_statement = "SELECT FileName FROM tblImages,tblPlace WHERE tblImages.FileType=1 AND tblImages.Entry_ID=tblPlace.Entry_ID AND tblPlace.Institution_ID=?";
    340340    my $institution_places_images_sql_handle = $dbh->prepare($institution_places_images_sql_statement);
     
    511511
    512512    # Prepare SQL statement for getting the Place images
    513     my $place_images_sql_statement = "SELECT FileName,Location FROM tblImages WHERE FileType=1 AND Entry_ID=?";
     513    my $place_images_sql_statement = "SELECT FileName,Location FROM tblImages WHERE FileType=1 AND Entry_ID=? ORDER BY Image_Order";
    514514    my $place_images_sql_handle = $dbh->prepare($place_images_sql_statement);
    515515    $place_images_sql_handle->{LongReadLen} = 65536;
     
    888888
    889889    # Prepare SQL statement for getting the Place non-PDF images
    890     my $place_images_sql_statement = "SELECT Location FROM tblImages WHERE FileType=1 AND Location NOT LIKE '%.pdf' AND Entry_ID=?";
     890    my $place_images_sql_statement = "SELECT Location FROM tblImages WHERE FileType=1 AND Location NOT LIKE '%.pdf' AND Entry_ID=? ORDER BY Image_Order";
    891891    my $place_images_sql_handle = $dbh->prepare($place_images_sql_statement);
    892892    $place_images_sql_handle->{LongReadLen} = 65536;
     
    905905    # Get designer places
    906906    my $designer_places_list_html = "";
    907         foreach my $designer_place_id (@{$designer_name_to_place_ids_mapping{$designer_name}}) {
     907    my $last_designer_place_id = "";
     908        foreach my $designer_place_id (sort(@{$designer_name_to_place_ids_mapping{$designer_name}})) {
     909        # The designer may have worked on a place multiple times, so check for this
     910        next if ($designer_place_id eq $last_designer_place_id);
     911        $last_designer_place_id = $designer_place_id;
     912
    908913        # Get place name
    909914        $place_name_sql_handle->execute($designer_place_id) or die "Could not execute SQL statement.";
Note: See TracChangeset for help on using the changeset viewer.