/** * flag_import_date_time() - Read the timestamp from exif and insert it into the database * * @return void */ function flag_import_date_time() { global $wpdb; $imagelist = $wpdb->get_results("SELECT t.*, tt.* FROM {$wpdb->flaggallery} AS t INNER JOIN {$wpdb->flagpictures} AS tt ON t.gid = tt.galleryid ORDER BY tt.pid ASC"); if (is_array($imagelist)) { foreach ($imagelist as $image) { $picture = new flagImage($image); $meta = new flagMeta($picture->imagePath, true); $date = $meta->get_date_time(); $wpdb->query($wpdb->prepare("UPDATE {$wpdb->flagpictures} SET imagedate = '%s' WHERE pid = '%d'", $date, $picture->pid)); } } }
/** * flagAdmin::get_MetaData() * * @class flagAdmin * @require Meta class * @param $id * @return array metadata */ function get_MetaData($id) { require_once FLAG_ABSPATH . 'lib/meta.php'; $meta = array(); $pdata = new flagMeta($id); $meta['title'] = trim($pdata->get_META('title')); $meta['caption'] = trim($pdata->get_META('caption')); $meta['keywords'] = trim($pdata->get_META('keywords')); $meta['timestamp'] = $pdata->get_date_time(); // this contain other useful meta information $meta['common'] = $pdata->get_common_meta(); return $meta; }
<?php if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You are not allowed to call this page directly.'); } $meta = new flagMeta($image->pid); $dbdata = $meta->get_saved_meta(); $exifdata = $meta->get_EXIF(); $iptcdata = $meta->get_IPTC(); $xmpdata = $meta->get_XMP(); $alttext = trim($meta->get_META('title')); $description = trim($meta->get_META('caption')); $timestamp = $meta->get_date_time(); $makedescription = '<b>' . __('Meta Data', 'flash-album-gallery') . "</b><br>"; if ($dbdata) { foreach ($dbdata as $key => $value) { if (is_array($value)) { continue; } $makedescription .= '<b>' . $meta->i8n_name($key) . "</b> " . $value . "<br>"; } } else { $makedescription .= __('No meta data saved', 'flash-album-gallery') . "<br>"; } if ($exifdata) { $makedescription .= "\n<b>" . __('EXIF Data', 'flash-album-gallery') . "</b><br>"; foreach ($exifdata as $key => $value) { $makedescription .= '<b>' . $meta->i8n_name($key) . "</b> " . $value . "<br>"; } } if ($iptcdata) {