How to add dynamic profile fields in Invision Power Board?

Posted by user361908 on Stack Overflow See other posts from Stack Overflow or by user361908
Published on 2010-06-09T00:01:21Z Indexed on 2010/06/09 0:12 UTC
Read the original article Hit count: 841

Filed under:
|

I run a game server and want to link the persons in game character name and stats to Invision Power Board. I've setup IPB so players currently login with their in game login. That means their username on the forum is the same as their username for the game.

They can have multiple characters on 1 account so ideally I'd like to allow them to choose a main character and display an actual image of that character and allow them to display other characters if they are online.

Currently I'm doing something like this by hacking profileFields.php but it's messy and not very efficient on the user or server end. My code currently uses 2 custom fields which the player can enter their character names in. To display only their main character they enter the name in the first field. To also display other characters if they are online they enter the same name into the second field. To resolve the IDs I have to run a lot of queries.

I know PHP but I am not familiar with IPBs code at all. I just need pointed in a direction where I can combine the 2 fields into 1 field.

tl;dr:

Here is my setup:

  • Invision Power Board 3
  • Data is stored in MySQL on the same server the forum is hosted on.
  • Usernames on the forum are identical to usernames in the game

Here is a breakdown of what I'd like to do:

  • In the edit profile section I need to resolve the forum username to the games account id then:
  • Display a list of characters and allow them to choose which characters they want to display if they are online as well as a default character that will be displayed if none are online.
  • In the posts user info pane: Display the online character or the default if none are online.

Here is what I need to know:

  • How to generate a list of characters in the profile edit form and allow selection (checkbox) of each character to display as well as the selection of a default character (radio or dropdown?)
  • How to fetch the data and place it in the posts user info pane

© Stack Overflow or respective owner

Related posts about php

Related posts about ipb