Card center for Discuz!4.1 & 5.0 BIG5 & UTF-8 安裝說明
1.下載主程序包
主程序包
按目錄結構上傳相應壓縮包內upload目錄下所有檔到論壇根目錄 | | 2.參考論壇版本下載Sql資料庫及插件資訊壓縮包
Discuz!_50_cht_big5
Discuz!_50_cht_utf8
Discuz!_41_cht_big5
Discuz!_41_cht_utf8
按壓縮包內sql.txt內語句在DZ後臺升級資料庫
| | 3.導入discuz_plugin_card.txt內的插件信息
然後到插件管理,加入一個使用等級為普通會員的前臺調用 | |
4.進行檔修改
| |
viewthread.php
|
找到
- mf.avatarheight, mf.sightml AS signature, mf.customstatus
复制代码
後面加
- /*[ Tool of Card Center(pig) BY PerfectWorks] add 1/2 START*/,m.pigavatar/*[ Tool of Card Center(pig) BY PerfectWorks] add 1/2 END*/
复制代码
|
找到
- WHERE p.tid='$tid' AND p.invisible='0' ORDER BY dateline LIMIT $start_limit, $ppp");
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 1/2 START
- @require_once DISCUZ_ROOT.'./forumdata/cache/cache_card.php';
- //[ Card Center BY PerfectWorks] add 2/3 END
复制代码
|
找到
- while($post = $db->fetch_array($query)) {
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 2/2 START
- eval($hooks['card_readcard']);
- //[ Card Center BY PerfectWorks] add 2/2 END
- //[ Tool of Card Center(postscript) BY PerfectWorks] add 1/1 START
- eval($hooks['card_tool_postscript2']);
- //[ Tool of Card Center(postscript) BY PerfectWorks] add 1/1 END
复制代码
|
D50找到
- if($showavatars) {
- $post['avatarshow'] = $avatarshowstatus && !$post['anonymous'] && ($post['avatarshowid'] || $avatarshowdefault) ? avatarshow($post['avatarshowid'], $post['gender']) : '';
- if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
- $post['avatar'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0" alt="" />';
- } elseif($avatarshowstatus != 2 && $_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
- $post['avatar'] = '<img src="'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0" alt="" />';
- } else {
- $post['avatar'] = '';
- }
- }
复制代码
D41找到
- $post['avatarshow'] = $avatarshowstatus && ($post['avatarshowid'] || $avatarshowdefault) ? avatarshow($post['avatarshowid'], $post['gender']) : '';
- if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
- $post['avatar'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0">';
- } elseif($avatarshowstatus != 2 && $_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
- $post['avatar'] = '<img src="'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0">';
- } else {
- $post['avatar'] = '';
- }
复制代码
後面加
- //[ Tool of Card Center(pig) BY PerfectWorks] add 2/2 START
- if($post['pigavatar']){
- $post['avatarshow'] = '';
- $post['avatar'] = '<img src="images/common/pigavatar'.rand(1,15).'.gif">';
- }
- //[ Tool of Card Center(pig) BY PerfectWorks] add 2/2 END
复制代码
| |
include\newreply.inc.php
|
找到
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 1/5 START
- eval($hooks['card_loadcache']);
- //[ Card Center BY PerfectWorks] add 1/5 END
复制代码
|
找到
- $author = !$isanonymous ? $discuz_user : '';
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 2/5 START
- eval($hooks['card_carddown']);
- //[ Card Center BY PerfectWorks] add 2/5 END
复制代码
|
找到
- $isanonymous = $isanonymous && $allowanonymous ? 1 : 0;
复制代码
後面加
- //[ Tool of Card Center(anonymous) BY PerfectWorks] add 1/1 START
- eval($hooks['card_tool_anonymous']);
- //[ Tool of Card Center(anonymous) BY PerfectWorks] add 1/1 END
- //[ Tool of Card Center(postscript) BY PerfectWorks] add 1/1 START
- eval($hooks['card_tool_postscript']);
- //[ Tool of Card Center(postscript) BY PerfectWorks] add 1/1 START
复制代码
|
找到
- updatepostcredits('+', $discuz_uid, $replycredits);
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 5/5 START
- eval($hooks['card_update']);
- //[ Card Center BY PerfectWorks] add 5/5 END
复制代码
|
找到
- $db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
- VALUES ('$fid', '$tid', '0', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '$attachment')");
复制代码
對比添加紅字部分
$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment/*[ Card Center BY PerfectWorks] add 3/5 START*/, card, postscript/*[ Card Center BY PerfectWorks] add 3/5 END*/)
VALUES ('$fid', '$tid', '0', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '$attachment'/*[ Card Center BY PerfectWorks] add 4/5 START*/ ,'$cardid', '$postscript'/*[ Card Center BY PerfectWorks] add 4/5 END*/)");
| |
include\newthread.inc.php
|
找到
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 1/5 START
- eval($hooks['card_loadcache']);
- //[ Card Center BY PerfectWorks] add 1/5 END
复制代码
|
找到
- $author = !$isanonymous ? $discuz_user : '';
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 2/5 START
- eval($hooks['card_carddown']);
- //[ Card Center BY PerfectWorks] add 2/5 END
复制代码
|
找到
- $subscribed = !empty($emailnotify) && $discuz_uid ? 1 : 0;
复制代码
後面加
- //[ Tool of Card Center(anonymous) BY PerfectWorks] add 1/1 START
- eval($hooks['card_tool_anonymous']);
- //[ Tool of Card Center(anonymous) BY PerfectWorks] add 1/1 END
- //[ Tool of Card Center(postscript) BY PerfectWorks] add 1/1 START
- eval($hooks['card_tool_postscript']);
- //[ Tool of Card Center(postscript) BY PerfectWorks] add 1/1 START
复制代码
|
找到
- updatepostcredits('+', $discuz_uid, $postcredits);
复制代码
後面加
- //[ Card Center BY PerfectWorks] add 5/5 START
- eval($hooks['card_update']);
- //[ Card Center BY PerfectWorks] add 5/5 END
复制代码
|
找到
- $db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
- VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '$attachment')");
复制代码
對比添加紅字部分
$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment/*[ Card Center BY PerfectWorks] add 3/5 START*/, card, postscript/*[ Card Center BY PerfectWorks] add 3/5 END*/)
VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '$attachment'/*[ Card Center BY PerfectWorks] add 4/5 START*/ ,'$cardid', '$postscript'/*[ Card Center BY PerfectWorks] add 4/5 END*/)");
| |
templates\default\actions.lang.php
|
找到
後面加
| |
templates\default\messages.lang.php
|
找到
後面加
- 'card_tool_UsePlaceError' => '本卡片應該在流覽帖子介面使用,請返回。',
- 'card_tool_UsePlaceError2' => '本卡片應該在發帖和回帖介面使用,請返回。',
- 'card_tool_UseSuccess' => '道具使用成功。',
- 'card_tool_StickError' => '本卡片不能對已經置頂的帖子使用,請返回。',
- 'card_tool_HighLightError' => '本卡片不能對已經高亮的帖子使用,請返回。',
- 'card_tool_ShowAnonymous' => '道具使用成功,即將跳轉到作者資訊頁。',
- 'card_tool_CanNotUseToAdmin' => '卡片不能對管理組人員使用,請返回修改。',
- 'card_tool_PigSuccess' => '{$card[cname]}使用成功,{$username}頭像已經變為豬頭',
- 'card_tool_ClearPigError' => '你並沒有被使用{$card[cname]},或者{$card[cname]}已經失效,不必再使用清除卡。',
- 'card_tool_LongPostscript' => '附注過長,請返回。',
- 'card_tool_ClearPostscriptError' => '你並沒有被使用{$card[cname]},或者{$card[cname]}已經失效,不必再使用清除卡。',
- 'card_tool_PostscriptSuccess' => '{$card[cname]}使用成功,{$username}之後發的{$actiontimes}張帖子都將附著膏藥內容',
- 'card_tool_ClearStickError' => '沒有這個帖子,或者這個帖子是一個永久置頂貼,不能使用該道具,請返回。',
- 'card_center_ToolInexistence' => '不存在這個道具,請返回修改。',
- 'card_center_WrongNumber' => '沒有輸入數量,請返回修改。',
- 'card_center_SendSuccess' => '贈送卡片成功。',
- 'card_center_DealSuccess' => '交易卡片成功。',
- 'card_center_ToolFileInexistence' => '道具程式檔不存在,請聯繫管理員。',
- 'card_center_NoName' => '你沒有填寫卡片的名稱,請返回修改。',
- 'card_center_LongName' => '你的卡片名字太長了,請返回修改。',
- 'card_center_NoEffect' => '你沒有填寫卡片效果,請返回修改。',
- 'card_center_OufOfEffect' => '你超出了卡片效果的範圍,請返回修改。',
- 'card_center_NoInt' => '你沒有填寫卡片說明,請返回修改。',
- 'card_center_LongInt' => '你的卡片說明過長,請返回修改。',
- 'card_center_WrongImage' => '你沒有選擇卡片圖片,請返回修改。',
- 'card_center_ExistenceIdentifier' => '唯一識別字已經存在,請返回修改。',
- 'card_center_NoIdentifier' => '你沒有填寫唯一識別字,請返回修改。',
- 'card_center_WrongId' => '不正確的卡片id,請返回。',
- 'card_center_AddSuccess' => '添加卡片成功。',
- 'card_center_EditSuccess' => '編輯卡片成功。',
- 'card_center_DelSuccess' => '刪除卡片成功。',
- 'card_center_PermitSuccess' => '卡片審核成功。',
- 'card_center_UpdateCacheSuccess' => '成功更新卡片緩存,請返回。',
- 'card_center_NoImageDir' => '卡片目錄 {$cardimgdir2} 不存在,請聯繫管理員。',
- 'card_func_CardForbidden' => '你使用的卡片已經被關閉,無法使用,請返回。',
- 'card_func_NotEnoughCredits' => '你的積分不足以購買這張卡片,請返回。',
- 'card_func_NotEnoughCard' => '這張卡片庫存不足,過幾天再來看看吧,請返回。',
- 'card_func_NotEnoughMyCard' => '你的卡片數量不足,快去卡片中心買幾張吧,請返回',
- 'card_func_CardForbiddenInForum' => '這個版面不允許使用該道具,請返回。',
- 'card_func_CardForbiddenInGroup' => '您所在的用戶組不允許使用該道具,請返回。',
复制代码
| |
templates\default\pms.lang.php
|
找到
上面加
- $addtype = array('1' => '每日','2'=>'每週','3'=>'每月');
复制代码 |
找到
後面加
- 'cardsend_subject' => '[Discuz!] 道具卡贈送',
- 'cardsend_message' => '這是由論壇系統自動發送的通知短消息。
- 您收到了您的朋友{$discuz_user}贈送的道具卡。
- [quote]
- [img]{$boardurl}images/card/{$card[image]}[/img]
- 卡片名稱:{$card[name]}
- 卡片描述:{$card[description]}
- 卡片庫存:{$card[num]} 張
- 更新數量: {$addtype[$card[addtype]]}{$card[addnum]}張
- 卡片價格:{$extcredits[$cardsittings[cardextcredits]][title]}{$card[price]}{$extcredits[$cardsittings[cardextcredits]][unit]}
- 贈送數量:{$num} 張
- [/quote]',
- 'carddown_subject' => '[Discuz!] 您發表的帖子掉落了道具卡片',
- 'carddown_message' => '這是由論壇系統自動發送的通知短消息。
- 以下所發表的帖子掉落了道具卡片
- 帖子: [url={$boardurl}viewthread.php?tid={$tid}&pid={$pid}&page={$cpage}&extra={$extra}#pid{$pid}]點擊前往[/url]
- [quote]
- [img]{$boardurl}images/card/{$card[image]}[/img]
- 卡片名稱:{$card[name]}
- 卡片描述:{$card[description]}
- 卡片庫存:{$card[num]}張
- 更新數量: {$addtype[$card[addtype]]}{$card[addnum]}張
- 卡片價格:{$extcredits[$cardsittings[cardextcredits]][title]}{$card[price]}{$extcredits[$cardsittings[cardextcredits]][unit]}
- [/quote]',
复制代码
| |
templates\default\templates.lang.php |
找到
後面加
- 'card_Center' => '卡片中心',
- 'card_Buy' => '購買卡片',
- 'card_MyCard' => '我的卡片',
- 'card_Add' => '加入卡片',
- 'card_Info' => '卡片資訊',
- 'card_Admin' => '中心管理',
- 'card_HelpCenter' => '幫助中心',
- 'card_Help' => '這裏是幫助資訊,最後寫',
- 'card_CountAll' => '卡片總數',
- 'card_CountNeedPermit' => '未開放卡片數',
- 'card_Unit' => '張',
- 'card_Use' => '使用',
- 'card_Card' => '卡片',
- 'card_Name' => '卡片名稱',
- 'card_Probability' => '卡片概率',
- 'card_CardInStore' => '庫存數量',
- 'card_CardAddNum' => '自動增加',
- 'card_Monthly' => '每月',
- 'card_Daily' => '每日',
- 'card_Weekly' => '每週',
- 'card_MyCredits' => '我的',
- 'card_MyCardNum' => '我擁有的卡片',
- 'card_ForumList' => '允許使用的論壇',
- 'card_GroupList' => '允許使用的用戶組',
- 'card_BuyNum' => '購買數量',
- 'card_Need' => '需要',
- 'card_BuyLeave' => '購買完剩餘',
- 'card_BuySubmit' => '確認購買卡片',
- 'card_State' => '卡片狀態',
- 'card_Identifier' => '唯一標示',
- 'card_CardAddType' => '自動增加頻率',
- 'card_NoMyCard' => '還沒有任何卡片,趕快去<a href=plugin.php?identifier=card&module=card&action=seecard>購買卡片</a>吧!',
- 'card_CacheLastUpdate' => '緩存更新於',
- 'card_ProbabilityArrayLength' => '卡片概率表長度',
- 'card_Rate' => '實際概率與設計概率比值',
- 'card_Help2' => '卡片資訊的幫助,最後再寫-_|||',
- 'card_Probability2' => '修正後概率',
- 'card_Probability3' => '概率表概率',
- 'card_CardPermit' => '開啟卡片',
- 'card_UpdateCache' => '更新卡片緩存',
- 'card_CardLog' => '卡片記錄',
- 'card_NoToPermit' => '沒有被關閉的卡片',
- 'card_Add2' => '加入',
- 'card_Deal' => '買賣',
- 'card_Permit' => '打開',
- 'card_Down' => '掉落',
- 'card_Send' => '贈送',
- 'card_ActiveUser' => '操作用戶',
- 'card_ActiveTime' => '操作時間',
- 'card_Detail' => '詳細資訊',
- 'card_Sell' => '賣出',
- 'card_PriceBuy' => '購買價格',
- 'card_PriceSell' => '賣出價格',
- 'card_SellNum' => '賣出數量',
- 'card_Gain' => '所得',
- 'card_SellLeave' => '賣出後總共',
- 'card_SendNum' => '贈送數量',
- 'card_SendToName' => '對方用戶名',
- 'card_SendSubmit' => '確認贈送',
- 'card_tool_Use' => '使用',
- 'card_NoStore' => '沒有庫存',
- 'card_DelConfirm' => '你確定要刪除這張卡片嗎?',
- 'card_tool_UseToName' => '對方用戶名',
- 'card_tool_UseSubmit' => '確定使用',
- 'card_Commend' => '推薦卡片',
- 'card_Rand' => '隨機卡片',
- 'card_Rank' => '卡片排行',
- 'card_BuyRank' => '購買排行',
- 'card_SellRank' => '賣出排行',
- 'card_SendRank' => '贈送排行',
- 'card_Hot' => '熱門卡片',
- 'card_Description' => '卡片描述',
- 'card_Price' => '卡片價格',
- 'card_DownMessage' => '只聽"哐當"一聲響,天上掉下來個鍋蓋,正砸在 $post[username] 頭上,上面還有 $post[card][name] 一張',
- 'card_CardEdit' => '批量編輯卡片',
- 'card_EditCardList' => '需要編輯的卡片',
- 'card_CardEditHelp' => '只需修改需要修改的屬性即可,留空則不修改',
- 'card_PermitCard' => '打開卡片',
- 'card_SellSubmit' => '確認賣出',
- 'card_tool_Postscript' => '膏藥內容',
- 'card_tool_Postscript2' => '請不要輸入會令他人反感的內容',
- 'card_precision' => '概率精度',
- 'card_Help' => '● 卡片中心可以進行卡片的添加、購買、轉讓等操作,購買卡片需要有足夠的{$extcredits[$cardsittings[cardextcredits]][title]}。<BR>● 用戶購買了道具卡片後,可以在<a href=\'plugin.php?identifier=card&module=mycard\'>我的卡片</a>頁面察看,進行進行卡片的賣出、贈送操作,卡片的使用方法依卡片的不同而不同。<BR>● 部分卡片的使用有用戶組及版面限制,詳細情況請仔細察看道具卡說明。<BR>',
- 'card_Help2' => '● 卡片概率的最小精度=1/概率表長度<br/>● 當全部卡片的概率之和大於1時,系統會將概率按比例計算成修正概率<br/>● 概率表中概率在正常情況下等於修正概率。如果兩者不相等,請更新卡片緩存<br/>',
- 'card_AddLimitName' => '限定30位元組以內',
- 'card_AddLimitInt' => '限定255位元組以內',
- 'card_AddLimitProbability' => '小於等於0不掉落,100一定掉落',
- 'card_AddLimitIndentifiter' => '重要屬性,嚴格按照道具說明輸入',
复制代码
| |
templates\default\post_newreply.htm
|
找到
- <!--{if $allowanonymous}--><input type="checkbox" name="isanonymous" value="1"> {lang post_anonymous}<br><!--{/if}-->
复制代码
後面加
- <!--[Tool of Card Center(anonymous)] By PerfectWorks START-->
- <input type="checkbox" name="useanonymous" value="1"> {lang card_tool_Use}$_CARD[card][anonymous][name]<br>
- <!--[Tool of Card Center(anonymous)] By PerfectWorks END-->
复制代码
templates\default\post_newthread.htm
|
找到
- <!--{if $allowanonymous}--><input type="checkbox" name="isanonymous" value="1"> {lang post_anonymous}<br><!--{/if}-->
复制代码
後面加
- <!--[Tool of Card Center(anonymous)] By PerfectWorks START-->
- <input type="checkbox" name="useanonymous" value="1"> {lang card_tool_Use}$_CARD[card][anonymous][name]<br>
- <!--[Tool of Card Center(anonymous)] By PerfectWorks END-->
复制代码
| |
templates\default\viewthread.htm
|
找到
- {lang next_thread}</a></td>
复制代码
後面加
- <!--[ Card Center BY PerfectWorks] add 1/2 START-->
- <td><select id="usecard" onchange="location.href('plugin.php?identifier=card&module=card&action=use&id='+(usecard.value)+'&tid=$tid&fid=$fid')" >
- <option>{lang card_Use}{lang card_Card}</option>
- <option value=highlight>$_CARD[card][highlight][name]</option>
- <option value=stick>$_CARD[card][stick][name]</option>
- <option value=stick2>$_CARD[card][stick2][name]</option>
- <option value=clearstick>$_CARD[card][clearstick][name]</option>
- <option value=clearstick2>$_CARD[card][clearstick2][name]</option>
- <option value=bump>$_CARD[card][bump][name]</option>
- <option value=drop>$_CARD[card][drop][name]</option>
- </select></td>
- <!--[ Card Center BY PerfectWorks] add 1/2 END-->
复制代码 |
找到
- </span><br>{lang member_anonymous}
复制代码
後面加
- <!--[Tool Of Card Center(showanonymous) By PerfectWorks] add 1/1 START--><br><a href="plugin.php?identifier=card&module=card&action=use&id=showanonymous&pid=$post[pid]&fid=$fid">{lang card_Use}$_CARD[card][showanonymous][name]</a><!--[Tool Of Card Center(anonymous) By PerfectWorks] add 1/1 END-->
复制代码 |
D50找到
- <div style="font-size: {MSGFONTSIZE}">$post[message]</div>
复制代码
D41找到
- <span style="font-size: {MSGFONTSIZE}">$post[message]</span>
复制代码
後面加
- <!--[ Card Center BY PerfectWorks FOR duowan.com] add 2/2 START-->
- <!--{if $post[card]}-->
- <table align=right width="20%"><tr><td>
- <TABLE cellSpacing=1 cellPadding=0 border=0>
- <TR><TD bgColor=#ff0000>
- <TABLE cellSpacing=1 cellPadding=0 width="98%" align=center bgColor=#ff0000 border=0><TR><TD bgColor=#ffffff>
- <TABLE cellSpacing=2 cellPadding=0 border=0>
- <TR><TD vAlign=middle>
- <DIV align=center><IMG src="images/card/$post[card][image]" alt="{lang card_Name}: $post[card][name]{LF}{lang card_Description}: $post[card][description]{LF}{lang card_Price}: $extcredits[$_DPLUGIN[card][vars][cardextcredits]][title] $post[card][price] $extcredits[$_DPLUGIN[card][vars][cardextcredits]][unit]"></DIV>
- </TD>
- </TR>
- </TABLE>
- </TD></TR></TABLE>
- </TD></TR></TABLE>
- </TD></TR></TABLE>
- <!--{/if}-->
- <!--[ Card Center BY PerfectWorks FOR duowan.com] add 2/2 END-->
复制代码
|
|