You are here

function _homebox_get_profile_safe_name in Homebox 6

Helper function to return a named profile from an $pid

1 call to _homebox_get_profile_safe_name()
_homebox_user_access_current_homebox in ./homebox.module
Helper function to check access to current homebox

File

./homebox.module, line 840
Home box main file, takes care of global functions settings constants, etc.

Code

function _homebox_get_profile_safe_name($pid) {
  $page = db_fetch_object(db_query('SELECT * FROM {homebox_pages} WHERE pid = %d', $pid));
  if (is_object($page) && $page->name != '' && $pid == $page->pid) {
    $filter = '![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s';
    $page->safe_name = preg_replace($filter, '-', drupal_strtolower($page->name));
    return $page->safe_name;
  }
  return FALSE;
}