Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Dynamic user data and standard user data
  • Posted: 23.03.2005, 06:13
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    Im finding it to be really annoying when trying to call Dynamic user data versus standard user data. Using something like pnUserGetVar('uname') works just fine to get their user name, but if I wanted to get their lastname, which is a dynamic field i have setup, pnUserGetVar('lastname'). I would be completely out of luck. How am I supposed to reference this data? My site revolves around the users dynamic data inputs, such as lastname, first name, city, etc, etc. Any help would be appreciated.
  • Posted: 23.03.2005, 09:57
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    Just a note. I know how to call them in templates, but not in the actual PHP code. I know it should be similiar, but im not getting it for some reason.
  • Posted: 23.03.2005, 10:37
     
    pnp
    rank:
    Freshman Freshman
    registered:
     August 2004
    Status:
    offline
    last visit:
    24.06.05
    Posts:
    27
    Have you setup your module to function like in the pnMDG for using dynamic user vars?

    http://docs.postnuke.com/index.php?module=Static_Docs&func=view&f=pnmdg/ch02s02.html
  • Posted: 23.03.2005, 12:59
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    that API is 3 years old and not up to date.
  • Posted: 23.03.2005, 15:30
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    ok, i guess I got it to work, not sure why it didnt before. Here is an example.

    $LASTNAME = pnUserGetVar('_LASTNAME');
    echo $LASTNAME;
  • Posted: 23.03.2005, 16:48
     
    Chestnut
    rank:
    Steering Committee Steering Committee
    registered:
     August 2002
    Status:
    offline
    last visit:
    03.03.08
    Posts:
    1221
    Core fields are aliased...

    Dynamics are not and so are referenced by their proplabel information

    core aliases :

    Code

    $uid = pnUserGetVar('uid');

    $uname           = pnUserGetVar('uname');
    $name            = pnUserGetVar('name');
    $email           = pnUserGetVar('email');
    $femail          = pnUserGetVar('femail');
    $url             = pnUserGetVar('url');
    $timezone_offset = pnUserGetVar('timezone_offset');
    $user_avatar     = pnUserGetVar('user_avatar');
    $user_icq        = pnUserGetVar('user_icq');
    $user_aim        = pnUserGetVar('user_aim');
    $user_yim        = pnUserGetVar('user_yim');
    $user_msnm       = pnUserGetVar('user_msnm');
    $user_from       = pnUserGetVar('user_from');
    $user_occ        = pnUserGetVar('user_occ');
    $user_intrest    = pnUserGetVar('user_intrest');
    $user_sig        = pnUserGetVar('user_sig');
    $bio             = pnUserGetVar('bio');


    //OR
    $userinfo = pnUserGetVars($uid);

    $uname           = userinfo['uname'];
    $name            = userinfo['uname'];
    $email           = userinfo['uname'];
    $femail          = userinfo['uname'];
    $url             = userinfo['uname'];
    $timezone_offset = userinfo['timezone_offset'];
    $user_avatar     = userinfo['user_'];
    $user_icq        = userinfo['user_'];
    $user_aim        = userinfo['user_'];
    $user_yim        = userinfo['user_'];
    $user_msnm       = userinfo['user_'];
    $user_from       = userinfo['user_'];
    $user_occ        = userinfo['user_'];
    $user_intrest    = userinfo['user_'];
    $user_sig        = userinfo['user_'];
    $bio             = userinfo['bio'];


    I may forget one or two...

    And as you found out, dynamics are by their label

    Code

    $_TEST = pnUserGetVar('_TEST');
    //or
    $_TEST = $userinfo['_TEST'];


    --
    Chestnut !
    Support via Private message won't be answered...
    http://dev.pnconcept.com
    http://www.postnuke-france.org
  • Posted: 23.03.2005, 18:15
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    thanks for the tips, that definately helps.

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula