SHARE
TWEET

PHP new function

someinternetuser Oct 31st, 2013 34 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top