Custom fields - errors on sign up and some not showing

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:
Error Info
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Field 'cb_online' doesn't have a default value - library/Zend/Db/Statement/Mysqli.php:214
Generated By: Unknown Account, Yesterday at 7:27 PM
Stack Trace
#0 /home/mcvuzedk/public_html/nyside/forum/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /home/mcvuzedk/public_html/nyside/forum/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /home/mcvuzedk/public_html/nyside/forum/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /home/mcvuzedk/public_html/nyside/forum/library/XenForo/DataWriter.php(1612): Zend_Db_Adapter_Abstract->insert('xf_user', Array)
#4 /home/mcvuzedk/public_html/nyside/forum/library/XenForo/DataWriter.php(1601): XenForo_DataWriter->_insert()
#5 /home/mcvuzedk/public_html/nyside/forum/library/XenForo/DataWriter.php(1393): XenForo_DataWriter->_save()
#6 /home/mcvuzedk/public_html/nyside/forum/library/MinecraftAvatar/ControllerPublic/Register.php(94): XenForo_DataWriter->save()
#7 /home/mcvuzedk/public_html/nyside/forum/library/WMinecraft/ControllerPublic/Register.php(59): MinecraftAvatar_ControllerPublic_Register->actionRegister()
#8 /home/mcvuzedk/public_html/nyside/forum/library/XenForo/FrontController.php(337): WMinecraft_ControllerPublic_Register->actionRegister()
#9 /home/mcvuzedk/public_html/nyside/forum/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#10 /home/mcvuzedk/public_html/nyside/forum/index.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
["url"] => string(57) "http://mcvuze.dk/nyside/forum/index.php?register/register"
["_GET"] => array(1) {
["register/register"] => string(0) ""
}
["_POST"] => array(16) {
["username"] => string(5) "dvago"
["email"] => string(18) "kristi-anh@live.dk"
["password"] => string(8) "********"
["password_confirm"] => string(8) "********"
["dob_month"] => string(1) "2"
["dob_day"] => string(1) "9"
["dob_year"] => string(4) "1999"
["gender"] => string(4) "male"
["custom_fields"] => array(1) {
["skype"] => string(13) "kristian61234"
}
["custom_fields_shown"] => array(1) {
[0] => string(5) "skype"
}
["timezone"] => string(16) "Europe/Amsterdam"
["captcha_question_answer"] => string(11) "danmark2312"
["captcha_question_hash"] => string(40) "4695fb72690b92efb556854fc8647f22b08d24de"
["agree"] => string(1) "1"
["_xfToken"] => string(8) "********"
["reg_key"] => string(32) "b15d3498a3ab04aef4b2f3e6eddd705a"
}
}
 
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).
 
Thank you! That fixed the second bug! What about the first one?
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?
 
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?
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?
 
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?
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?
 
Back
Top Bottom