Seite 1 von 1

Probleme mit dem Birthday Mod

Verfasst: 20.10.2006 14:24
von Leo Navis
Moin,

Nachdem ich den Mod relativ erfolgreich eingebaut hab, versuch ich, im Profil das Alter einzustellen - nach Druck auf "Speichern" sagt er mir aber:
Could not update users table

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '6637', user_next_birthday_greeting = '2007'', user_sig = '', user_sig_bbcode_uid' at line 2

UPDATE phpbb_users SET user_email = 'navis@epforen.ch', user_icq = '228233111', user_website = '', user_occ = '', user_from = '', user_interests = ', user_birthday = '6637', user_next_birthday_greeting = '2007'', user_sig = '', user_sig_bbcode_uid = '', user_viewemail = 0, user_aim = '', user_yim = '', user_msnm = '', user_attachsig = 1, user_allowsmile = 1, user_allowhtml = 1, user_allowbbcode = 1, user_allow_viewonline = 1, user_notify = 0, user_notify_pm = 1, user_popup_pm = 1, user_timezone = 0, user_dateformat = 'd.m.Y, H:i', user_lang = 'german', user_style = 4, user_active = 1, user_actkey = '' WHERE user_id = 11

Line : 585
File : usercp_register.php
Wenn ich auf ACP gehe sagt er mir folgendes auf der Navigationsseite:
Parse error: syntax error, unexpected T_STRING in /srv/www/httpd/phost/f/de/pytalhost/flirtstylez/web/phpBB2/admin/admin_users.php on line 725
Bereich 689-738 in der admin_users.php:
// Start add - Birthday MOD
// find the birthday values, reflected by the $lang['Submit_date_format']
if ($b_day || $b_md || $b_year) //if a birthday is submited, then validate it
{
$user_age=(date('md')>=$b_md.(($b_day <= 9) ? '0':'').$b_day) ? date('Y') - $b_year : date('Y') - $b_year - 1 ;
// Check date, maximum / minimum user age
if (!checkdate($b_md,$b_day,$b_year))
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= $lang['Wrong_birthday_format'];
} else
if ($user_age>$board_config['max_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_high'],$board_config['max_user_age']);
} else
if ($user_age<$board_config['min_user_age'])
{
$error = TRUE;
if( isset($error_msg) )$error_msg .= "<br />";
$error_msg .= sprintf($lang['Birthday_to_low'],$board_config['min_user_age']);
} else
{
$birthday = ($error) ? $birthday : mkrealdate($b_day,$b_md,$b_year);
}
} else $birthday = ($error) ? '' : 999999;
// End add - Birthday MOD
//
// Update entry in DB
//
if( !$error )
{
$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_birthday='$birthday', user_next_birthday_greeting=$next_birthday_greeting, 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";

if( $result = $db->sql_query($sql) )
{
if( isset($rename_user) )
{
$sql = "UPDATE " . GROUPS_TABLE . "
SET group_name = '".str_replace("\'", "''", $rename_user)."'
WHERE group_name = '".str_replace("'", "''", $this_userdata['username'] )."'";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not rename users group', '', __LINE__, __FILE__, $sql);
}
}
Für Hilfe wäre ich sehr dankbar.

Verfasst: 20.10.2006 14:46
von Olli Oberhausen
Ich denke so sollte das sql in der admin users aussehen.
In der user_register.php ist ein hochkomma zu viel: user_next_birthday_greeting = '2007'', user_sig

Code: Alles auswählen

$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_birthday='$birthday', user_next_birthday_greeting=$next_birthday_greeting, 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"; 

Verfasst: 20.10.2006 14:53
von Leo Navis
Ich habs geändert, jetzt kommt "nur" noch:
Could not update users table

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '6666', user_next_birthday_greeting = '2007', user_sig = '', user_sig_bbcode_uid ' at line 2

UPDATE phpbb_users SET user_email = 'navis@epforen.ch', user_icq = '228233111', user_website = '', user_occ = '', user_from = '', user_interests = ', user_birthday = '6666', user_next_birthday_greeting = '2007', user_sig = '', user_sig_bbcode_uid = '', user_viewemail = 0, user_aim = '', user_yim = '', user_msnm = '', user_attachsig = 1, user_allowsmile = 1, user_allowhtml = 1, user_allowbbcode = 1, user_allow_viewonline = 1, user_notify = 0, user_notify_pm = 1, user_popup_pm = 1, user_timezone = 0, user_dateformat = 'd.m.Y, H:i', user_lang = 'german', user_style = 4, user_active = 1, user_actkey = '' WHERE user_id = 11

Line : 585
File : usercp_register.php
Aber danke schon mal für die Hilfe. ;)

Verfasst: 20.10.2006 14:56
von MTV-King
gehe ins phpmyadmin.
dann bei phpbb2_users darin lege ne neuespalte namens user_birth an.
hatte den (fast) gleichen fehler :wink:

Verfasst: 20.10.2006 15:01
von Olli Oberhausen
MTV-King hat geschrieben:gehe ins phpmyadmin.
dann bei phpbb2_users darin lege ne neuespalte namens user_birth an.
hatte den (fast) gleichen fehler :wink:
Nee, lass mal, brauchste nicht. Das hoch komma was erst zu viel wa fehlt jetzt hier: user_interests = ', use

Verfasst: 20.10.2006 15:11
von Leo Navis
Okay, das mit dem Alter funktioniert jetzt, vielen Dank!

Hat jemand 'ne Idee, warum das ACP nicht mitspielt?

Verfasst: 20.10.2006 15:15
von Olli Oberhausen
Steht doch da oben ^^

Olli

Verfasst: 20.10.2006 15:21
von Leo Navis
Ohja, glatt übersehen ...

:D

Vielen Dank, jetzt geht alles!