Commit 21dbb970 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Fix issue where listing image from previous entries repeated on items with no images

parent 39827ef0
......@@ -385,10 +385,6 @@ function uw_ct_event_block_view($delta = '') {
if ($theme_key == 'uw_fdsu_theme_resp') {
$node = node_load($record->nid);
if (!empty($node->field_event_image[LANGUAGE_NONE][0]['uri'])) {
$listing_image = $node->field_event_image[LANGUAGE_NONE][0]['uri'];
}
if(!empty($node->body['en'][0]['summary'])) {
$summary = $node->body['en'][0]['summary'];
}
......@@ -402,13 +398,13 @@ function uw_ct_event_block_view($delta = '') {
$summary = check_markup(preg_replace(',<(/?)h\d,', '<$1p', $summary), 'uw_tf_basic');
$summary = _filter_htmlcorrector($summary);
$summary = preg_replace("/<img[^>]+\>/i", "", $summary);
if (isset($listing_image)) {
$items[$count] .= '<span class="home-listing-block-summary">';
if (!empty($node->field_event_image[LANGUAGE_NONE][0]['uri'])) {
$listing_image = $node->field_event_image[LANGUAGE_NONE][0]['uri'];
$themed_image = '<img alt="' . $node->field_event_image[LANGUAGE_NONE][0]['alt'] . '" src="' . file_create_url($listing_image) . '" typeof="foaf:Image">';
$items[$count] .= '<span class="home-listing-block-summary">' . $themed_image . $summary . '</span>';
}
else {
$items[$count] .= '<span class="home-listing-block-summary">' . $summary . '</span>';
$items[$count] .= $themed_image;
}
$items[$count] .= $summary . '</span>';
}
$count++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment