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.

Custom user fields (Help needed)

6apxat6apxat New
edited May 2012 in Vanilla 2.0 - 2.8

Hello.
My team is currently working on a community forum for our project (an online social game).

Our basic requirement (apart from custom theming) is to add additional fields to user profiles and show them on profile page and discussion page.

We're using Vanilla 2.0.18.4 with jsConnect and jsConnect Auto Signin plugins to sign in our users to forum automatically using their ID from social network. This works fine except a little hack that we used to force user to re-login on load by setting cookies (thanks to the Vanilla community forums: http://vanillaforums.org/discussion/16258/force-re-login).

In our game players have a nickname, a class (warrior/stalker/shaman) and a level which must be shown under their username in every post and also in their profile.

The level information is constantly updated and all player information is stored in a PostgreSQL database.

Where to get started? Would this be a plugin? Can anyone give any directions on how to accomplish this?

Best Answer

  • peregrineperegrine MVP
    Answer ✓

    You should dowload a bunch of plugins that do different parts of what you are looking for.

    Alot of plugins put info in the thread - e.g. pagenavigator, unreadicon, postnum to name a few.

    Look at the code that pulls the info and prefills forms in many plugins and in profile itself. e.g. ignore user (which I developed by looking at about 6 or seven plugins - (aboutme, karma, flagging, etc). Obviously if you download plugins written by the developers of vanilla itself - you get some of the the tricks they are using.

    to find out events - grep -ri fire * in the vanilla directory. Then you can look at the code where it is and get an idea where to use it.

    Get Started by

    1) look at other plugins for similar aspects of what you are going to do and take note of event that it is fired on.

    2) look at plugins that create their own tables - grep fro structure in the plugin.

    3) just start mofiying a plugin and get going, you don't have to know the big picture to experimanet and get comfortable. It really isn't that hard to get started. Once you learn one technique you can clone that and add to it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • Move to mysql.

    Custom fields is already available, you could hook into these in post discussion.

    There was an error rendering this rich post.

  • 6apxat6apxat New
    edited May 2012

    @422 Well, that's impossible :) It's a large project w/ more than 100 000 active users.

    I thought I could query the database for this data upon user sign-in and store it somewhere in Vanilla.
    Anyways, at the moment I've no idea where to start.

  • mcu_hqmcu_hq ✭✭✭

    Look at the aboutme plugin:

  • @mcu_hq, hey thanks for the suggestion, I've also checked MyProfile but this is not exactly what I'm trying to achieve.
    These fields must be auto-populated rather than filled in by user.
    Also it's not solving the problem of displaying this info in threads.
    So the question is for plugin developers — where to get started with this?

  • peregrineperegrine MVP
    Answer ✓

    You should dowload a bunch of plugins that do different parts of what you are looking for.

    Alot of plugins put info in the thread - e.g. pagenavigator, unreadicon, postnum to name a few.

    Look at the code that pulls the info and prefills forms in many plugins and in profile itself. e.g. ignore user (which I developed by looking at about 6 or seven plugins - (aboutme, karma, flagging, etc). Obviously if you download plugins written by the developers of vanilla itself - you get some of the the tricks they are using.

    to find out events - grep -ri fire * in the vanilla directory. Then you can look at the code where it is and get an idea where to use it.

    Get Started by

    1) look at other plugins for similar aspects of what you are going to do and take note of event that it is fired on.

    2) look at plugins that create their own tables - grep fro structure in the plugin.

    3) just start mofiying a plugin and get going, you don't have to know the big picture to experimanet and get comfortable. It really isn't that hard to get started. Once you learn one technique you can clone that and add to it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • well you need some middleware to assign vanilla roles with the same names.

    grep is your friend.

  • @peregrine thank you so much for the advice!

    It's too bad we have to dig it this way instead of just reading the docs.

  • peregrineperegrine MVP
    edited May 2012

    6apxat said:
    @peregrine thank you so much for the advice!

    It's too bad we have to dig it this way instead of just reading the docs.

    We can keep on repeating over and over "It's too bad". Don't think i disagree. I am trying to do my part answering questions, I don't even have a forum! As was suggested before there is nothing stopping anybody from adding things to the wiki, by cutting and pasting solutions others have provided, I'm sure nobody will be offended to see their knowledge added to the wiki (if you want to add who provided the info that you so graciously added, go ahead - if you did - I'm sure we would see @x00's name throughout.).

    well, its community based. you see a problem. after you dig it out, write something up.
    and add it to the wiki. You have to start somewhere as you said. The wiki is editable so people can add to it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.