Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Display user most active category in user profile

Hi. I would like to display user most active category in his user profile.
Is this possible ?


  • Options
    R_JR_J Ex-Fanboy Munich Admin

    It's certainly possible. But there is one catch I see here: category permissions. Imagine you have a forum where you have a category which is reserved for admins and mods. Or any other category which isn't public, a category which is only accessible for forum members. What should a guest see when he is looking at the profile of a user who is most active in a non public category?

    Most probably the second most used category, okay. But the problem is, that in such a case a) you would have to calculatate the information for each profile visit or b) cache more values.

    But further than that, I couldn't see a real problem here.

    Depending on where in the profile you like to see that information and how, you might me able to "re-use" an existing plugin to solve the problem on how to show something in the profile.

    Normally I advice to use a model to get information from tables. In this case I would advice to use a prepared SQL query, since it would be quite complicated.

    I would store the result (a sorted array of categories) in the UserMeta table and recalculate the information

    • after every discussion save
    • after every comment save and
    • on every profile visit where CountDiscussions + CountComments > 0 and no cached array is available

    I don't think this is a good beginner plugin, but if you have some programming experiences, it's surely do-able.

Sign In or Register to comment.