Advertisement
someinternetuser

PHP new function

Oct 31st, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. function zen_lansed_preprocess_page(&$variables, $hook) {
  2.  
  3.   // меняем на странице /user вывод в заголовке с имени пользователя на full_name
  4.   $account = user_load($GLOBALS['user']->uid);
  5.   $arg = arg();
  6.  
  7.   if ($arg[0] == 'user' && !empty($arg[1]) && is_numeric($arg[1]) && @empty($arg[2])) {      
  8.     if (isset($account->field_full_name["und"])) {     
  9.         $variables['title'] = $account->field_full_name["und"][0]["safe_value"];
  10.     } else {       
  11.         $variables['title'] = "полного имени нет";
  12.     }  
  13.    }  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement