You are here

function _media_sitemap_get_title in Media Sitemap 7

Custom function for getting the title of the Image.

1 call to _media_sitemap_get_title()
_media_sitemap_generate in ./media_sitemap.module
Custom function for generating the sitemap.

File

./media_sitemap.module, line 120
This module is used for creating XML sitemap of Image/Video for Google.

Code

function _media_sitemap_get_title($fid = "") {
  $table_exits = db_query("SHOW TABLES LIKE '%field_data_media_title%'")
    ->fetchObject();
  if (isset($table_exits) && !empty($table_exits)) {
    $result = db_query('SELECT mt.media_title_value FROM {field_data_media_title} mt WHERE mt.entity_id = :fid', array(
      ':fid' => $fid,
    ));
    $record = $result
      ->fetchObject();
    if (isset($record->media_title_value)) {
      return $record->media_title_value;
    }
  }
}