1
Mods & Plugins (Requests & Discussions) / Little MOD insert Date Time Original from EXIF
« on: January 11, 2008, 07:58:05 PM »
I search for a long time this little mod without result...
Now i write by myself and I' m happy to share with you!
open admin_functions.php and add to the top this code:
open image.php search:
and replace with:
Now you can insert the image original date creation when a image is edited ...
Now i write by myself and I' m happy to share with you!
open admin_functions.php and add to the top this code:
Code: [Select]
// ***[Little MOD insert Date Time Original from EXIF ] ***
function get_exif_insert_originaldatetime($file, $input, $add_text = 1) {
$exif = read_exif_data($file);
ereg("([0-9]{4}):([0-9]{2}):([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2})", $exif["DateTimeOriginal"], $exif_data_created);
$value = $exif_data_created[1].'-'.$exif_data_created[2].'-'.$exif_data_created[3].' '.$exif_data_created[4].':'.$exif_data_created[5].':'.$exif_data_created[6];
if (!empty($value)) {
$html = "\n<input type=\"hidden\" name=\"hidden_".$input."\" value=\"".trim($value)."\">\n";
$html .= "<script language=\"javascript\">\n<!--\n";
$html .= "this.document.writeln('<br /><br /><input type=\"button\" value=\"EXIF Date Time Original »: $value \" onClick=\"this.form.".$input.".value=".(($add_text) ? "this.form.".$input.".value + " : "")."this.form.hidden_".$input.".value\"> <br /><br />');";
$html .= "\n//-->\n</script>\n";
return $html;
}
}
open image.php search:
Code: [Select]
$title = $lang['field_date'].$lang['date_desc'].$lang['date_format'].((isset($file_src)) ? get_iptc_insert_link($file_src, "date_created", "image_date", 0) : "");
and replace with:
Code: [Select]
// $title = $lang['field_date'].$lang['date_desc'].$lang['date_format'].((isset($file_src)) ? get_iptc_insert_link($file_src, "date_created", "image_date", 0) : "");
// ***[MOD insert Date Time Original from EXIF ] ***
$title = $lang['field_date'].$lang['date_desc'].$lang['date_format'].((isset($file_src)) ? get_exif_insert_originaldatetime($file_src,"image_date", 0) : "");
Now you can insert the image original date creation when a image is edited ...