Пример #1
0
 /**
  * Maybe import some meta data to the database. The functions checks the flag 'saved'
  * and if based on compat reason (pre V1.4.0) we save then some meta datas to the database
  * 
  * @since V1.4.0
  * @param int $id
  * @return result
  */
 function maybe_import_meta($id)
 {
     require_once NGGALLERY_ABSPATH . '/lib/meta.php';
     $meta_obj = new nggMeta($id);
     if ($meta_obj->image->meta_data['saved'] != true) {
         $common = $meta_obj->get_common_meta();
         //this flag will inform us that the import is already one time performed
         $common['saved'] = true;
         $result = nggdb::update_image_meta($id, $common);
     } else {
         return false;
     }
     return $result;
 }
Пример #2
0
 /**
  * nggAdmin::get_MetaData()
  * 
  * @class nggAdmin
  * @require NextGEN Meta class
  * @param int $id image ID
  * @return array metadata
  */
 function get_MetaData($id)
 {
     require_once NGGALLERY_ABSPATH . '/lib/meta.php';
     $meta = array();
     $pdata = new nggMeta($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;
 }