1 頁 (共 1 頁)

[問題] 無法註冊新用戶 (已解決)

發表於 : 2004-05-06 06:42
影舞雪
安裝的mod

水怪+防具店+鞋店+頭盔店
cash mod
性別
虛擬形象\r

第一次無法註冊的時候有將 usercp_register.php 這個檔案用原始的 usercp_register.php 替換掉再重新修改\r
但安裝 性別 的時候,這個問題又浮現出來了
反覆的檢查了 usercp_register.php 的相關內容
但是找不出錯誤的地方....
沒有多加字也沒多減字
MySQL也不給個提示 :-o
真的像幾位之前有提出這個問題的前輩們一樣\r
找到眼睛....@@"
已經被這個問題困擾了兩天了 (找了兩天的資料)
還是不知道該怎麼解決\r
大師們幫幫忙吧 :-P


新註冊後出現的錯誤訊息如下

代碼: 選擇全部

Could not insert data into users table

DEBUG MODE

INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, 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, '1', user_gender, user_level, user_allow_pm, user_active, user_actkey) VALUES (3, 'beata', 1083795682, '4a7d1ed414474e4033ac29ccb8653d9b', 'plgih@hotmail.com', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 0, 1, 1, 0, 1, 1, 8, 'Y - m - d ( A h:i )', 'chinese_traditional_taiwan', 2, 0, 1, 0, 'c04bd4')

Line : 537
File : D:\Server\www\phpBB2\includes\usercp_register.php

usercp_register.php 相關內容
[php]<?php
//
// Get current date
//
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, 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, '$gender', user_gender, user_level, user_allow_pm, 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) . "', '" . 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, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
{
$user_actkey = gen_rand_string(true);
$key_len = 54 - (strlen($server_url));
$key_len = ( $key_len > 6 ) ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len);
$sql .= "0, '" . str_replace("\\'", "''", $user_actkey) . "')";
}
else
{
$sql .= "1, '')";
}

if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
}
?>[/php]

發表於 : 2004-05-06 07:06
shihchieh
user_style, '1', user_gender,

問題出在那個1,那邊是指定欄位名的地方,不該出現值

發表於 : 2004-05-06 15:20
影舞雪
謝謝 yuan 的指教
yuan 寫:user_style, '1', user_gender,

問題出在那個1,那邊是指定欄位名的地方,不該出現值
可是我是照著性別 1.25 的安裝說明去裝的

代碼: 選擇全部

############################################################## 
## MOD Title:          Gender 
## 外掛名稱: 性別 
## MOD Author:         Niels < ncr@db9.dk > (Niels Chr. R鷣) http://mods.db9.dk 
## 中文譯者: bu <buhip@yahoo.co.jp> 
## MOD Description:    This mod will add a Gender field into 
##                     users' profile. Il may display "Gender: |image|" 
##                     in posts too (optional). 
## 外掛說明: 在個人資料顯示性別(會顯示「性別:(圖形)」) 
##                 也可以在文章邊顯示(可不裝,選擇性) 
## MOD Version:        1.2.5 
## 外掛版本: 1.2.5 
## Compatibility:      2.0.5->2.0.6 
## 相容版本: phpBB 2.0.5 -> 2.0.6 
## 
## Installation Level: Moderate 
## 安裝難度:中等 
## Installation Time:  20 to 30 Minutes (1mn by EasyMOD of Nuttzy) 
## 安裝時間:20到30分鐘(如果用 Nuttzy 的 EasyMod,只要一分鐘) 
## Files To Edit:      8 + 3 optional 
## 要修改的檔案: 共 8 個+ 3 個(可不裝,選擇性) 
##      viewtopic.php (可不裝,選擇性) 
##      admin/admin_users.php 
##      includes/usercp_avatar.php 
##      includes/usercp_register.php 
##      includes/usercp_viewprofile.php 
##      language/lang_english/lang_main.php 
##      templates/SubSilver/profile_add_body.tpl 
##      templates/SubSilver/profile_view_body.tpl 
##      templates/subSliver/subSilver.cfg (可不裝,選擇性) 
##      templates/subSliver/viewtopic_body.tpl (可不裝,選擇性) 
##      templates/subSilver/admin/user_edit_body.tpl 
## 
## Included Files:     2 
## 內含 2 個檔案 
##      templates/subSliver/images/icon_minigender_male.gif 
##      templates/subSliver/images/icon_minigender_female.gif 
## 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/ 
## 
## 由於安全上的考量,請檢查: 
## http://www.phpbb.com/mods/downloads/ 是否有此外掛的最新版本 
## 從其他地方下載此檔可能會造成你在你的 phpBB 討論版上寫入有誤的程式碼 
## 基於這個理由,phpBB 將不會為沒有收藏在我們的外掛資料庫的外掛提供支援 
## 我們的外掛資料庫在 http://www.phpbb.com/mods/downloads/ 
## 
############################################################## 
## Author Notes: 
## 
## This MOD is compatible and can be installed by EasyMOD 
## of Nuttzy (but is not officially EasyMOD Compliant)! 
## http://www.phpbb.com/phpBB/viewtopic.php?t=124436 
## 
## 本外掛相容於 Nuttzy 所開發的 EasyMod(但並不和官方EasyMod相容) 
## http://www.phpbb.com/phpBB/viewtopic.php?t=124436 
## 
## However, on alpha releases of EM SQL commands are not performed! 
## Then, meanwhile beta or final release (with DB alterations 
## capabilities), you must update your database manually by 
## copying the gender_db_update.php file in your phpBB 
## root directory, execute it with your navigator and after, 
## delete it. 
## 
## 然而,在搶鮮版的 EM SQL 指令並不執行 
## 然後,也表示在公開測試版或最終版(有DB改變相容性的)之前 
## 你必須要手動地把 gender_db_update.php 檔傳到你的 phpBB根目錄 
## 並執行它,執行後請刪除 
## 
## In any case, if you install this MOD manually or using an 
## alpha release of EM, please run this file NOW, before 
## editing phpBB files by EM or manually!!! 
## Otherwise, you may have an error message during your next 
## connection. 
## 
## 如果你要用搶鮮版的 EasyMod 安裝的話,請立刻執行 gender_db_update.php 
## 在你要給 EasyMod 裝之前或你要自已裝之前,請先執行 gender_db_update.php 
## 要不然,你可能會在下一個連結時出現錯誤 
## 
## Moreover, the French language provide with this MOD can 
## be automatically installed too with EM 0.0.10a release. 
## So, if you need this language apply the instructions at the 
## bottom of the how-to manually. 
## 
## For updates, check this official link... 
## http://mods.db9.dk/viewforum.php?f=3 
## 
## 如要最新版,請到官方站去看 
## http://mods.db9.dk/viewforum.php?f=3 
## 
############################################################## 
## MOD History:  外掛紀錄 
## 
##   2003-08-05 - Version 1.2.5 
##      - Part 1 & part 2 merge in a single how-to 
##      - Add French translation 
##      - How-to rewrite to be EasyMOD compatible 
## 
##   ????-??-?? - Version 1.2.4 
##      - admin/admin_users.php added range check 
## 
##   ????-??-?? - Version 1.2.3 
##      - confirmed for phpBB2 ver 2.0.5. by "kooky", no change needed 
##      - changed for ver 2.0.4 
## 
##   ????-??-?? - Version 1.2.2 
##      - changed a FIND tag 
## 
##   ????-??-?? - Version 1.2.1 
##      - correct a type in the how-to 
## 
##   ????-??-?? - Version 1.2.0 
##      - fist release for phpBB2 ver 2.0.1 
##      - confirmed for phpBB2 ver 2.0.2 - no changes needed 
## 
##   ????-??-?? - Version 1.1.4 
##      - Last release for phpBB2 ver 2.0.0 
## 
##   ????-??-?? - Version 0.9.0 
##      - Initial release phpBB2 RC-1 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
## 在你加入這個外掛前,你應該把所有與這個外掛有關的檔案進行備份 
##############################################################
//////////////////////////////////////////////////////
# 
#-----[ FIND 尋找 ]------------------------------------------------ 
# 
$sql = "INSERT INTO " . USERS_TABLE . " 
VALUES 

# 
#-----[ IN-LINE FIND 在行中尋找 ]---------------------------------------- 
# 
, user_style 

# 
#-----[ IN-LINE AFTER, ADD 在行中找到後在後面加入 ]---------------------------------- 
# 
, '$gender' 

# 
#-----[ IN-LINE FIND 在行中尋找 ]---------------------------------------- 
# 
, $user_style 

//////////////////////////////////////////////////////////////////////////////
 
安裝說明上是寫 '$gender'
我又笨死了
不知道該改寫成什麼\r
想請問各位大師
如果 '$gender' 這樣的寫法是錯誤的
那麼應該要改成什麼呢??



發表於 : 2004-05-06 21:08
atthis

代碼: 選擇全部

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "INSERT INTO " . USERS_TABLE . "
VALUES

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, user_style

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, user_gender

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, $user_style

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, '$gender' 
可能是中文版的說明誤刪了
以上的英文版的說明,照著改回來就可以了

發表於 : 2004-05-07 17:30
影舞雪
感謝兩位大師
打擾你們了~
不過我試了還是無法成功
現在我把Phpbb全部移除再重新安裝看看吧\r

多謝囉~~

發表於 : 2004-05-10 07:53
影舞雪
atthis 寫:

代碼: 選擇全部

# 
#-----[ FIND ]------------------------------------------------ 
# 
$sql = "INSERT INTO " . USERS_TABLE . "
VALUES

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, user_style

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, user_gender

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
, $user_style

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
, '$gender' 
可能是中文版的說明誤刪了
以上的英文版的說明,照著改回來就可以了
呵~~
終於找到問題發生在哪囉
原來尋找\r
, $user_style (第二個)
的意思是找第二個 , $user_style
我以為是在, $user_style 後面連續加上兩個字串呢~

打擾各位囉~
謝謝你眠~