Skip to main content

Use the $user$user object to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value']$account->field_iweight['und'][0]['value'] (just an example) to access the weight or any other field from the user profile.

Updated code:

<?php
global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];
?>

Use the $user to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'](just an example) to access the weight or any other field from the user profile.

Updated code:

<?php
global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];
?>

Use the $user object to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'] (just an example) to access the weight or any other field from the user profile.

Updated code:

<?php
global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];
?>
deleted 18 characters in body
Source Link
Jayaram
  • 791
  • 2
  • 7
  • 25

Use the $user to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'](just an example) to access the weight or any other field from the user profile.

Updated code:

<?php
 
global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];

 
?>

Use the $user to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'](just an example) to access the weight or any other field from the user profile.

Updated code:

<?php
 
global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];

 
?>

Use the $user to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'](just an example) to access the weight or any other field from the user profile.

Updated code:

<?php
global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];
?>
added 241 characters in body
Source Link
Jayaram
  • 791
  • 2
  • 7
  • 25

Use the $user to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'](just an example) to access the weight or any other field from the user profile.

Updated code:

<?php

global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];


?>

Use the $user to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'](just an example) to access the weight or any other field from the user profile.

Use the $user to access the logged in user.

 global $user;
 $account = user_load($user->uid);

Now you can use $account->field_iweight['und'][0]['value'](just an example) to access the weight or any other field from the user profile.

Updated code:

<?php

global $user;
$account = user_load($user->uid);
$entity_field[0]['value'] = $account->field_iweight['und'][0]['value'] - $entity->field_current_weight['und'][0]['value'];


?>
Post Undeleted by Jayaram
Post Deleted by Jayaram
Source Link
Jayaram
  • 791
  • 2
  • 7
  • 25
Loading