$width_to_height = $actual_width / $actual_height; if ($actual_width <= PRODUCT_IMAGE_SIZE && $actual_height <= PRODUCT_IMAGE_SIZE) { $stretch_text = '<br>SMALL<br>IMAGE<br>IS<br>STRETCHED<br>TO<br>FIT'; } else { $stretch_text = ''; } if ($width_to_height < 1) { $size_style = 'height:' . PRODUCT_IMAGE_SIZE . 'px;'; } else { $size_style = 'width:' . PRODUCT_IMAGE_SIZE . 'px;'; } if ($add_this_first++ < 1) { $page_content .= ' <h3>Information for image #' . $image_id . '</h3> <div class="gallery_image_large"> <img src="' . get_image_path_by_id($image_id) . '"> <div id="small_size_message">' . $stretch_text . '</div> </div> <div class="image_info"> <fieldset class="image_fields"> <form id="image_data" action="' . $_SERVER['SCRIPT_NAME'] . '" method="post"> <input id="save_button" name="post_action" type="submit" value="Save"> <input type="hidden" name="action" value="edit_image"> <input type="hidden" name="image_id" value="' . $row['image_id'] . '"> ' . ($row['width'] != $actual_width ? '<input type="hidden" name="width" value="' . $actual_width . '">' : '') . ' ' . ($row['height'] != $actual_height ? '<input type="hidden" name="height" value="' . $actual_height . '">' : '') . ' <label for="title">Title (For organizing images)</label> <input type="text" id="title" name="title" value="' . $row['title'] . '"> <label for="caption">Caption</label> <input type="text" id="caption" name="caption" value="' . $row['caption'] . '"> </form>
function image_display_calc($data) { return $data['image_id'] ? '<img src="' . get_image_path_by_id($data['image_id']) . '" class="product_image">' : ''; }
function image_display_calc($data) { return $data['image_id'] ? '<img src="' . get_image_path_by_id($data['image_id']) . '" width="100" name="img' . $data['image_id'] . '" onclick="javascript:img' . $data['image_id'] . '.width=300" onMouseOut="javascript:img' . $data['image_id'] . '.width=100" hspace="5" border="1" align="left" alt="Click to enlarge ' . htmlentities($data['product_name'], ENT_QUOTES) . '">' : ''; }