[問題]vault股市外掛
版主: 版主管理群
代碼: 選擇全部
Couldn't insert new stock
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 ' 12345, 12345, 12345, 12345)' at line 2
INSERT INTO phpbb_vault_exchange (stock_id, stock_name, stock_desc,stock_total,stock_price,stock_previous_price,stock_worst_price,stock_best_price) VALUES ( 5, '4445' , '233' ,, 12345, 12345, 12345, 12345)
Line : 253
File : c:\program files\easyphp1-7\www\cash_testing\admin\admin_vault_exchange.php
重装了也不行~
不知有無關係,但我發現\r
http://phpbb-tw.net/phpbb/viewtopic.php?t=24523
這裡有個問題,就是改完後台管理張數就發不到新股\r
於是我就把stock_total補回進admin_vault_exchange.php裡面啦\r
放的位置是\r
$sql = "INSERT INTO " . VAULT_EXCHANGE_TABLE . " (stock_id, stock_name, stock_desc, stock_total, stock_price,stock_previous_price,stock_worst_price,stock_best_price)
我是超新手
接觸了php剛兩天
但分享一下經驗給其他新的「老手」啦\r
我發股時見到一大堆錯誤文字
於是先查一下是甚麼檔案
然後按文字內容,發現是因為張數的數字找不到對應
於是我便把stock_total加進這一系列的開頭\
但又發現完全錯位喎
於是我便逐一對照下一行
主要發現下面是計算的,而上面則是將結果交回去的
感覺就像下面的人在做考卷,上面的是行長負責收卷\r
然後就找到$stock_total這個代數\r
便在上面的相應位置放進stock_total
希望高手賜正(從來未學過電腦啦,專用名詞無可能識啦,原諒一下啦^^)
http://phpbb-tw.net/phpbb/viewtopic.php?t=24523
這裡有個問題,就是改完後台管理張數就發不到新股\r
於是我就把stock_total補回進admin_vault_exchange.php裡面啦\r
放的位置是\r
$sql = "INSERT INTO " . VAULT_EXCHANGE_TABLE . " (stock_id, stock_name, stock_desc, stock_total, stock_price,stock_previous_price,stock_worst_price,stock_best_price)
我是超新手
接觸了php剛兩天
但分享一下經驗給其他新的「老手」啦\r
我發股時見到一大堆錯誤文字
於是先查一下是甚麼檔案
然後按文字內容,發現是因為張數的數字找不到對應
於是我便把stock_total加進這一系列的開頭\
但又發現完全錯位喎
於是我便逐一對照下一行
主要發現下面是計算的,而上面則是將結果交回去的
感覺就像下面的人在做考卷,上面的是行長負責收卷\r
然後就找到$stock_total這個代數\r
便在上面的相應位置放進stock_total
希望高手賜正(從來未學過電腦啦,專用名詞無可能識啦,原諒一下啦^^)
http://www.hooky.org/forum/
罰抄皇朝政事堂
罰抄皇朝政事堂
我不是在騙post!
只是忘了post ja
想回一下上面有關買進賣出的那位呀
這個好像是有幾個代數的位置亂了呀
(持有張數無可能有選擇,但賣出不能選)
我是改語系檔的
把賣出變成持有張數\r
持有張數變成買進\r
買進變成賣出\r
只改中文字喔
改錯有問題唔好懶我
有興趣上我個新壇睇下啦\r
(係我個壇註冊,一定要改性別,不然……\r
發現級別是……\r
刑餘之人時,哈哈,不要怪我啊)
刑餘是甚麼?古者之閹刑也!哈哈
只是忘了post ja
想回一下上面有關買進賣出的那位呀
這個好像是有幾個代數的位置亂了呀
(持有張數無可能有選擇,但賣出不能選)
我是改語系檔的
把賣出變成持有張數\r
持有張數變成買進\r
買進變成賣出\r
只改中文字喔
改錯有問題唔好懶我
有興趣上我個新壇睇下啦\r
(係我個壇註冊,一定要改性別,不然……\r
發現級別是……\r
刑餘之人時,哈哈,不要怪我啊)
刑餘是甚麼?古者之閹刑也!哈哈
http://www.hooky.org/forum/
罰抄皇朝政事堂
罰抄皇朝政事堂
-
- 星球普通子民
- 文章: 13
- 註冊時間: 2003-07-22 16:50
- 來自: ANC
- 聯繫:
關於 顯示 股票購買價 中\r
尋找
取代為\r
經本站會員反應...購買價...有時會亂跳...當初購買價...會變成購買的總價(購買價×購買張數)...
於是我就改成這樣:
很像正常了...但是自己也不太懂程式...如果亂改.....請各位提出糾正...
尋找
代碼: 選擇全部
$rsql = "INSERT INTO " . VAULT_EXCHANGE_USERS_TABLE ."
( stock_id , user_id , stock_amount)
VALUES ( ".$items[$i]['stock_id']." , $user_id , $prize)";
代碼: 選擇全部
$rsql = "INSERT INTO " . VAULT_EXCHANGE_USERS_TABLE ."
( stock_id , user_id , stock_amount , stock_price)
VALUES ( ".$items[$i]['stock_id']." , $user_id , $prize , $price)";
於是我就改成這樣:
代碼: 選擇全部
$rsql = "INSERT INTO " . VAULT_EXCHANGE_USERS_TABLE ."
( stock_id , user_id , stock_amount , stock_price)
VALUES ( ".$items[$i]['stock_id']." , $user_id , $prize , ".$items[$i]['stock_price'].")";
動機:其實會有那麼多問題,都是因為我故意的 我想拋磚引玉呀~
眾人:明明就是錯誤還硬掰
---------
好啦好啦,我先去看看,應該用的人還不多吧,我直接修改原文了,謝謝你們 ^^
眾人:明明就是錯誤還硬掰
---------
好啦好啦,我先去看看,應該用的人還不多吧,我直接修改原文了,謝謝你們 ^^
非官方外掛問題區公告: [必看]請配合發問格式及明確主題發問(2006 02/24更新)
七點要求:
1. 發問前先搜尋,確定沒有重複後再發表
2. 主題要明確
3. 依照發問格式
4. 禁連續推文
5. 請盡量減少使用地方性語言
6. 解決問題後請修改第一篇主題,並感謝曾經幫過你的前輩們 ^^
7. 請不要將檔案內容完整貼出喔! 只要提供問題行及上下各五行就可以了
七點要求:
1. 發問前先搜尋,確定沒有重複後再發表
2. 主題要明確
3. 依照發問格式
4. 禁連續推文
5. 請盡量減少使用地方性語言
6. 解決問題後請修改第一篇主題,並感謝曾經幫過你的前輩們 ^^
7. 請不要將檔案內容完整貼出喔! 只要提供問題行及上下各五行就可以了
你的意思是要把!!銀行併入水怪~~還是把貨幣種類改成跟水怪一樣的??andywang2 寫:有沒有讓股市的銀行與水怪RPG銀行結合阿....
是要怎麼改程式碼
哈哈~多站多管~協助管理.架設論壇.架設購物車
兔子星球:http://www.bunnycity.com
戀兔小站:http://www.bunnyshop.com
hi3b民宿:http://www.hi3b.com
東照山關帝廟:http://www.djsm.org
女巫神算館:http://www.skycatwitch.co
重點~虛擬主機:http://host.1015.net/HOST.htm
兔子星球:http://www.bunnycity.com
戀兔小站:http://www.bunnyshop.com
hi3b民宿:http://www.hi3b.com
東照山關帝廟:http://www.djsm.org
女巫神算館:http://www.skycatwitch.co
重點~虛擬主機:http://host.1015.net/HOST.htm
是...lang_vault有問題嗎?罰抄 寫:我不是在騙post!
只是忘了post ja
想回一下上面有關買進賣出的那位呀
這個好像是有幾個代數的位置亂了呀
(持有張數無可能有選擇,但賣出不能選)
我是改語系檔的
把賣出變成持有張數\r
持有張數變成買進\r
買進變成賣出\r
只改中文字喔
改錯有問題唔好懶我
有興趣上我個新壇睇下啦\r
(係我個壇註冊,一定要改性別,不然……\r
發現級別是……\r
刑餘之人時,哈哈,不要怪我啊)
刑餘是甚麼?古者之閹刑也!哈哈
我這邊使用上沒有問題呢....
還是.TPL上面排列的問題呢?!
安装了股票的数量外挂我不能增加新股了!!~~~
重装了也不行~
这是我修改后的可以帮我看看那里发生错误
重装了也不行~
代碼: 選擇全部
Couldn't insert new stock
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 ' 12345, 12345, 12345, 12345)' at line 2
INSERT INTO phpbb_vault_exchange (stock_id, stock_name, stock_desc,stock_total,stock_price,stock_previous_price,stock_worst_price,stock_best_price) VALUES ( 5, '4445' , '233' ,, 12345, 12345, 12345, 12345)
Line : 253
File : c:\program files\easyphp1-7\www\cash_testing\admin\admin_vault_exchange.php
这是我修改后的可以帮我看看那里发生错误
代碼: 選擇全部
<?php
/***************************************************************************
* admin_vault_exchange.php
* ------------------
* begin : 10/01/2004
*
*
***************************************************************************/
if( !empty($setmodules) )
{
$file = basename(__FILE__);
$module['Vault']['Vault_exchange'] = $file;
return;
}
define('IN_PHPBB', true);
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require("pagestart.$phpEx");
$template->set_filenames(array(
'body' => 'admin/config_vault_exchange_body.tpl')
);
$submit = isset($HTTP_POST_VARS['submit']);
$sql = "SELECT *
FROM " . VAULT_GENERAL_TABLE ;
if(!$result = $db->sql_query($sql))
{
message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$vault[$row['config_name']] = $row['config_value'];
}
if ( $submit )
{
$use = intval ( $HTTP_POST_VARS['use']);
$min = intval ( $HTTP_POST_VARS['min']);
$max = intval ( $HTTP_POST_VARS['max']);
$time = intval ( $HTTP_POST_VARS['time']);
$lsql= "UPDATE ". CONFIG_TABLE . " SET config_value = '$use' WHERE config_name = 'stock_use' ";
if ( !($lresult = $db->sql_query($lsql)) )
{
message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql);
}
$lsql= "UPDATE ". VAULT_GENERAL_TABLE . " SET config_value = '$min' WHERE config_name = 'stock_min_change' ";
if ( !($lresult = $db->sql_query($lsql)) )
{
message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql);
}
$lsql= "UPDATE ". VAULT_GENERAL_TABLE . " SET config_value = '$max' WHERE config_name = 'stock_max_change' ";
if ( !($lresult = $db->sql_query($lsql)) )
{
message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql);
}
$lsql= "UPDATE ". CONFIG_TABLE . " SET config_value = '$time' WHERE config_name = 'stock_time' ";
if ( !($lresult = $db->sql_query($lsql)) )
{
message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql);
}
vault_update_general_config();
message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_updated_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']);
}
if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
else
{
$mode = "";
}
if( isset($HTTP_POST_VARS['add']) || isset($HTTP_GET_VARS['add']) )
{
$template->set_filenames(array(
"body" => 'admin/config_vault_exchange_add_body.tpl')
);
$template->assign_block_vars('exchange_add',array());
$s_hidden_fields = '<input type="hidden" name="mode" value="savenew" />';
$template->assign_vars(array(
'L_VAULT_EXCHANGE_ADD_SETTINGS' => $lang['Vault_exchange_settings_add'],
'L_VAULT_EXCHANGE_ADD_SETTINGS_EXPLAIN' => $lang['Vault_exchange_settings_explain_add'],
'L_STOCK_EXCHANGE_ACTIONS_ADD' => $lang['Vault_exchange_actions_add'],
'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'],
'L_STOCK_DESC' => $lang['Vault_exchange_actions_desc'],
'L_STOCK_AMOUNT' => $lang['Vault_exchange_actions_amount'],
"S_HIDDEN_FIELDS" => $s_hidden_fields)
);
}
else if ( $mode != "" )
{
switch( $mode )
{
case 'delete':
$stock_id = ( !empty($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id'];
$sql = "SELECT * FROM " . VAULT_EXCHANGE_USERS_TABLE . "
WHERE stock_id = " . $stock_id;
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $sql);
}
$users = $db->sql_fetchrowset($result);
for ( $i = 0 ; $i < count ( $users ) ; $i ++ )
{
$ssql = "SELECT stock_price FROM " . VAULT_EXCHANGE_TABLE . "
WHERE stock_id = " . $stock_id;
$sresult = $db->sql_query($ssql);
if( !$sresult )
{
message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $ssql);
}
$prize = $db->sql_fetchrow($sresult);
$price = $prize['stock_price'] * $users[$i]['stock_amount'];
$usql = "UPDATE " . USERS_TABLE . "
SET user_points = user_points + $price
WHERE user_id = ".$users[$i]['user_id'];
$uresult = $db->sql_query($usql);
if( !$uresult )
{
message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $usql);
}
}
$sql = "DELETE FROM " . VAULT_EXCHANGE_USERS_TABLE . "
WHERE stock_id = " . $stock_id;
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $sql);
}
$sql = "DELETE FROM " . VAULT_EXCHANGE_TABLE . "
WHERE stock_id = " . $stock_id;
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $sql);
}
message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_deleted_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']);
break;
case 'edit':
$stock_id = ( !empty($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id'];
$sql = "SELECT *
FROM " . VAULT_EXCHANGE_TABLE . "
WHERE stock_id = " . $stock_id;
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, 'Could not obtain stock exchange information', "", __LINE__, __FILE__, $sql);
}
$stock_data = $db->sql_fetchrow($result);
$template->set_filenames(array(
"body" => 'admin/config_vault_exchange_add_body.tpl')
);
$template->assign_block_vars('exchange_edit',array());
$s_hidden_fields = '<input type="hidden" name="mode" value="save" /><input type="hidden" name="stock_id" value="' . $stock_data['stock_id'] . '" />';
$template->assign_vars(array(
'STOCK_NAME' => $stock_data['stock_name'],
'STOCK_TOTAL' => $stock_data['stock_total'],
'L_STOCK_TOTAL' => $lang['Vault_exchange_stock_total'],
'STOCK_DESC' => $stock_data['stock_desc'],
'STOCK_AMOUNT' => $stock_data['stock_price'],
'L_STOCK_EXCHANGE_ACTIONS_EDIT' => $lang['Vault_exchange_actions_edit'],
'L_VAULT_EXCHANGE_EDIT_SETTINGS' => $lang['Vault_exchange_settings_edit'],
'L_VAULT_EXCHANGE_EDIT_SETTINGS_EXPLAIN' => $lang['Vault_exchange_settings_explain_edit'],
'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'],
'L_STOCK_DESC' => $lang['Vault_exchange_actions_desc'],
'L_STOCK_AMOUNT' => $lang['Vault_exchange_actions_amount'],
"S_HIDDEN_FIELDS" => $s_hidden_fields)
);
break;
case "save":
$stock_name = ( isset($HTTP_POST_VARS['stock_name']) ) ? trim($HTTP_POST_VARS['stock_name']) : trim($HTTP_GET_VARS['stock_name']);
$stock_desc = ( isset($HTTP_POST_VARS['stock_desc']) ) ? trim($HTTP_POST_VARS['stock_desc']) : trim($HTTP_GET_VARS['stock_desc']);
$stock_price = ( isset($HTTP_POST_VARS['stock_price']) ) ? intval($HTTP_POST_VARS['stock_price']) : intval($HTTP_GET_VARS['stock_price']);
$stock_total = ( isset($HTTP_POST_VARS['stock_total']) ) ? intval($HTTP_POST_VARS['stock_total']) : intval($HTTP_GET_VARS['stock_total']);
$stock_id = ( isset($HTTP_POST_VARS['stock_id']) ) ? intval($HTTP_POST_VARS['stock_id']) : intval($HTTP_GET_VARS['stock_id']);
if ($stock_name == '' || $stock_desc == '' || $stock_price == '' || $stock_total == '')
{
message_die(MESSAGE, $lang['Fields_empty']);
}
$sql = "UPDATE " . VAULT_EXCHANGE_TABLE . "
SET stock_name = '" . str_replace("\'", "''", $stock_name) . "',
stock_desc = '" . str_replace("\'", "''", $stock_desc) . "',
stock_total = $stock_total,
stock_price = $stock_price
WHERE stock_id = " . $stock_id;
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't update stock", "", __LINE__, __FILE__, $sql);
}
message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_edited_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']);
break;
case "savenew":
$sql = "SELECT *
FROM " . VAULT_EXCHANGE_TABLE ."
ORDER BY stock_id
DESC LIMIT 1";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, 'Could not obtain stock exchange information', "", __LINE__, __FILE__, $sql);
}
$stock_data = $db->sql_fetchrow($result);
$stock_name = ( isset($HTTP_POST_VARS['stock_name']) ) ? trim($HTTP_POST_VARS['stock_name']) : trim($HTTP_GET_VARS['stock_name']);
$stock_desc = ( isset($HTTP_POST_VARS['stock_desc']) ) ? trim($HTTP_POST_VARS['stock_desc']) : trim($HTTP_GET_VARS['stock_desc']);
$stock_price = ( isset($HTTP_POST_VARS['stock_price']) ) ? intval($HTTP_POST_VARS['stock_price']) : intval($HTTP_GET_VARS['stock_price']);
$stock_id = $stock_data['stock_id'] +1;
if ($stock_name == '' || $stock_desc == '' || $stock_price == '' )
{
message_die(MESSAGE, $lang['Fields_empty']);
}
$sql = "INSERT INTO " . VAULT_EXCHANGE_TABLE . " (stock_id, stock_name, stock_desc,stock_total,stock_price,stock_previous_price,stock_worst_price,stock_best_price)
VALUES ( $stock_id, '" . str_replace("\'", "''", $stock_name) . "' , '" . str_replace("\'", "''", $stock_desc) . "' ,$stock_total, $stock_price, $stock_price, $stock_price, $stock_price)";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't insert new stock", "", __LINE__, __FILE__, $sql);
}
message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_added_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']);
break;
}
}
else
{
$sql = "SELECT *
FROM " . VAULT_EXCHANGE_TABLE ."
ORDER BY stock_id ";
$result = $db->sql_query($sql);
if( !$result )
{
message_die(GENERAL_ERROR, "Couldn't obtain stock exchange from database", "", __LINE__, __FILE__, $sql);
}
$exchange = $db->sql_fetchrowset($result);
for($i = 0; $i < count($exchange); $i++)
{
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];\r
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$stock_name = isset($lang[$exchange[$i]['stock_name']]) ? $lang[$exchange[$i]['stock_name']] : $exchange[$i]['stock_name'];
$stock_desc = isset($lang[$exchange[$i]['stock_desc']]) ? $lang[$exchange[$i]['stock_desc']] : $exchange[$i]['stock_desc'];
$template->assign_block_vars("exchange", array(
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"STOCK_NAME" => $stock_name,
"STOCK_DESC" => $stock_desc,
"STOCK_AMOUNT" => $exchange[$i]['stock_price'],
"U_STOCK_EDIT" => append_sid("admin_vault_exchange.$phpEx?mode=edit&id=" . $exchange[$i]['stock_id']),
"U_STOCK_DELETE" => append_sid("admin_vault_exchange.$phpEx?mode=delete&id=" . $exchange[$i]['stock_id']))
);
}
$template->assign_vars(array(
'L_STOCK_EXCHANGE_ACTIONS' => $lang['Vault_exchange_actions'],
'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'],
'L_STOCK_DESC' => $lang['Vault_exchange_actions_desc'],
'L_STOCK_AMOUNT' => $lang['Vault_exchange_actions_amount'],
'L_ACTION' => $lang['Vault_exchange_action'],
'L_EDIT' => $lang['Vault_exchange_edit'],
'L_DELETE' => $lang['Vault_exchange_delete'],
'L_STOCK_ADD' => $lang['Vault_exchange_actions_add'],
));
}
$template->assign_vars(array(
'VAULT_EXCHANGE_USE_CHECKED' => ( $board_config['stock_use'] ? 'CHECKED' :'' ),
'VAULT_EXCHANGE_TIME' => $board_config['stock_time'],
'VAULT_EXCHANGE_TIME_EXPLAIN' => $lang['Vault_time_explain'].vault_make_time($board_config['stock_time']),
'VAULT_EXCHANGE_MAX' => $vault['stock_max_change'],
'VAULT_EXCHANGE_MIN' => $vault['stock_min_change'],
'L_VAULT_EXCHANGE_LANGUAGE_KEY' => $lang['Vault_language_key'],
'L_VAULT_EXCHANGE_SETTINGS' => $lang['Vault_exchange_settings'],
'L_VAULT_EXCHANGE_SETTINGS_EXPLAIN' => $lang['Vault_exchange_settings_explain'],
'L_VAULT_EXCHANGE_USE' => $lang['Vault_exchange_use'],
'L_VAULT_EXCHANGE_MIN' => $lang['Vault_exchange_min'],
'L_VAULT_EXCHANGE_MIN_EXPLAIN' => $lang['Vault_exchange_min_explain'],
'L_VAULT_EXCHANGE_MAX' => $lang['Vault_exchange_max'],
'L_VAULT_EXCHANGE_MAX_EXPLAIN' => $lang['Vault_exchange_max_explain'],
'L_VAULT_EXCHANGE_TIME' => $lang['Vault_exchange_time'],
'L_VAULT_EXCHANGE_TIME_EXPLAIN' => $lang['Vault_exchange_time_explain'],
'L_SUBMIT' => $lang['Submit'],
'S_VAULT_ACTION' => append_sid(basename(__FILE__)),
"S_HIDDEN_FIELDS" => $s_hidden_fields)
);
$template->pparse('body');
include('./page_footer_admin.'.$phpEx);
?>
-
- 星球普通子民
- 文章: 13
- 註冊時間: 2003-07-22 16:50
- 來自: ANC
- 聯繫:
如果猜得沒錯...jikey 寫:安装了股票的数量外挂我不能增加新股了!!~~~
重装了也不行~
代碼: 選擇全部
Couldn't insert new stock 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 ' 12345, 12345, 12345, 12345)' at line 2 INSERT INTO phpbb_vault_exchange (stock_id, stock_name, stock_desc,stock_total,stock_price,stock_previous_price,stock_worst_price,stock_best_price) VALUES ( 5, '4445' , '233' ,, 12345, 12345, 12345, 12345) Line : 253 File : c:\program files\easyphp1-7\www\cash_testing\admin\admin_vault_exchange.php
这是我修改后的可以帮我看看那里发生错误代碼: 選擇全部
<?php /*************************************************************************** * admin_vault_exchange.php * ------------------ * begin : 10/01/2004 * * ***************************************************************************/ if( !empty($setmodules) ) { $file = basename(__FILE__); $module['Vault']['Vault_exchange'] = $file; return; } define('IN_PHPBB', true); $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require("pagestart.$phpEx"); $template->set_filenames(array( 'body' => 'admin/config_vault_exchange_body.tpl') ); $submit = isset($HTTP_POST_VARS['submit']); $sql = "SELECT * FROM " . VAULT_GENERAL_TABLE ; if(!$result = $db->sql_query($sql)) { message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $vault[$row['config_name']] = $row['config_value']; } if ( $submit ) { $use = intval ( $HTTP_POST_VARS['use']); $min = intval ( $HTTP_POST_VARS['min']); $max = intval ( $HTTP_POST_VARS['max']); $time = intval ( $HTTP_POST_VARS['time']); $lsql= "UPDATE ". CONFIG_TABLE . " SET config_value = '$use' WHERE config_name = 'stock_use' "; if ( !($lresult = $db->sql_query($lsql)) ) { message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql); } $lsql= "UPDATE ". VAULT_GENERAL_TABLE . " SET config_value = '$min' WHERE config_name = 'stock_min_change' "; if ( !($lresult = $db->sql_query($lsql)) ) { message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql); } $lsql= "UPDATE ". VAULT_GENERAL_TABLE . " SET config_value = '$max' WHERE config_name = 'stock_max_change' "; if ( !($lresult = $db->sql_query($lsql)) ) { message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql); } $lsql= "UPDATE ". CONFIG_TABLE . " SET config_value = '$time' WHERE config_name = 'stock_time' "; if ( !($lresult = $db->sql_query($lsql)) ) { message_die(GENERAL_ERROR, $lang['Vault_update_error'] , "", __LINE__, __FILE__, $lsql); } vault_update_general_config(); message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_updated_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']); } if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } else { $mode = ""; } if( isset($HTTP_POST_VARS['add']) || isset($HTTP_GET_VARS['add']) ) { $template->set_filenames(array( "body" => 'admin/config_vault_exchange_add_body.tpl') ); $template->assign_block_vars('exchange_add',array()); $s_hidden_fields = '<input type="hidden" name="mode" value="savenew" />'; $template->assign_vars(array( 'L_VAULT_EXCHANGE_ADD_SETTINGS' => $lang['Vault_exchange_settings_add'], 'L_VAULT_EXCHANGE_ADD_SETTINGS_EXPLAIN' => $lang['Vault_exchange_settings_explain_add'], 'L_STOCK_EXCHANGE_ACTIONS_ADD' => $lang['Vault_exchange_actions_add'], 'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'], 'L_STOCK_DESC' => $lang['Vault_exchange_actions_desc'], 'L_STOCK_AMOUNT' => $lang['Vault_exchange_actions_amount'], "S_HIDDEN_FIELDS" => $s_hidden_fields) ); } else if ( $mode != "" ) { switch( $mode ) { case 'delete': $stock_id = ( !empty($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id']; $sql = "SELECT * FROM " . VAULT_EXCHANGE_USERS_TABLE . " WHERE stock_id = " . $stock_id; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $sql); } $users = $db->sql_fetchrowset($result); for ( $i = 0 ; $i < count ( $users ) ; $i ++ ) { $ssql = "SELECT stock_price FROM " . VAULT_EXCHANGE_TABLE . " WHERE stock_id = " . $stock_id; $sresult = $db->sql_query($ssql); if( !$sresult ) { message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $ssql); } $prize = $db->sql_fetchrow($sresult); $price = $prize['stock_price'] * $users[$i]['stock_amount']; $usql = "UPDATE " . USERS_TABLE . " SET user_points = user_points + $price WHERE user_id = ".$users[$i]['user_id']; $uresult = $db->sql_query($usql); if( !$uresult ) { message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $usql); } } $sql = "DELETE FROM " . VAULT_EXCHANGE_USERS_TABLE . " WHERE stock_id = " . $stock_id; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $sql); } $sql = "DELETE FROM " . VAULT_EXCHANGE_TABLE . " WHERE stock_id = " . $stock_id; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, "Couldn't delete stock", "", __LINE__, __FILE__, $sql); } message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_deleted_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']); break; case 'edit': $stock_id = ( !empty($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id']; $sql = "SELECT * FROM " . VAULT_EXCHANGE_TABLE . " WHERE stock_id = " . $stock_id; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, 'Could not obtain stock exchange information', "", __LINE__, __FILE__, $sql); } $stock_data = $db->sql_fetchrow($result); $template->set_filenames(array( "body" => 'admin/config_vault_exchange_add_body.tpl') ); $template->assign_block_vars('exchange_edit',array()); $s_hidden_fields = '<input type="hidden" name="mode" value="save" /><input type="hidden" name="stock_id" value="' . $stock_data['stock_id'] . '" />'; $template->assign_vars(array( 'STOCK_NAME' => $stock_data['stock_name'], 'STOCK_TOTAL' => $stock_data['stock_total'], 'L_STOCK_TOTAL' => $lang['Vault_exchange_stock_total'], 'STOCK_DESC' => $stock_data['stock_desc'], 'STOCK_AMOUNT' => $stock_data['stock_price'], 'L_STOCK_EXCHANGE_ACTIONS_EDIT' => $lang['Vault_exchange_actions_edit'], 'L_VAULT_EXCHANGE_EDIT_SETTINGS' => $lang['Vault_exchange_settings_edit'], 'L_VAULT_EXCHANGE_EDIT_SETTINGS_EXPLAIN' => $lang['Vault_exchange_settings_explain_edit'], 'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'], 'L_STOCK_DESC' => $lang['Vault_exchange_actions_desc'], 'L_STOCK_AMOUNT' => $lang['Vault_exchange_actions_amount'], "S_HIDDEN_FIELDS" => $s_hidden_fields) ); break; case "save": $stock_name = ( isset($HTTP_POST_VARS['stock_name']) ) ? trim($HTTP_POST_VARS['stock_name']) : trim($HTTP_GET_VARS['stock_name']); $stock_desc = ( isset($HTTP_POST_VARS['stock_desc']) ) ? trim($HTTP_POST_VARS['stock_desc']) : trim($HTTP_GET_VARS['stock_desc']); $stock_price = ( isset($HTTP_POST_VARS['stock_price']) ) ? intval($HTTP_POST_VARS['stock_price']) : intval($HTTP_GET_VARS['stock_price']); $stock_total = ( isset($HTTP_POST_VARS['stock_total']) ) ? intval($HTTP_POST_VARS['stock_total']) : intval($HTTP_GET_VARS['stock_total']); $stock_id = ( isset($HTTP_POST_VARS['stock_id']) ) ? intval($HTTP_POST_VARS['stock_id']) : intval($HTTP_GET_VARS['stock_id']); if ($stock_name == '' || $stock_desc == '' || $stock_price == '' || $stock_total == '') { message_die(MESSAGE, $lang['Fields_empty']); } $sql = "UPDATE " . VAULT_EXCHANGE_TABLE . " SET stock_name = '" . str_replace("\'", "''", $stock_name) . "', stock_desc = '" . str_replace("\'", "''", $stock_desc) . "', stock_total = $stock_total, stock_price = $stock_price WHERE stock_id = " . $stock_id; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, "Couldn't update stock", "", __LINE__, __FILE__, $sql); } message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_edited_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']); break; case "savenew": $sql = "SELECT * FROM " . VAULT_EXCHANGE_TABLE ." ORDER BY stock_id DESC LIMIT 1"; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, 'Could not obtain stock exchange information', "", __LINE__, __FILE__, $sql); } $stock_data = $db->sql_fetchrow($result); $stock_name = ( isset($HTTP_POST_VARS['stock_name']) ) ? trim($HTTP_POST_VARS['stock_name']) : trim($HTTP_GET_VARS['stock_name']); $stock_desc = ( isset($HTTP_POST_VARS['stock_desc']) ) ? trim($HTTP_POST_VARS['stock_desc']) : trim($HTTP_GET_VARS['stock_desc']); $stock_price = ( isset($HTTP_POST_VARS['stock_price']) ) ? intval($HTTP_POST_VARS['stock_price']) : intval($HTTP_GET_VARS['stock_price']); $stock_id = $stock_data['stock_id'] +1; if ($stock_name == '' || $stock_desc == '' || $stock_price == '' ) { message_die(MESSAGE, $lang['Fields_empty']); } $sql = "INSERT INTO " . VAULT_EXCHANGE_TABLE . " (stock_id, stock_name, stock_desc,stock_total,stock_price,stock_previous_price,stock_worst_price,stock_best_price) VALUES ( $stock_id, '" . str_replace("\'", "''", $stock_name) . "' , '" . str_replace("\'", "''", $stock_desc) . "' ,$stock_total, $stock_price, $stock_price, $stock_price, $stock_price)"; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, "Couldn't insert new stock", "", __LINE__, __FILE__, $sql); } message_die(GENERAL_MESSAGE, sprintf($lang['Vault_exchange_added_return_settings'], '<a href="' . append_sid(basename(__FILE__)) . '">', '</a>'), $lang['Vault_settings']); break; } } else { $sql = "SELECT * FROM " . VAULT_EXCHANGE_TABLE ." ORDER BY stock_id "; $result = $db->sql_query($sql); if( !$result ) { message_die(GENERAL_ERROR, "Couldn't obtain stock exchange from database", "", __LINE__, __FILE__, $sql); } $exchange = $db->sql_fetchrowset($result); for($i = 0; $i < count($exchange); $i++) { $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; $stock_name = isset($lang[$exchange[$i]['stock_name']]) ? $lang[$exchange[$i]['stock_name']] : $exchange[$i]['stock_name']; $stock_desc = isset($lang[$exchange[$i]['stock_desc']]) ? $lang[$exchange[$i]['stock_desc']] : $exchange[$i]['stock_desc']; $template->assign_block_vars("exchange", array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, "STOCK_NAME" => $stock_name, "STOCK_DESC" => $stock_desc, "STOCK_AMOUNT" => $exchange[$i]['stock_price'], "U_STOCK_EDIT" => append_sid("admin_vault_exchange.$phpEx?mode=edit&id=" . $exchange[$i]['stock_id']), "U_STOCK_DELETE" => append_sid("admin_vault_exchange.$phpEx?mode=delete&id=" . $exchange[$i]['stock_id'])) ); } $template->assign_vars(array( 'L_STOCK_EXCHANGE_ACTIONS' => $lang['Vault_exchange_actions'], 'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'], 'L_STOCK_DESC' => $lang['Vault_exchange_actions_desc'], 'L_STOCK_AMOUNT' => $lang['Vault_exchange_actions_amount'], 'L_ACTION' => $lang['Vault_exchange_action'], 'L_EDIT' => $lang['Vault_exchange_edit'], 'L_DELETE' => $lang['Vault_exchange_delete'], 'L_STOCK_ADD' => $lang['Vault_exchange_actions_add'], )); } $template->assign_vars(array( 'VAULT_EXCHANGE_USE_CHECKED' => ( $board_config['stock_use'] ? 'CHECKED' :'' ), 'VAULT_EXCHANGE_TIME' => $board_config['stock_time'], 'VAULT_EXCHANGE_TIME_EXPLAIN' => $lang['Vault_time_explain'].vault_make_time($board_config['stock_time']), 'VAULT_EXCHANGE_MAX' => $vault['stock_max_change'], 'VAULT_EXCHANGE_MIN' => $vault['stock_min_change'], 'L_VAULT_EXCHANGE_LANGUAGE_KEY' => $lang['Vault_language_key'], 'L_VAULT_EXCHANGE_SETTINGS' => $lang['Vault_exchange_settings'], 'L_VAULT_EXCHANGE_SETTINGS_EXPLAIN' => $lang['Vault_exchange_settings_explain'], 'L_VAULT_EXCHANGE_USE' => $lang['Vault_exchange_use'], 'L_VAULT_EXCHANGE_MIN' => $lang['Vault_exchange_min'], 'L_VAULT_EXCHANGE_MIN_EXPLAIN' => $lang['Vault_exchange_min_explain'], 'L_VAULT_EXCHANGE_MAX' => $lang['Vault_exchange_max'], 'L_VAULT_EXCHANGE_MAX_EXPLAIN' => $lang['Vault_exchange_max_explain'], 'L_VAULT_EXCHANGE_TIME' => $lang['Vault_exchange_time'], 'L_VAULT_EXCHANGE_TIME_EXPLAIN' => $lang['Vault_exchange_time_explain'], 'L_SUBMIT' => $lang['Submit'], 'S_VAULT_ACTION' => append_sid(basename(__FILE__)), "S_HIDDEN_FIELDS" => $s_hidden_fields) ); $template->pparse('body'); include('./page_footer_admin.'.$phpEx); ?>
加入~
代碼: 選擇全部
$stock_total = ( isset($HTTP_POST_VARS['stock_total']) ) ? intval($HTTP_POST_VARS['stock_total']) : intval($HTTP_GET_VARS['stock_total']);
$sql = "INSERT INTO " . VAULT_EXCHANGE_TABLE . "......
上方那一處...
-
- 星球普通子民
- 文章: 13
- 註冊時間: 2003-07-22 16:50
- 來自: ANC
- 聯繫:
關於 後台管理公司股票總數...
新增股票...[數量]...我的不會顯示!
我是這樣改抖...提出讓各位參考!
搜尋
下方再加入\r
新增股票...[數量]...我的不會顯示!
我是這樣改抖...提出讓各位參考!
搜尋
代碼: 選擇全部
$s_hidden_fields = '<input type="hidden" name="mode" value="savenew" />';
$template->assign_vars(array(
'L_VAULT_EXCHANGE_ADD_SETTINGS' => $lang['Vault_exchange_settings_add'],
'L_VAULT_EXCHANGE_ADD_SETTINGS_EXPLAIN' => $lang['Vault_exchange_settings_explain_add'],
'L_STOCK_EXCHANGE_ACTIONS_ADD' => $lang['Vault_exchange_actions_add'],
'L_STOCK_NAME' => $lang['Vault_exchange_actions_name'],
代碼: 選擇全部
'L_STOCK_TOTAL' => $lang['Vault_exchange_stock_total'],