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

Custom fields - errors on sign up and some not showing

Discussion in 'XenForo Development Discussions' started by danmark2312, Aug 8, 2013.

  1. danmark2312

    danmark2312 Member

    Ok so i have 2 bugs with my custom fields

    First i will start with a little bit information on this.
    I own a minecraft server and what i want to do is have some statistics from my minecraft server into my xenforo. It displays online, levels, money, lastseen, gametime and how long the person has lived.

    All the values are stored in a MySQL table here: xf_user_field_value and i can see the values on the table and on the "information" part of my user profile.

    But! I can only see: Online, Levels, Money in the message user info part. (When you post, the information is under your avatar, name and rank)

    The other 3: lastseen, gametime and lifetime is formatted into Mins, hours and stuff. So for example it doesn't display this: 372 but 3 hours 1 minutes 24 seconds.
    I have to make 2 custom fields for each of the formatted ones. The one with the data and one with the formatted data. I just make the formatted viewable here: Viewable in message user info and on profile pages.
    Now here's the problem! (we will take gametime for example here)
    The gametime data is not set to be displayed anywhere and it doesn't, but if i set the gametime formatted data to be displayed at: Viewable in message user info and on profile pages, it only shows up on the profilepages? And who checks the profilepages.... But when i make the gametime not-formatted data displayable in Viewable in message user info and profile pages it shows up on both of them!

    That was the first bug, this is the second

    Some short info:
    I have named my "online" custom field: cb_online on the "field_id" part and i've made my plugin from minecraft put the online data into the cb_online, and that works.

    Now to the bug:
    When a user registers he/she gets this error:
    Mcvuze - Error
    A server error occurred. Please try again later.

    I get this error:
  2. Jon W

    Jon W Well-Known Member

    Your error relates to the column cb_online in your user table (xf_user I assume). You need to give that column a default value in MySql (i.e., empty string or 0 or NULL).
  3. danmark2312

    danmark2312 Member

    Thank you! That fixed the second bug! What about the first one?
  4. Jon W

    Jon W Well-Known Member

    I'm a little confused by your first one. Why are you creating 2 custom fields for each of the formatted ones? How are you formatting the data -- is this custom code as well?
  5. danmark2312

    danmark2312 Member

    Well lets say gametime has one custom field, and that is the un-formatted data part. But if i want the data to be formatted i need a second custom field, because the second one gets its data from the first custom field. If you understand?
  6. Jon W

    Jon W Well-Known Member

    Nope. I didn't know that that was possible. Can you show me screenshots of the settings for one of the pairs of custom fields?
  7. danmark2312

    danmark2312 Member

    Screenshots of what? All the 3 tabs on each of the custom fields?
  8. Jon W

    Jon W Well-Known Member

    If you can...
  9. danmark2312

    danmark2312 Member

    Oh, plugin developer has a fix for it, so nvm :D
    Jon W likes this.

Share This Page