Example #1
0
             }
             $keywords = trim(implode(',', $_iptc_keywords));
             $keywords = preg_replace("/[\n\r]/is", ",", $keywords);
             $keywords_arr = explode(',', $keywords);
             array_walk($keywords_arr, 'trim_value');
             $keywords = implode(',', array_unique(array_filter($keywords_arr)));
         }
     }
     show_textarea_row($title, "image_keywords_" . $i, $keywords, $textarea_size);
     if (isset($error['cat_id_' . $i])) {
         $title = sprintf("<span class=\"marktext\">%s *</span>", $lang['field_category']);
     } else {
         $title = $lang['field_category'];
     }
     echo "<tr class=\"" . get_row_bg() . "\">\n<td><p class=\"rowtitle\">" . $title . "</p></td>\n<td>" . get_category_dropdown($cat_id, 0, 3, $i) . "</td>\n</tr>\n";
     show_user_select_row($lang['user'], $user_id, $i);
     if (is_array($iptc) && $iptc_date) {
         $date = isset($iptc['2#055'][0]) ? preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $iptc['2#055'][0]) : $date;
     }
     $title = $lang['field_date'] . $lang['date_desc'] . $lang['date_format'] . (isset($file_src) ? get_iptc_insert_link($file_src, "date_created", "image_date_" . $i, 0) : "");
     show_input_row($title, "image_date_" . $i, $date, $textinput_size);
     show_hidden_input("old_cat_id_" . $i, $cat_id);
     show_radio_row($lang['field_free'], "image_active_" . $i, 1);
     show_radio_row($lang['field_allow_comments'], "image_allow_comments_" . $i, 1);
     show_additional_fields("image", array(), IMAGES_TABLE, $i);
 } else {
     echo "<tr class=" . get_row_bg() . ">\n";
     echo "<td><input type=\"checkbox\" name=\"addimage_" . $i . "\" value=\"1\"{$checked}></td>\n";
     $link = "<a href=\"" . MEDIA_PATH . $cat_path . "/" . $file . "\" target=\"_blank\">" . $file . "</a>";
     show_hidden_input("image_media_file_" . $i, $file);
     if ($thumb_file) {
Example #2
0
    show_upload_row($lang['image_file'], "file", "<br /><span class=\"smalltext\">" . $lang['allowed_mediatypes_desc'] . str_replace(",", ", ", $config['allowed_mediatypes']) . "</span>", $value);
    if (!empty($image_row['image_thumb_file'])) {
        $thumb_src = get_file_path($image_row['image_thumb_file'], "thumb", 0, 1);
        show_image_row($lang['thumb'] . "<br /><span class=\"smalltext\">(" . $image_row['image_thumb_file'] . ")</span>", $thumb_src, 1, "delete_thumb_file");
    } else {
        $file_type = get_file_extension($image_row['image_media_file']);
        show_image_row($lang['thumb'] . "<br /><span class=smalltext>(" . $lang['no_thumb_found'] . ")</span>", ICON_PATH . "/" . $file_type . ".gif", 1);
    }
    $value = is_remote($image_row['image_thumb_file']) || is_local_file($image_row['image_thumb_file']) ? $image_row['image_thumb_file'] : "";
    show_upload_row($lang['thumb_file'], "thumb_file", "<br /><span class=\"smalltext\">" . $lang['allowed_mediatypes_desc'] . " jpg, gif, png</span>", $value);
    show_input_row($lang['field_download_url'] . $lang['download_url_desc'], "image_download_url", "", $textinput_size);
    show_input_row($lang['field_image_name'], "image_name", $image_row['image_name'], $textinput_size);
    show_textarea_row($lang['field_description_ext'], "image_description", $image_row['image_description'], $textarea_size);
    show_textarea_row($lang['field_keywords_ext'], "image_keywords", $image_row['image_keywords'], $textarea_size);
    show_cat_select_row($lang['field_category'], $image_row['cat_id'], 3);
    show_user_select_row($lang['user'], $image_row['user_id']);
    show_input_row($lang['field_date'] . $lang['date_desc'], "image_date", $image_row['image_date'], $textinput_size);
    show_additional_fields("image", $image_row, IMAGES_TEMP_TABLE);
    show_form_footer($lang['save_changes'], $lang['reset'], 2, "", " onClick='showProgress()'");
}
if ($action == "saveimages") {
    $image_list = isset($HTTP_POST_VARS['image_list']) ? $HTTP_POST_VARS['image_list'] : "";
    if (!empty($image_list)) {
        $image_id_sql = "";
        foreach ($image_list as $key => $val) {
            $image_id_sql .= ($image_id_sql != "" ? ", " : "") . $key;
        }
        $sql = "SELECT *\n            FROM " . IMAGES_TEMP_TABLE . "\n            WHERE image_id IN({$image_id_sql})";
        $result = $site_db->query($sql);
        $image_cache = array();
        while ($row = $site_db->fetch_array($result)) {