I’ve just gotten a PM from the MOD Database Manager (phpBB MOD Team) that my v1.0.0 of Change Registration was denied. Below are the reasons why it was denied with my responses to them.
[php]
#
#—–[ FIND ]——————————————
#
$sql = “UPDATE ” . USERS_TABLE . ”
SET ” . $username_sql . $passwd_sql . “user_email = ‘” . str_replace(“\'”, “””, $email) . “‘, user_icq = ‘” . str_replace(“\'”, “””, $icq) . “‘, user_website = ‘” . str_replace(“\'”, “””, $website) . “‘, user_occ = ‘” . str_replace(“\'”, “””, $occupation) . “‘, user_from = ‘” . str_replace(“\'”, “””, $location) . “‘, user_interests = ‘” . str_replace(“\'”, “””, $interests) . “‘, user_sig = ‘” . str_replace(“\'”, “””, $signature) . “‘, user_viewemail = $viewemail, user_aim = ‘” . str_replace(“\'”, “””, $aim) . “‘, user_yim = ‘” . str_replace(“\'”, “””, $yim) . “‘, user_msnm = ‘” . str_replace(“\'”, “””, $msn) . “‘, user_attachsig = $attachsig, user_sig_bbcode_uid = ‘$signature_bbcode_uid’, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = ‘” . str_replace(“\'”, “””, $user_lang) . “‘, user_style = $user_style, user_timezone = $user_timezone, user_dateformat = ‘” . str_replace(“\'”, “””, $user_dateformat) . “‘, user_active = $user_status, user_rank = $user_rank” . $avatar_sql . ”
WHERE user_id = $user_id”;
#
#—–[ REPLACE WITH ]——————————————
#
$sql = “UPDATE ” . USERS_TABLE . ”
SET ” . $username_sql . $passwd_sql . “user_email = ‘” . str_replace(“\'”, “””, $email) . “‘, user_icq = ‘” . str_replace(“\'”, “””, $icq) . “‘, user_website = ‘” . str_replace(“\'”, “””, $website) . “‘, user_occ = ‘” . str_replace(“\'”, “””, $occupation) . “‘, user_from = ‘” . str_replace(“\'”, “””, $location) . “‘, user_interests = ‘” . str_replace(“\'”, “””, $interests) . “‘, user_sig = ‘” . str_replace(“\'”, “””, $signature) . “‘, user_viewemail = $viewemail, user_aim = ‘” . str_replace(“\'”, “””, $aim) . “‘, user_yim = ‘” . str_replace(“\'”, “””, $yim) . “‘, user_msnm = ‘” . str_replace(“\'”, “””, $msn) . “‘, user_attachsig = $attachsig, user_sig_bbcode_uid = ‘$signature_bbcode_uid’, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = ‘” . str_replace(“\'”, “””, $user_lang) . “‘, user_style = $user_style, user_timezone = $user_timezone, user_dateformat = ‘” . str_replace(“\'”, “””, $user_dateformat) . “‘, user_active = $user_status, user_regdate = ‘” . str_replace(“\'”, “””, $regdate_unix) . “‘, user_rank = $user_rank” . $avatar_sql . ”
WHERE user_id = $user_id”;
[/php]
That’s a frequently updated line. IN-LINE actions and a partial match should be used, instead, to account for this fact.
I should of resubmitted this Mod once I found out the INLINE command that could be used with EasyMOD.
Also, why not use sometihng like $board_config[‘default_dateformat’]?
I could use that but then how to recongise each different pattern and correctly parse it. Say I had 09 September 2006 11:44 am, and then I changed the default_dateformat to something like September 09 2006 11:44 am. How would it know which part is which?
Since they can change the default_dateformat they could use all different kinds of combinations as well as not having the date or time in the format as well and then this mod wouldn’t work. I could use drop down boxes, etc, but this was meant to be a simple mod so I left it how it was.
[php]$lang[‘Regdate_wrong_date_format’] = ‘Registration Date format is incorrect. The correct format is DD/MM/YYYY HH:MM:SS (in 24 hr time format).’;[/php]
That’s not the correct format. The correct format is DD-MM-YYYY HH:MM:SS. Note the -‘s instead of the \.
Simple mistake which is now corrected.
Additionally, mentioning this format in the ACP, even before the error is triggered, just as how ‘New Password’ mentions stuff, seems like a good idea.
Not a bad idea so I did it.
I’ve now updated it to v1.0.1 and resubmitted the Mod which will hopefully be accepted into the MOD-DB.