$value) { $col++; // put spacer content between images if($col > 1) { $image['tmpl_images'][$x] .= $image['tmpl_entry_space']; } else { $image['tmpl_images'][$x] = ''; } $thumb_image = get_cached_image( array( "target_ext" => $image['images'][$key][3], "image_name" => $image['images'][$key][2] . '.' . $image['images'][$key][3], "max_width" => $image['images'][$key][4], "max_height" => $image['images'][$key][5], "thumb_name" => md5( $image['images'][$key][2].$image['images'][$key][4]. $image['images'][$key][5].$phpwcms["sharpen_level"]. $image['crop'] ), 'crop_image' => $image['crop'] ) ); if($image['zoom']) { $zoominfo = get_cached_image( array( "target_ext" => $image['images'][$key][3], "image_name" => $image['images'][$key][2] . '.' . $image['images'][$key][3], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5( $image['images'][$key][2].$phpwcms["img_prev_width"]. $phpwcms["img_prev_height"].$phpwcms["sharpen_level"] ) ) ); } // now try to build caption and if neccessary add alt to image or set external link for image $caption = getImageCaption($image['images'][$key][6]); // set caption and ALT Image Text for imagelist $capt_cur = html_specialchars($caption[0]); $caption[3] = empty($caption[3]) ? '' : ' title="'.html_specialchars($caption[3]).'"'; //title $caption[1] = html_specialchars(empty($caption[1]) ? $image['images'][$key][1] : $caption[1]); $list_img_temp = ''.$caption[1].''; $img_a = ''; if($image['zoom'] && isset($zoominfo) && $zoominfo != false) { // if click enlarge the image $open_popup_link = 'image_zoom.php?'.getClickZoomImageParameter($zoominfo[0].'?'.$zoominfo[3]); if($caption[2][0]) { $open_link = $caption[2][0]; $return_false = ''; } else { $open_link = $open_popup_link; $return_false = 'return false;'; } if(!$image['lightbox'] || $caption[2][0]) { $img_a .= ''; } else { // lightbox $img_a .= ''; } $img_a .= $list_img_temp.''; $img_zoom_name = $zoominfo[0]; $img_zoom_rel = PHPWCMS_IMAGES.$zoominfo[0]; $img_zoom_abs = PHPWCMS_URL.PHPWCMS_IMAGES.$zoominfo[0]; $img_zoom_width = $zoominfo[1]; $img_zoom_height = $zoominfo[2]; } else { // if not click enlarge if($caption[2][0]) { $img_a .= ''.$list_img_temp.''; } else { $img_a .= $list_img_temp; } $img_zoom_name = ''; $img_zoom_rel = ''; $img_zoom_abs = ''; $img_zoom_width = 0; $img_zoom_height = 0; } $img_a = str_replace('{IMAGE}', $img_a, $image['tmpl_entry']); $img_a = str_replace('{IMGID}', $image['images'][$key][0], $img_a); $img_a = str_replace('{IMAGE_ID}', $image['images'][$key][0], $img_a); $img_a = str_replace('{IMAGE_HASH}', $image['images'][$key][2], $img_a); $img_a = str_replace('{IMGNAME}', html_specialchars($image['images'][$key][1]), $img_a); // replace thumbnail and zoom image information $img_a = str_replace('{THUMB_NAME}', $img_thumb_name, $img_a); $img_a = str_replace('{THUMB_REL}', $img_thumb_rel, $img_a); $img_a = str_replace('{THUMB_ABS}', $img_thumb_abs, $img_a); $img_a = str_replace('{THUMB_WIDTH}', $img_thumb_width, $img_a); $img_a = str_replace('{THUMB_HEIGHT}', $img_thumb_height, $img_a); $image['tmpl_thumb_width_max'] = max($image['tmpl_thumb_width_max'], $img_thumb_width); $image['tmpl_thumb_height_max'] = max($image['tmpl_thumb_height_max'], $img_thumb_height); $img_a = str_replace('{IMAGE_NAME}', $img_zoom_name, $img_a); $img_a = str_replace('{IMAGE_REL}', $img_zoom_rel, $img_a); $img_a = str_replace('{IMAGE_ABS}', $img_zoom_abs, $img_a); $img_a = str_replace('{IMAGE_WIDTH}', $img_zoom_width, $img_a); $img_a = str_replace('{IMAGE_HEIGHT}', $img_zoom_height, $img_a); $img_a = render_cnt_template($img_a, 'ZOOM', ($img_zoom_name ? '' : '') ); $img_a = render_cnt_template($img_a, 'COPYRIGHT', $caption[4] ); if($image['nocaption']) { $img_a = render_cnt_template($img_a, 'CAPTION_ELSE', ''); $img_a = render_cnt_template($img_a, 'CAPTION', ''); } else { $img_a = render_cnt_template($img_a, 'CAPTION', $capt_cur); } $image['tmpl_images'][$x] .= $img_a; // check if this is the last image in row if($image['col'] == $col) { $x++; $col = 0; } } $image['template'] .= implode($image['tmpl_row_space'], $image['tmpl_images']); } $image['template'] .= $image['tmpl_footer']; // now do main replacements $image['template'] = str_replace('{ID}', $crow['acontent_id'], $image['template']); $image['template'] = str_replace('{SPACE}', $image['space'], $image['template']); $image['template'] = str_replace('{THUMB_WIDTH_MAX}', $image['tmpl_thumb_width_max'], $image['template']); $image['template'] = str_replace('{THUMB_HEIGHT_MAX}', $image['tmpl_thumb_height_max'], $image['template']); $image['template'] = str_replace('{THUMB_COLUMNS}', $image['col'], $image['template']); $image['template'] = render_cnt_template($image['template'], 'TITLE', html_specialchars($crow['acontent_title'])); $image['template'] = render_cnt_template($image['template'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle'])); $image['template'] = render_cnt_template($image['template'], 'TEXT', $crow['acontent_text']); $CNT_TMP .= $image['template']; } unset($image); ?>