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

Implemented Unserialize "custom_fields" in XenForo_ControllerPublic_Thread

Discussion in 'Closed Suggestions' started by SchmitzIT, Oct 20, 2011.

  1. SchmitzIT

    SchmitzIT Well-Known Member

    Cusotm Fields are great, and in our old forum setup, we used them to store anything that was worth storing, much of which ended up in the member-info block that is displayed in threads.

    To accomplish something similar in XF, it would be nice if these custom fields are available for usage in a template. This does not seem to be currently possible without going in and doing something similar to what is being done to accomplish the Steam user block seen in this post.

    Having the data available would mean no hacks have to be done on the core XF files, and it will ensure that add-on writers will not have to write their own methods to accomplish the same.

    Thank you.
  2. ragtek

    ragtek Guest

    It's AFAUK already possible with the template helper
    'userfieldtitle' => array('self''helperUserFieldTitle'),
    'userfieldvalue' => array('self''helperUserFieldValue'),
  3. Mike

    Mike XenForo Developer Staff Member

    It is unserialized anyway: customFields
  4. SchmitzIT

    SchmitzIT Well-Known Member

    D'oh. Serves me for not checking the whole template. Thanks Mike.
  5. feldon30

    feldon30 Well-Known Member

    It's unserialized in some places. Not others.

    In some places, $user['customFields'] is set.

    In some places, only $user['custom_fields'] exists as a serialized string.

    The example I am running into is within the function helperAvatarHtml().

Share This Page