Forum Discussion

briancostea's avatar
briancostea
Contributor
13 years ago

userInfo with Ranking Formula

Can you please tell me where I can find some documentation on what I am allowed to call with the userInfo fucntion when creating a custom ranking formula?

 

Thanks

  • JakeR's avatar
    JakeR
    13 years ago

    briancostea wrote:

     

    I just want to clarify that no documentation exists for what paramters I can use when calling the "userInfo" function inside the ranking system?


     To my knowledge, there is not a list of documented parameters that you can call / use inside the ranking system.  Ideally, the tooltip within the admin would be comprehensive and list them all.


    briancostea wrote:

    Are there net variables for these or are there "deleted" variables that I can compute the net?


    There are variables for deleted also, but rather than having to compute that, I think it is better to just give you the 'net' variables.  Here they are:

     

    net_idea_threads
    net_idea_comments
    net_blog_articles
    net_blog_comments

     

    The TKB article variable that I supplied earlier is actually for the number of "Knowledge Base Articles Started" (not how many were actually published, much less, how many were deleted)

     

  • Hi guys, sorry for pushing this veeery old topic but I just stumbled upon it and have an addition for others like me:

    You can get all user settings with the following APIv2 Call:

    SELECT id, user.local FROM settings WHERE user.id = 'ANY_USER_ID'

     

    Unfortunately it is not possible to filter for settings starting with "user." or "profile." and there is a lot of unuseful settings in this context. But with a small script looping through the settings, you could filter these.
    I'm just to lazy to provide a full list now 😁

    As far is I tested, every setting with "user." and "profile." can be used within the role-checks, even customfields created by khoros support:

    (userInfo("profile.devices") == "my_shiny_device")

     

    I haven't tested this with other settings outside the user/profile scope.

  • Spamming the thread with my own answer - The proper way to add custom profile attributes (or at least in my case) was like this (Thanks goes to Chad in Support!)

    (userInfo("custom_profile.course_1") == true)

     

     

    • briancostea's avatar
      briancostea
      Contributor

      Thank you, Claudius.  It's pretty much the same doc that's included inside the ranking page in the admin panel.

       

       Question:  Are the variables listed in the additional PDF document you provided scoped to only include data by member and not aggregate numbers for the entire community.  For example, the variable "net_accepted_solutions" only includes the number of accepted solutions for the authenticated member and not the entire community; is that correct?

       

      Thanks

      Brian

      • BoothF's avatar
        BoothF
        Khoros Staff

        Hi Brian,

         

        Yes, in relation to ranking formula your statement is correct:smileylol:.

         All the variables in the user metrics are user scoped.

         

        Thanks!

  • mbiel Thank you, you just saved me endless hours with telling me for custom profile attributes it's as easy as profile.xxxx - I would have never tried that when everywhere else they start with "custom"!!!!