View Full Version : mktime() expects parameter 4 to be long... etc
Outlaw Mantis
11-09-2014, 03:05 PM
I get this on profiles of users have not entered their birthday. I've searched in many threads and have not found any solution. I've tried moving users to and from usergroups, checking the database to find any erroneous birthday entries, which I did find, but upon correcting them I still get the error. I've seen several times that users who have investigated the error have determined it is not caused by plugins.
This error has been popping up since 2006. What could be causing it? It leaves a horrible space in the header and to the left of the forum, so of course, it's not something that can be ignored.
Can you post the full error here including the file name and line number?
Here's a thread that mentions it: http://www.vbulletin.com/forum/forum/vbulletin-legacy-versions-products/legacy-vbulletin-versions/vbulletin-3-6-questions-problems-and-troubleshooting/267720-mktime-expects-parameter-4-to-be-long
I guess the solution there is to move the affected users to a new user group then back again. I also saw it mentioned that if you edit the user's profile in the admincp and save without changing anything, it will be fixed (although you have to do it for each affected user).
If you look in the database and see what the affected users have in their for their birthday, you might be able to figure out some SQL to fix it.
Outlaw Mantis
11-09-2014, 03:29 PM
I couldn't post the full error in the title, but I guess I should have in the post.
Warning: mktime() expects parameter 4 to be long, string given in ..../includes/class_userprofile.php on line 260
Yeah, I did that usergroup thing. It seems that every user without a birthday has the bug, and there are hundreds, but I could try it. It could be a bug in the MyBB to vBulletin converter. Here's what I have in phpMyAdmin:
https://vborg.vbsupport.ru/external/2014/11/17.jpg
Edit: By the way, I did the maintenance checks, including fixing user profiles.
Hmm...you could try
UPDATE user SET birthday='' WHERE birthday = '--'
Of course it's a little dangerous anytime you change the database like that, so if you don't feel comfortable then you may not want to do it, and if you do you should make sure you have a backup.
Maybe it works if you run the following query:
UPDATE user SET birthday = '' WHERE birthday = '--'
Backup the table/database first.
Edit: kh99 beat me to it.
Outlaw Mantis
11-09-2014, 03:40 PM
So from this, it's safe to say it's probable that MyBB null fields for birthdays were "--" and vBulletin uses nothing? I'll make a backup and give it a try, thanks.
Probably because the converter found empty/bad dates and instead of something like 1970-01-01 it removed the numbers which left you with --.
Outlaw Mantis
11-09-2014, 07:41 PM
It works. :) Ace, thanks guys. One quick question while I'm here. As a result of importing, each user has a "user note" saying "Imported user". Can all members view user notes? It doesn't look so welcoming to have an "Imported user" note on everybody's page. Any suggestions?
Normally everyone can't read the notes, but check in the usergroup manager in the "User Note Permissions" section. In my default setup, "User Notes Can Be Posted About This Group" is set to yes but everything else is no.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.