Date is set to 01-JAN-1970 upon registration

Mod that adds a birthday field to the users profile, theire age are displayed beside the posts, and on there birthday they will have a greeting popup
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby jobbesat on Fri 02. May, 2003 10:00

Thanks for your reply as well. I tried several new registrations and all are set to Jan 1 1970, nothing to do. I'm pretty sure the problem came with mass_pm and the problem itself is located on my usercp_register.php
No matter what anyway, thanks again warmweer
jobbesat
Special supporter
 
Posts: 191
Joined: Tue 07. May, 2002 16:21

Postby warmweer on Fri 02. May, 2003 22:38

jobbesat wrote: I tried several new registrations and all are set to Jan 1 1970, nothing to do. I'm pretty sure the problem came with mass_pm and the problem itself is located on my usercp_register.php


Post the whole SQL here and I'll have a look at it (I'm getting used to this now 8) )

$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, ......

It about half way usercp_register.php, at least a whole page after the Insert SQL.

Also check if the user can edit the birthday after registering, and also whether the admin can edit the age of the user.
A bug is a feature which didn't make it to the manual
warmweer
Poster
Poster
 
Posts: 25
Joined: Mon 10. Feb, 2003 21:55
Location: Belgium

Postby jobbesat on Sun 04. May, 2003 07:01

Thanks warmweer, a dude from phpbbhacks.com stuff solved my problem; it's wan on sql statement, I just moved allow_mass_pm, 20 seconds and the problem disappeared :)
jobbesat
Special supporter
 
Posts: 191
Joined: Tue 07. May, 2002 16:21

Postby Niels on Sun 04. May, 2003 12:22

I have changed the FIND tag, wich cause this problem to happen
this should make it less likely that other user will experince this in the future :D
also if other mods are installed
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby CAMEO on Tue 06. May, 2003 07:00

I have also this 01/01/70 trouble since the beginning and I just don't understant what I have to change in the SQL oder. thisis what I have :

Code: Select all
$sql = "INSERT INTO " . USERS_TABLE . "   (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_from_flag, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_gender, user_level, user_allow_pm, user_birthday, user_next_birthday_greeting, user_active, user_actkey)
            VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "','$user_flag', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, '$gender','$birthday','$next_birthday_greeting', 0, 1, ";
         


even with this trouble, this MOD is really great
CAMEO
Poster
Poster
 
Posts: 5
Joined: Mon 03. Mar, 2003 15:54

Postby Niels on Tue 06. May, 2003 16:07

this part
Code: Select all
user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_from_flag, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_gender, user_level, user_allow_pm, user_birthday, user_next_birthday_greeting, user_active, user_actkey)
           


MUST have the same order as this part

Code: Select all
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "','$user_flag', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, '$gender','$birthday','$next_birthday_greeting', 0, 1, ";
         


in your case, you code will give un-predicteble behaivier (in worst case your users can get admin permission), do NOT run with sutch code, instead try correct the order, so the match

NOT like this (your case)
UPDATE (a,b,c) VALUES (a,c,b)

but LIKE this

UPDATE (a,b,c) VALUES (a,b,c)
OR
UPDATE (a,c,b) VALUES (a,c,b)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Rapid Dr3am on Tue 06. May, 2003 18:07

I have tried this fix, but am lost.

Can somoen do it for me if I post the file? Pretty please. :)
User avatar
Rapid Dr3am
Poster
Poster
 
Posts: 204
Joined: Mon 10. Feb, 2003 22:27
Location: Liverpool, England

Postby Niels on Tue 06. May, 2003 21:55

this looks more correct, maybe still truble, try and test
(always try an register a user, and see that this user is handled correctly, if you experince truble with this line of code)
Code: Select all
$sql = "INSERT INTO " . USERS_TABLE . "   (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_from_flag, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_gender, user_level, user_allow_pm, user_birthday, user_next_birthday_greeting, user_active, user_actkey)
            VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "','$user_flag', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, '$gender', 0, 1,'$birthday','$next_birthday_greeting', ";
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

PreviousNext

Return to Birthday [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron