The follwing function prints an unordened list of positions:

global $user;
$account = user_load($user->uid);
print $account->linkedin['positions']['value'];

I'd like to print each value individually. How can I do this?

Comments

davad’s picture

The positions are aggregated and stored in $user->linkedin['positions']['value']. Right now there's no way to access each position individually. If you want to roll a patch that keeps adds a $user->linkedin['positions'][$int] (where int is 0th, 1st, 2nd, etc positions), I'll be happy to review it.

As a side note, these two lines from your code snippet are redundant:

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

Since you're getting the $user variable, you can access the linkedin profile info directly:

print $user->linkedin['positions']['value'];

Happy coding!

greg.harvey’s picture

Status: Active » Fixed

No response after two years, assuming this is a fix!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.