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

Dizkus

Bottom
Registering new user variables
  • Posted: 16.03.2005, 16:00
     
    alexan
    rank:
    Softmore Softmore
    registered:
     November 2004
    Status:
    offline
    last visit:
    06.03.06
    Posts:
    66
    Hi guys,

    I have a question ... although I think I know the answer ...

    In the API documentation ( http://docs.postnuke…w&f=pnapi/re50.html ) it says:

    Quote

    Other (user) variables will be made available in future releases of the API. You can register new user variables with the register_user_var module API function included in Modules module.


    The register_user_var is not implemented yet and its been a while as I can see on these forum posts:
    http://forums.postnuke.com/index.php?name=PNphpBB2&file=viewtopic&t=33357&highlight=registeruservar
    http://forums.postnuke.com/index.php?name=PNphpBB2&file=viewtopic&t=13629&highlight=registeruservar
    http://forums.postnuke.com/index.php?name=PNphpBB2&file=viewtopic&t=8751&highlight=registeruservar

    Is there a new way of registering user variables since then?

    Or

    do i have to create a function that adds that manually
    or even create my own table with such variables
    or maybe use a hook everytime user gets created? (please give me more info on this one cause I do not know much about hooks)

    In any case I think it would be good if "register_user_var" was implemented as it is a very important function ... you just have to define some sort of naming convention to ensure that the module defined variables do not have the same name with future PostNuke defined user variables.

    Alexan
  • Posted: 16.03.2005, 18:59
     
    alexan
    rank:
    Softmore Softmore
    registered:
     November 2004
    Status:
    offline
    last visit:
    06.03.06
    Posts:
    66
    and does pnUserSetVar work on 0.7.5.0

    if I do this:

    pnUserSetVar('EmailNotification','Y');
    echo pnUserGetVar('EmailNotification');

    I get nothing echoed ...
  • Posted: 21.03.2005, 21:36
     
    alexan
    rank:
    Softmore Softmore
    registered:
     November 2004
    Status:
    offline
    last visit:
    06.03.06
    Posts:
    66
    guys give me a hand here please...

    do user defined User Vars work at all?

    and if so how and when do you set them up?
  • Posted: 23.03.2005, 12:50
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    I have the same problem. Im can get it to work most of the time with core fields, but not dynamic.
  • Posted: 23.03.2005, 16:54
     
    Chestnut
    rank:
    Steering Committee Steering Committee
    registered:
     August 2002
    Status:
    offline
    last visit:
    03.03.08
    Posts:
    1221
    As you found out yourself, register_user_var is not in yet... So you cannot use a non core field by a non-existant name : EmailNotification

    Use the dynamics for that.

    Dynamic field : _EMAILNOTIFICATION
    After it is created, you can do your :

    Code

    pnUserSetVar('_EMAILNOTIFICATION', 'Y');
    echo pnUserGetVar('_EMAILNOTIFICATION');


    See this post for the available aliases and method to fetch core and dynamic fields.

    --
    Chestnut !
    Support via Private message won't be answered...
    http://dev.pnconcept.com
    http://www.postnuke-france.org
  • Posted: 23.03.2005, 18:12
     
    adcantu
    rank:
    Helper Helper
    registered:
     July 2004
    Status:
    offline
    last visit:
    06.06.05
    Posts:
    223

    Chestnut

    See this post for the available aliases and method to fetch core and dynamic fields.
    see what post? icon_wink
  • Posted: 23.03.2005, 18:13
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    He is probably talking about this one: http://forums.postnu…pic&p=153145#153145
  • Posted: 23.03.2005, 19:04
     
    adcantu
    rank:
    Helper Helper
    registered:
     July 2004
    Status:
    offline
    last visit:
    06.06.05
    Posts:
    223
    yea i saw lol... i was partially giving him a hard time, partially hoping to help next months searchers lol.
  • Posted: 23.03.2005, 19:13
     
    MACscr
    rank:
    Professional Professional
    registered:
     December 1969
    Status:
    offline
    last visit:
    10.01.08
    Posts:
    1631
    lol, thats why i always try to post my resolutions to posts after i get things fixed, etc. To archive the solution as I am ALWAYS searching these forums for answers. Forget documentation as it always falls behind, im for living documentation such as these forums.
  • Posted: 23.03.2005, 19:33
     
    alexan
    rank:
    Softmore Softmore
    registered:
     November 2004
    Status:
    offline
    last visit:
    06.03.06
    Posts:
    66
    ok, thanks guys

    I thought pnUserSetVar() would automaticallity create a variable for a user if it didn't exist .... it doesn't so everything is clear ...

    might try to create the "register_user_var" function if i find the time ...
    I 'll post it here if I do ...

    cya
    Alexan
  • Posted: 23.03.2005, 22:05
     
    Chestnut
    rank:
    Steering Committee Steering Committee
    registered:
     August 2002
    Status:
    offline
    last visit:
    03.03.08
    Posts:
    1221
    Ok... I say it :

    Oups ! icon_lol

    --
    Chestnut !
    Support via Private message won't be answered...
    http://dev.pnconcept.com
    http://www.postnuke-france.org

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula