PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/sites/all/themes/titan/user-profile.tpl.php

https://bitbucket.org/hjain/trinet
PHP | 58 lines | 21 code | 0 blank | 37 comment | 1 complexity | d17d96a52afb0ac0c9401e48dad98af6 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0, AGPL-1.0
  1. <?php
  2. /**
  3. 4. * @file
  4. 5. * Default theme implementation to present all user profile data.
  5. 6. *
  6. 7. * This template is used when viewing a registered member's profile page,
  7. 8. * e.g., example.com/user/123. 123 being the users ID.
  8. 9. *
  9. 10. * Use render($user_profile) to print all profile items, or print a subset
  10. 11. * such as render($user_profile['user_picture']). Always call
  11. 12. * render($user_profile) at the end in order to print all remaining items. If
  12. 13. * the item is a category, it will contain all its profile items. By default,
  13. 14. * $user_profile['summary'] is provided, which contains data on the user's
  14. 15. * history. Other data can be included by modules. $user_profile['user_picture']
  15. 16. * is available for showing the account picture.
  16. 17. *
  17. 18. * Available variables:
  18. 19. * - $user_profile: An array of profile items. Use render() to print them.
  19. 20. * - Field variables: for each field instance attached to the user a
  20. 21. * corresponding variable is defined; e.g., $account->field_example has a
  21. 22. * variable $field_example defined. When needing to access a field's raw
  22. 23. * values, developers/themers are strongly encouraged to use these
  23. 24. * variables. Otherwise they will have to explicitly specify the desired
  24. 25. * field language, e.g. $account->field_example['en'], thus overriding any
  25. 26. * language negotiation rule that was previously applied.
  26. 27. *
  27. 28. * @see user-profile-category.tpl.php
  28. 29. * Where the html is handled for the group.
  29. 30. * @see user-profile-item.tpl.php
  30. 31. * Where the html is handled for each item in the group.
  31. 32. * @see template_preprocess_user_profile()
  32. <?php //echo "<pre>"; print_r($variables['elements']['#account']->name); exit;?>
  33. <?php //echo "<pre>"; print_r($variables['elements']['profile_user_profile']['view']['profile2']['3']['field_first_name']['#object']->field_first_name['und']['0']['value'] ); exit;?>
  34. <?php //echo "<pre>"; print_r($variables['elements']['profile_user_profile']['view']['profile2']['3']); exit;?>
  35. 33. */
  36. ?>
  37. <div class="profile"<?php print $attributes; ?>>
  38. <?php //echo "<pre>"; print_r($variables); exit;
  39. $arg1=arg(1);
  40. //print_r($arg1);exit;
  41. $query = db_select('profile','p');
  42. //$query->innerJoin('users','u','f.uid= u.uid');
  43. $query->fields('p',array('pid'))
  44. ->condition('p.uid',$arg1, '=');
  45. $data=$query->execute()->fetchObject();
  46. $upid=$data->pid;
  47. //echo "<pre>";print_r($variables['elements']['profile_user_profile']['view']['profile2'][$upid] );exit;
  48. $first_nam = $variables['elements']['profile_user_profile']['view']['profile2'][$upid]['field_first_name']['#object']->field_first_name['und']['0']['value'];
  49. if(isset($variables['elements']['profile_user_profile']['view']['profile2'][$upid]['field_last_name'])){
  50. $last_nam = $variables['elements']['profile_user_profile']['view']['profile2'][$upid]['field_last_name']['#object']->field_last_name['und']['0']['value'];
  51. }
  52. else{
  53. $last_nam=' ';
  54. }
  55. ?>
  56. <div class="user-profile-name"><?php print $first_nam .' '.$last_nam?></div>
  57. <?php print render($user_profile); ?>
  58. </div>