You are here

function _xmlsitemap_user_priority in XML sitemap 5

Calculate the priority of a user profile.

Parameters

$user: A user object:

Return value

A number between 0 and 1, or -1

Related topics

2 calls to _xmlsitemap_user_priority()
hook_xmlsitemap_links in docs/xmlsitemap.php
Define additional links to add to the site map.
_xmlsitemap_user_links in xmlsitemap_user/xmlsitemap_user.module
Get user profile links.

File

xmlsitemap_user/xmlsitemap_user.module, line 84
Adds user profiles to the site map.

Code

function _xmlsitemap_user_priority($user) {
  $priority = $user->priority_override;
  if (!isset($user->priority_override)) {
    static $default;
    $default = isset($default) ? $default : variable_get('xmlsitemap_user_default_priority', 0.5);
    $user->priority = isset($user->priority) ? $user->priority : $default;
    $priority = min($user->priority, 0.9);
  }
  return $priority;
}