1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xen:helper username for UserID

Discussion in 'XenForo Development Discussions' started by nrep, Sep 14, 2013.

  1. nrep

    nrep Well-Known Member

    I'm trying to get "xen:helper username" working when all I have is a UserID string (set as a xenoption in the admin panel).

    This doesn't work, but is there a way around this?

    {xen:helper username, {$xenOptions.customuserid}}
  2. Chris D

    Chris D XenForo Developer Staff Member

    The <xen:username or {xen:helper username or {xen:username or whatever other variations of it, all require a user_id AND username to work.
  3. nrep

    nrep Well-Known Member

    Cheers Chris, I'll add another option field for that. What would be the most basic usage of that xen:helper with a userid and username variable?

    Thanks for your help on XenForo - you've helped a lot of coding newbies like me! It is very much appreciated!
  4. Chris D

    Chris D XenForo Developer Staff Member

    It would be something like:

    {xen:helper username, {xen:array 'user_id={$xenOptions.customuserid}', 'username={$xenOptions.customusername}'}}

    I haven't tested it... but that should work.
    Marcus and nrep like this.
  5. nrep

    nrep Well-Known Member

    Just added it to the template and it works perfectly! Thanks again :).
    Chris D likes this.

Share This Page