/** 
 * Returns page_alias of valid [friendly] position 
 * 
 * @param string $params['friendly_position'] Mandatory. 
 * @param string $params['assign']
 */
 
$return = FALSE;
if (!empty($params[friendly_position])) {
    $delim                   = '.';
    $hierarchy_array         = array();
    $friendly_position_array = explode($delim, $params['friendly_position']);
    foreach ($friendly_position_array as $one) {
        $hierarchy_array[] = str_pad($one, 5, '0', STR_PAD_LEFT);
    }
    $hierarchy = implode($delim, $hierarchy_array);
    
    $query  = 'SELECT content_alias FROM ' . cms_db_prefix() . 'content WHERE hierarchy = ?';
    $db     = cmsms()->GetDB();
    $return = $db->GetOne($query, array(
        $hierarchy
    ));
}
if (!empty($params['assign'])) {
    $smarty = cmsms()->GetSmarty();
    $smarty->assign($params['assign'], $return);
} else {
    return $return;
}