$value) { if ($imgx) $img_sql .= " OR "; $img_sql .= "f_id=" . intval($value); $imgx++; } if(!$imgx) { $img_sql .= "0"; } $img_sql .= ")"; // check for image information and get alle infos from file if ($img_result = mysql_query($img_sql, $db) or die("error while getting content image only info")) { // Gegenrechnen von Breite zu Anzahl Spalten und Bildabstand //$temp_count_img = mysql_num_rows($img_result); $temp_count_img = $imgx; $content["image_col"] = ($content["image_col"] > $temp_count_img) ? $temp_count_img : $content["image_col"]; $temp_img_maxwidth = $phpwcms["content_width"] - (($content["image_col"] - 1) * $content["image_space"]); $temp_img_maxwidth = ($content["image_pos"] == 6 || $content["image_pos"] == 7) ? intval($temp_img_maxwidth / 1.75) : $temp_img_maxwidth; $temp_img_maxwidth = intval($temp_img_maxwidth / $content["image_col"]); if (($content["image_width"] > $temp_img_maxwidth) || ($content["image_width"] == "")) { $content["image_width"] = $temp_img_maxwidth; $temp_width = $content["image_width"]; } $imgx = 0; // try to handle multiple same image IDs $temp_img_row = array(); while ($img_row = mysql_fetch_assoc($img_result)) { $temp_img_row[$img_row['f_id']] = $img_row; } mysql_free_result($img_result); foreach($content["image_list"] as $key => $value) { if(isset($temp_img_row[$value])) { $content['tmp_images'][$key][0] = $temp_img_row[$value]['f_id']; $content['tmp_images'][$key][1] = $temp_img_row[$value]['f_name']; $content['tmp_images'][$key][2] = $temp_img_row[$value]['f_hash']; $content['tmp_images'][$key][3] = $temp_img_row[$value]['f_ext']; $content['tmp_images'][$key][4] = $temp_width; $content['tmp_images'][$key][5] = $temp_height; $content['tmp_images'][$key][6] = isset($content["image_cctext"][$key]) ? trim($content["image_cctext"][$key]) : ''; } } } } // take values $content['image_list'] = array(); $content['image_list']['images'] = $content['tmp_images']; $content['image_list']['width'] = $temp_width; $content['image_list']['height'] = $temp_height; $content['image_list']['pos'] = $content["image_pos"]; $content['image_list']['col'] = $content["image_col"]; $content['image_list']['zoom'] = $content["image_zoom"]; $content['image_list']['space'] = $content["image_space"]; $content['image_list']['lightbox'] = empty($_POST["cimage_lightbox"]) ? 0 : 1; $content['image_list']['nocaption'] = empty($_POST["cimage_nocaption"]) ? 0 : 1; $content['image_list']['crop'] = empty($_POST["cimage_crop"]) ? 0 : 1; $content["image_list"]['random'] = empty($_POST["cimage_random"]) ? 0 : 1; ?>