[教學]WOG 與 Discuz 6.0 連結
發表於 : 2008-02-28 3:30 pm
此修改按照各位大大在此壇的教學再修改而成
主要參照 minglo 大的教學
http://www.et99.org/viewtopic.php?t=41890
/forum_support/function_dz4.php
尋找
修改為
wog_act_config.php
紅色字為要修改的部分
註:
此修改與原貼不同
此連結只與論壇積分連結以用作WOG銀行 WOG現金不會與論壇有任何關係
extcredits8 請自行修改為 貴壇要使用當作銀行的積分代號
wog_act_store.php
function bank
請修改為
function bank_save
請修改為
function bank_get
請修改為
注意
此銀行依據最基本的系統而修改而成
利息系統可能和此不能共用
請再自行修改[quote="涅魂"]<u>積分 +3</u>
分享修改
at 2008-08-22 03:52 pm[/point]
主要參照 minglo 大的教學
http://www.et99.org/viewtopic.php?t=41890
/forum_support/function_dz4.php
尋找
- 代碼: 選擇全部
$prelength = strlen($tablepre);
foreach($_COOKIE as $key => $val) {
if(substr($key, 0, $prelength) == $tablepre) {
$_DCOOKIE[(substr($key, $prelength))] = daddslashes($val);
}
}
修改為
- 代碼: 選擇全部
$prelength = strlen($cookiepre);
foreach($_COOKIE as $key => $val) {
if(substr($key, 0, $prelength) == $cookiepre) {
$_DCOOKIE[(substr($key, $prelength))] = daddslashes($val);
}
}
wog_act_config.php
紅色字為要修改的部分
- 代碼: 選擇全部
[color=red]define('USER_TABLE','wog_player');
define('BANK_TABLE','cdb_members');[/color]
define('MONEY_FIELB','extcredits7');
define('BANK_FIELB','[color=red]extcredits8[/color]');
define('USER_ID','uid');
$forum_check="include_once('./forum_support/function_dz4.php');\$bbs_id=dz_check();";
$forum_message="\$wog_act_class = new wog_act_message;";
$forum_message.="\$wog_act_class->dz_message(\$HTTP_COOKIE_VARS["wog_cookie"],\$HTTP_COOKIE_VARS["wog_cookie_name"],\$HTTP_COOKIE_VARS["wog_bbs_id"]);";
註:
此修改與原貼不同
此連結只與論壇積分連結以用作WOG銀行 WOG現金不會與論壇有任何關係
extcredits8 請自行修改為 貴壇要使用當作銀行的積分代號
wog_act_store.php
function bank
請修改為
- 代碼: 選擇全部
function bank($user_id)
{
global $DB_site,$_POST,$lang;
$have_price=$DB_site->query_first("select p_bbsid,p_money from ".USER_TABLE." where p_id=".$user_id."");
$bank_memey=$DB_site->query_first("select b.".BANK_FIELB.",b.".USER_ID." from ".USER_TABLE." a,".BANK_TABLE." b where a.p_id=".$user_id." and a.p_bbsid=b.".USER_ID." ");
showscript("parent.bank('".$have_price[p_money]."','".$bank_memey[0]."')");
}
function bank_save
請修改為
- 代碼: 選擇全部
function bank_save($user_id,$pay_id,$money)
{
global $DB_site,$lang;
$have_price=$DB_site->query_first("select p_name,p_money,p_lv,p_bbsid from ".USER_TABLE." where p_id=".$user_id."");
$bank_memey=$DB_site->query_first("select b.".BANK_FIELB.",b.".USER_ID." from ".USER_TABLE." a,".BANK_TABLE." b where a.p_id=".$user_id." and a.p_bbsid=b.".USER_ID." ");
if($have_price['p_lv']<15 || !is_numeric($money) || $money <=0 || $have_price['p_money'] < $money)
{
alertWindowMsg($lang['wog_act_bank_noues']);
}else
{
if($user_id != $pay_id)
{
$DB_site->query("insert into wog_message(p_id,title,dateline)values(".$pay_id.",'".$have_price[p_name]." 匯入 ".$money."元 到你的銀行 ',".time().")");
$p=$DB_site->query_first("select p_bbsid from ".USER_TABLE." where p_id=".$pay_id."");
$DB_site->query("update ".BANK_TABLE." set ".BANK_FIELB." = ".BANK_FIELB."+".$money." WHERE ".USER_ID."=".$p['p_bbsid']."");
}else
{
$DB_site->query("update ".BANK_TABLE." set ".BANK_FIELB." = ".BANK_FIELB."+".$money." WHERE ".USER_ID."=".$bank_memey[1]."");
}
$DB_site->query("update ".USER_TABLE." set p_money = p_money-".$money." where p_id=".$user_id."");
showscript("parent.job_end(4)");
}
}
function bank_get
請修改為
- 代碼: 選擇全部
function bank_get($user_id,$money)
{
global $DB_site,$lang;
$bank_memey=$DB_site->query_first("select b.".BANK_FIELB.",b.".USER_ID." from ".USER_TABLE." a,".BANK_TABLE." b where a.p_id=".$user_id." and a.p_bbsid=b.".USER_ID." ");
if($bank_memey[BANK_FIELB] < $money )
{
alertWindowMsg($lang['wog_act_nomoney']);
}
if(!is_numeric($money) || $money <=0 || $bank_memey[BANK_FIELB] < $money)
{
alertWindowMsg($lang['wog_act_nomoney']);
}else
{
$DB_site->query("update ".BANK_TABLE." set ".BANK_FIELB." = ".BANK_FIELB."-".$money." WHERE ".USER_ID."=".$bank_memey[1]."");
$DB_site->query("update ".USER_TABLE." set p_money = p_money+".$money." where p_id=".$user_id."");
showscript("parent.job_end(4)");
}
}
注意
此銀行依據最基本的系統而修改而成
利息系統可能和此不能共用
請再自行修改[quote="涅魂"]<u>積分 +3</u>
分享修改
at 2008-08-22 03:52 pm[/point]