Jump to content

Login/Register not returning field values


froot
 Share

Recommended Posts

if($user->isLoggedin() && !$input->get('profile') && !$input->get('logout')) {
echo '<h2>'.__('Mein Profil').'</h2>';
echo '<p><strong>'.$user->fields[130].': </strong>' . '<span>'.$user->givenname.'</span></p>';
echo '<p><strong>'.$user->fields[131].': </strong>' . '<span>'.$user->lastname.'</span></p>';
echo '<p><strong>'.$user->fields[92].': </strong>' . '<span>'.$user->email.'</span></p>';
echo '<p><strong>'.$user->fields[171].': </strong>' . '<span>'.$user->units_balance.'</span></p>';
}

I don't know why none of the values don't return anything (in the span tags). Also, the ->fields[] API is not very elegant either. 

Link to comment
Share on other sites

It's hard to say what is your problem because $user->givenname should work if the template "user" has a field givenname with a value. So the problem is not this code, it's elsewhere.

17 hours ago, froot said:

Also, the ->fields[] API is not very elegant either. 

You shouldn't need this, I didn't even know it exists and I added 27 fields on the "user" template in my current project. 🙂

Where does $user variable comes from in your code?
Does the "user" template have all the properties?
What var_dump($user) returns?

Edited by da²
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...