xmlsitemap_file_create_url

Definition

xmlsitemap_file_create_url($path, $alias = NULL)
contributions/modules/xmlsitemap/xmlsitemap.module, line 354

Description

Modified version of file_create_url(). Allows us to remove language prefixes.

Parameters

$path: the path to the file

Return value

A URL to the file

Related topics

Namesort iconDescription
XML SitemapNotify search engines of site updates.

Code

function xmlsitemap_file_create_url($path, $alias = NULL) {
  $path = trim(substr($path, strlen(file_directory_path())), '\\/');
  if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PRIVATE) {
    return xmlsitemap_url('system/files/'. $path, $alias, NULL, NULL, TRUE);
  }
  else {
    return "$GLOBALS[base_url]/". file_directory_path() .'/'. str_replace('\\', '/', $path);
  }
}