Changeset 11908


Ignore:
Timestamp:
2006-06-02T12:17:06+12:00 (18 years ago)
Author:
mdewsnip
Message:

Now handles the no_image.jpg file for the designer pages.

File:
1 edited

Legend:

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

    r11906 r11908  
    647647    my $place_construction_date_sql_handle = $dbh->prepare($place_construction_date_sql_statement);
    648648
     649    # Prepare SQL statement for getting the Place name
     650    my $place_name_sql_statement = "SELECT Current_name FROM tblPlace WHERE Entry_ID=?";
     651    my $place_name_sql_handle = $dbh->prepare($place_name_sql_statement);
     652
    649653    # Get a list of all the designers, and the places they worked on
    650654    my %designer_name_to_place_ids_mapping;
     
    692696
    693697        my $designer_place_image_name = $designer_place_image_match_hashref->{"FileName"};
    694         my $designer_place_image_small_file_name = $designer_place_image_name . "-small.jpg";
    695         $designer_place_image_small_file_name =~ s/ /%20/g;
    696         my $designer_place_image_small_file_link = "_httpcollection_/index/assoc/[assocfilepath]/$designer_place_image_small_file_name";
     698        my $designer_place_image_small_file_link;
     699        if (defined($designer_place_image_name)) {
     700            my $designer_place_image_small_file_name = $designer_place_image_name . "-small.jpg";
     701            $designer_place_image_small_file_name =~ s/ /%20/g;
     702            $designer_place_image_small_file_link = "_httpcollection_/index/assoc/[assocfilepath]/$designer_place_image_small_file_name";
     703        }
     704        else {
     705            # Get the name of this place (since we don't have a filename)
     706            $place_name_sql_handle->execute($designer_place_id) or die "Could not execute SQL statement.";
     707            $designer_place_image_name = $place_name_sql_handle->fetchrow() || "";
     708            $designer_place_image_small_file_link = "_httpcollection_/images/no_image.jpg";
     709        }
    697710        $designer_places_image_html .= "<tr><td valign=\"top\"><a href=\"_gwcgi_?a=d&d=p$designer_place_id\"><img src=\"$designer_place_image_small_file_link\"/></a></td><td valign=\"top\"><a href=\"_gwcgi_?a=d&d=p$designer_place_id\"><span class=\"cictext\">$designer_place_image_name</span></a><br /><b>Date of construction:</b> $designer_place_construction_date_value</td></tr>\n";
    698711        }
Note: See TracChangeset for help on using the changeset viewer.