[插件交流] 配合 DZ 積分基制 [sell=8] 出售內容 + 終止出售 插件

http://www.alan888.com/Discuz/viewthread.php?tid=129847&highlight=sell

http://www.alan888.com/Discuz/viewthread.php?tid=82243

這插件整合了以上一篇但不需安裝  hide 對附件隱藏 插件
=============== 程序說明 ==================
將現時的出售 需要付費才可進入查看主題
改為以往使用的 可進入觀看帖子
[sell=??] 出售內容 [/sell] 付費後查看內容
將出售的內容隱藏 需付費後才可查看
使用方法有兩個  1. 填入出售的價格  2. 使用代碼
只需選其中一項 程式會完成整段出售代碼
============================================
就算內容用了 [sell=??] 出售內容 [/sell] 這代碼
程式亦可作檢查 是否超出你用戶組的最高出售價格
若是超出 程式會將這價格改為您用戶組的最高出售價格
============================================
除了 misc.php 加入一次數據庫查詢檢查是否己付費
其它全部檔案 絕對沒有增加數據庫查詢
並在 include/newreply.inc.php 這文件
在有出售的帖子內 並減少一次數據庫查詢
每篇主題內只可有一次出售 再多也是無效
就等於在同一帖放置多個 [hide] 一樣道理
回覆不可出售 因為這是修改版插件 不是新插件
============================================
有權使用強制退款 可用 終止出售
若不想強制退款 又可查看付費名單 又不想主題繼續出售
可以選用 管理選項 終止出售 將出售改為終止
就算主題作者進入編輯帖子 亦不可改回可以出售
============================================
無需升級數據庫 只需修改檔案
( 修改前請先備份以下檔案 )
( 用後有什麼問題 可將備份檔案上傳恢復正常 )
============= 修改文件 =====================
viewthread.php
misc.php
post.php
blog.php
topicadmin.php

include/editpost.inc.php
include/newreply.inc.php
include/newthread.inc.php
include/printable.inc.php
include/threadpay.inc.php
include/discuzcode.func.php

templates/default/templates.lang.php
templates/default/post_editpost.htm
templates/default/post_newthread.htm
templates/default/topicadmin_refund.htm
templates/default/viewthread_printable.htm
templates/default/viewthread.htm      ( 所有風格有這份檔 viewthread.htm 亦要修改 )
( 修改上傳完成 緊記 更新緩存 )
============================================
blog.php 找
        $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], sprintf('%00b', $post['htmlon']), $forum['allowsmilies'], $forum['allowbbcode'], ($forum['allowimgcode'] && $showimages ? 1 : 0), $forum['allowhtml'], ($forum['jammer'] && $post['authorid'] != $discuz_uid ? 1 : 0), 0, $post['authorid'], $post['pid']);[/php]之下加入[php]        if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $post['message']))) {
                $post['message'] = preg_replace("/\[sell=\d*\](.+?)\[\/sell\]/is", "**** 付費信息,已經隱藏 ****", $post['message']);
        }[/php]============================================

viewthread.php 找[php]if($thread['price'] > 0 && $thread['special'] == 0) {
        if($maxchargespan && $timestamp - $thread['dateline'] >= $maxchargespan * 3600) {
                $db->query("UPDATE {$tablepre}threads SET price='0' WHERE tid='$tid'");
                $thread['price'] = 0;
        } else {
                if(!$discuz_uid) {
                        showmessage('group_nopermission', NULL, 'NOPERM');
                } elseif(!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
                        $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
                        if(!$db->num_rows($query)) {
                                require_once DISCUZ_ROOT.'./include/threadpay.inc.php';
                                exit();
                        }
                }
        }
}[/php]改為[php]$pricepay = $thread['price'];
if($thread['price'] > 0) {
        if($maxchargespan) {
                $daynow = intval(($timestamp - $thread[dateline])/3600);
                $paytimes = $maxchargespan - $daynow;
        } else {
                $paytimes = "不限";
        }
        if($maxchargespan && $timestamp - $thread['dateline'] >= $maxchargespan * 3600) {
                $db->query("UPDATE {$tablepre}threads SET price='-2' WHERE tid='$tid'");
                showmessage("本主題自發表起已超過最長出售時限,重新進入可免費查看。","viewthread.php?tid=$tid");
        } else {
                if(!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
                        $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
                        if(!$db->num_rows($query)) {
                                $nopay = 1;
                                if($pay == 'pay') {
                                        require_once DISCUZ_ROOT.'./include/threadpay.inc.php';
                                        exit();
                                }
                        }
                }
        }
}[/php]============================================

misc.php 找[php]} elseif($action == 'pay') {[/php]之下加入[php]        $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
        if($db->num_rows($query)) {
                showmessage("您已經付過費,不用再付。", "viewthread.php?tid=$tid");
        }[/php]============================================

post.php 找[php]if(empty($bbcodeoff) && !$allowhidecode && !empty($message) && preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", preg_replace("/(\[code\](.+?)\[\/code\])/is", ' ', $message))) {
        showmessage('post_hide_nopermission');
}[/php]之下加入[php]if($maxprice == 0 && !empty($message) && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
        showmessage("抱歉!您的用戶組不可發表出售,請返回。");
}[/php]============================================

topicadmin.php 找 ( 以下是刪除主題後將付費記錄刪除 )[php]                $db->query("DELETE FROM {$tablepre}posts WHERE pid IN ($pids)");[/php]之下加入[php]                $db->query("DELETE FROM {$tablepre}paymentlog WHERE tid IN ($pids)");[/php]再找[php]} elseif($action == 'refund' && $allowrefund && $thread['price'] > 0) {[/php]之上加入 ( 緊記加在上面 )[php]} elseif($action == 'closerefund' && $allowrefund && $thread['price'] > 0) {

        if(!isset($extcredits[$creditstrans])) {
                showmessage('credits_transaction_disabled');
        }

        if(!submitcheck('refundsubmit')) {
                include template('topicadmin_refund');
        } else {
                $db->query("UPDATE {$tablepre}threads SET price='-3', moderated='1' WHERE tid='$thread[tid]'");
                showmessage("終止出售完成,現正進入主題。", "viewthread.php?tid=$tid");
        }[/php]再找 ( 以下是強制退款後將付費記錄刪除 )[php]                $db->query("UPDATE {$tablepre}paymentlog SET amount='0', netamount='0' WHERE tid='$tid'");[/php]改為[php]                $db->query("DELETE FROM {$tablepre}paymentlog WHERE tid='$tid'");[/php]再找 ( 以下是合併主題後將付費記錄刪除 )[php]                $db->query("DELETE FROM {$tablepre}myposts WHERE tid='$othertid'");[/php]之下加入[php]                $db->query("DELETE FROM {$tablepre}paymentlog WHERE tid='$othertid'");[/php]============================================

include/threadpay.inc.php 找[php]                $thread['endtime'] = $maxchargespan ? gmdate("$dateformat $timeformat", $timestamp + $maxchargespan * 3600 + $timeoffset * 3600) : 0;[/php]之下加入[php]        $post['message'] = preg_replace("/\[sell=\d*\](.+?)\[\/sell\]/is", "**** 付費信息,已經隱藏 ****", $post['message']);[/php]============================================

include/newthread.inc.php 找[php]        $price = $maxprice && !$special ? ($price <= $maxprice ? $price : $maxprice) : 0;[/php]改為[php]//----------------------------- 檢查最高售價開始 --------------------------------
        if($price) {
                if($price > $maxprice) {
                        $price = $maxprice;
                }
                $message = "[sell=".$price."]".$message."[/sell]";
        } elseif(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
                if(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
                        $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\2", $message);
                        $price = isset($postsell) ? (float)$postsell : '';
                        if($price > $maxprice) {
                                $price = $maxprice;
                        }
                        $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
                } elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
                        $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\1", $message);
                        $price = isset($postsell) ? (float)$postsell : '';
                        if($price > $maxprice) {
                                $price = $maxprice;
                        }
                        $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
                } elseif(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                        $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\2", $message);
                        $price = isset($postsell) ? (float)$postsell : '';
                        if($price > $maxprice) {
                                $price = $maxprice;
                        }
                        $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
                } elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                        $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\1", $message);
                        $price = isset($postsell) ? (float)$postsell : '';
                        if($price > $maxprice) {
                                $price = $maxprice;
                        }
                        $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
                }
        }
//----------------------------- 檢查最高售價結束 --------------------------------[/php]============================================

include/newreply.inc.php 找[php]                $message = cutstr(strip_tags(preg_replace(array(
                                "/\[hide=?\d*\](.+?)\[\/hide\]/is",
                                "/\[quote](.*)\[\/quote]/siU",
                                $language['post_edit_regexp'],
                                "/\[($bbcodes)=?.*\]/iU",
                                "/\[\/($bbcodes)\]/i",
                        ), array(
                                "$language[post_hidden]",
                                '',
                                '',
                                '',
                                ''
                        ), $message)), 200);[/php]改為[php]$message = cutstr(strip_tags(preg_replace(array(
                                "/\[hide=?\d*\](.+?)\[\/hide\]/is",
                                "/\[sell=?\d*\](.+?)\[\/sell\]/is",
                                "/\[quote](.*)\[\/quote]/siU",
                                $language['post_edit_regexp'],
                                "/\[($bbcodes)=?.*\]/iU",
                                "/\[\/($bbcodes)\]/i",
                        ), array(
                                "$language[post_hidden]",
                                "**** 付費信息,已經隱藏 ****",
                                '',
                                '',
                                '',
                                ''
                        ), $message)), 200);[/php]再找[php]                                $post['message'] = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "$language[post_hidden]", $post['message']);[/php]之下加入[php]                                $post['message'] = preg_replace("/\[sell=?\d*\](.+?)\[\/sell\]/is", "**** 付費信息,已經隱藏 ****", $post['message']);[/php]再找[php]        require_once DISCUZ_ROOT.'./include/forum.func.php';[/php]之下加入[php]        if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
                showmessage('抱歉!回覆不可使用出售代碼,請返回修改。');
        }[/php]============================================

templates/default/post_newthread.htm

找以下刪除[php]{lang post_price_free_comment}[/php]============================================

include/editpost.inc.php 找[php]                        $price = $thread['price'] < 0 && !$thread['special'] ?
                                ($isorigauthor
 !$price ? -1 : $price) :
                                ($maxprice ? ($price <= $maxprice ? ($price > 0 ? $price : 0) : $maxprice) : ($isorigauthor ? 0 : $thread['price']));[/php]改為[php]//-----------------------------檢查最高售價開始--------------------------------
                        if($price != '-1'
 $price != '-2'
 $price != '-3') {
                                if($price > 0 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                                        if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
                                                if($price > 0 && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
                                                        $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\2", $message);
                                                } elseif($price > 0 && preg_match("/\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
                                                        $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\1", $message);
                                                } elseif($price > 0 && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                                                        $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\2", $message);
                                                } elseif($price > 0 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                                                        $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\1", $message);
                                                }
                                                $postsell = isset($postsell) ? (float)$postsell : '';
                                                if($thread['price'] != $postsell) {
                                                        $price = $postsell;
                                                }
                                                if($price > $maxprice) {
                                                        $price = $maxprice;
                                                }
                                                $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
                                        }
                                } elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                                        if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
                                                if(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
                                                        $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\2", $message);
                                                } elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
                                                        $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\1", $message);
                                                } elseif(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                                                        $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\2", $message);
                                                } elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                                                        $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\1", $message);
                                                }
                                                $price = isset($postsell) ? (float)$postsell : '';
                                                if($price > $maxprice) {
                                                        $price = $maxprice;
                                                }
                                                $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
                                        }
                                } elseif($price > 0 && !preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                                        if($price > $maxprice) {
                                                $price = $maxprice;
                                        }
                                        $message = "[sell=".$price."]".$message."[/sell]";
                                }
                        }
//-----------------------------檢查最高售價結束--------------------------------[/php]再找[php]                        if($subject == '' && $message == '') {[/php]之上加入 ( 緊記加在上面 )[php]                        if($postnumber > 1 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))){
                                showmessage('抱歉!回覆不可使用出售代碼,請返回修改。');
                        }[/php]============================================

include/discuzcode.func.php 找[php]        global $discuzcodes, $credits, $tid, $discuz_uid, $highlight, $maxsmilies, $db, $tablepre, $hideattach;[/php]改為[php]        global $discuzcodes, $credits, $tid, $discuz_uid, $highlight, $maxsmilies, $db, $tablepre, $hideattach, $nopay, $pricepay, $paytimes;[/php]再找[php]        if(!$bbcodeoff && $allowbbcode) {[/php]之上加入 ( 緊記加在上面 )[php]//--------------------- 出售內容開始 -------------------------
        if($pricepay && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                if($pricepay == '-1' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                        $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "<fieldset><legend> 出 售 無 效 </legend>本主題被 [ 強制退款 ],所有付費者已得到退款。</fieldset>

\\2", $message);
                } elseif($pricepay == '-2' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                        $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "
<div class=\"mainbox\"><h1>超 過 出 售 時 限</h1><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr align=\"center\"><td>編號: <input type=\"text\" value=\"$tid\" size=\"8\"></td><td>價格: <input type=\"text\" value=\"0\" size=\"6\"></td><td>出售時限己過期: <input type=\"text\" value=\"0\" size='6'> 小時</td><td><a href=\"misc.php?action=viewpayments&tid=$tid\">[ 付費名單 ]</a></td></tr><tr><td colspan=\"4\"><fieldset style=\"width: 100%; border: 1px double ".BORDERCOLOR."\"><legend> <span class=\"outertxt\">感 謝 所 有 己 付 費 者</span> </legend>
    本主題自發表起已超過最長出售時限,現已免費查看。

</fieldset></td></tr></table></div>
\\2", $message);
                } elseif($pricepay == '-3' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
                        $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "
<div class=\"mainbox\"><h1>終 止 出 售</h1><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr align=\"center\"><td>編號: <input type=\"text\" value=\"$tid\" size=\"8\"></td><td>價格: <input type=\"text\" value=\"0\" size=\"6\"></td><td>出售時限剩餘: <input type=\"text\" value=\"0\" size=\"6\"> 小時</td><td><a href=\"misc.php?action=viewpayments&tid=$tid\">[ 付費名單 ]</a></td></tr><tr><td colspan=\"4\"><fieldset style=\"width: 100%; border: 1px double ".BORDERCOLOR."\"><legend> <span class=\"outertxt\">感 謝 所 有 己 付 費 者</span> </legend>
    本主題被 [ 終止出售 ],現已免費查看。

</fieldset></td></tr></table></div>
\\2", $message);
                } else {
                        if($nopay == '1') {
                                if(!$discuz_uid) {
                                        $paymessage = "非論壇會員無權購買,請 [ <a href=\"logging.php?action=login\">登陸</a> ] 或者 [ <a href=\"register.php\">註冊</a> ]。";
                                } else {
                                        $paymessage = "請付費查看本帖出售內容  <a href=\"misc.php?action=pay&tid=$tid\">[ 我要付費 ]</a>";
                                }
                                $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "
<div class=\"mainbox\"><h1>收 費 單</h1><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr align=\"center\"><td>編號: <input type=\"text\" value=\"$tid\" size=\"8\"></td><td>價格: <input type=\"text\" value=\"$pricepay\" size=\"6\"></td><td>出售時限剩餘: <input type=\"text\" value=\"$paytimes\" size=\"6\"> 小時</td><td><a href=\"misc.php?action=viewpayments&tid=$tid\">[ 付費名單 ]</a></td></tr><tr><td colspan=\"4\"><fieldset><legend> 收 費 單 </legend>
$paymessage

</fieldset></td></tr></table></div>
", $message);
                        } else {
                                $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "
<div class=\"mainbox\"><h1>付 費 証 明</h1><table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr align=\"center\"><td>編號: <input type=\"text\" value=\"$tid\" size=\"8\"></td><td>價格: <input type=\"text\" value=\"$pricepay\" size=\"6\"></td><td>出售時限剩餘: <input type=\"text\" value=\"$paytimes\" size=\"6\"> 小時</td><td><a href=\"misc.php?action=viewpayments&tid=$tid\">[ 付費名單 ]</a></td></tr><tr><td colspan=\"4\"><fieldset><legend> 感 謝 您 的 付 費 </legend>
您可以查看以下內容。如發現非法騙財、可以向 版主投訴。
經查証騙財、會被強制退款,將全數款項退還所有已付費者。

</fieldset></td></tr></table></div>
\\2", $message);
                        }
                }
        }
//--------------------- 出售內容結束 -------------------------[/php]============================================

include/printable.inc.php 找[php]while($post = $db->fetch_array($query)) {[/php]之下加入[php]        if($nopay) {
                $post['message'] = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "**** 付費信息,已經隱藏 ****", $post['message']);
        }[/php]再找 ( 以下是將 可打印版本 在無權查看時不顯示內容 )[php]        if($post['attachment']) {[/php]改為[php]        if($post['attachment'] && !$nopay) {
============================================

templates/default/post_editpost.htm 找
<!--{if $maxprice && !$thread['special']}-->
        <tr>
        <td class="altbg1"><span class="bold">{lang price}</span>({$extcredits[$creditstrans][title]})</td>
        <td class="altbg2">
        <!--{if $thread['price'] == -1
 $thread['freecharge']}-->
                <input type="text" name="price" size="6" value="$thread[pricedisplay]" disabled> <span class="smalltxt">{$extcredits[$creditstrans][unit]}
                <!--{if $thread['price'] == -1}-->({lang post_price_refunded})<!--{else}-->({lang post_price_free})<!--{/if}-->
                </span>
        <!--{else}-->
                <input type="text" name="price" size="6" value="$thread[pricedisplay]"> <span class="smalltxt">{$extcredits[$creditstrans][unit]} ({lang post_price_comment}<!--{if $maxincperthread}-->{lang post_price_income_comment}<!--{/if}--><!--{if $maxchargespan}-->{lang post_price_charge_comment}<!--{/if}-->)</span>
                {lang post_price_free_comment}
        <!--{/if}-->
        </td></tr>
<!--{/if}-->[/xml]改為[xml]<!--{if $maxprice && !$thread['special']}-->
        <tr>
        <td class="altbg1"><span class="bold">{lang price}</span>({$extcredits[$creditstrans][title]})</td>
        <td class="altbg2">
        <!--{if $thread['price'] == -1
 $thread['price'] == -2
 $thread['price'] == -3
 $thread['freecharge']}-->
                <input type="hidden" name="price" value="$thread[price]">
                <input type="text" size="6" value="0" disabled> <span class="smalltxt">{$extcredits[$creditstrans][unit]}
                <!--{if $thread['price'] == -3}-->({lang post_price_closerefund})<!--{elseif $thread['price'] == -1}-->({lang post_price_refunded})<!--{else}-->({lang post_price_free})<!--{/if}-->
                </span></td>
        <!--{else}-->
                <input type="text" name="price" size="6" value="$thread[pricedisplay]"> <span class="smalltxt">{$extcredits[$creditstrans][unit]} ({lang post_price_comment}<!--{if $maxincperthread}-->{lang post_price_income_comment}<!--{/if}--><!--{if $maxchargespan}-->{lang post_price_charge_comment}<!--{/if}-->)</span></td>
        <!--{/if}-->
        </tr>
<!--{/if}-->[/xml]再拉到最底再找[xml]<input type="hidden" name="pid" value="$pid" />[/xml]之下加入[xml]<input type="hidden" name="postnumber" value="$postnumber" />[/xml]=====================================================

templates/default/templates.lang.php 找[xml]        'post_price_refunded' => '本主題被強制退款',[/xml]之下加入[xml]        'post_price_closerefund' => '本主題被終止出售',[/xml]再找[xml]        'admin_refund' => '強制退款',[/xml]之下加入[xml]        'admin_closerefund' => '終止出售',[/xml]============================================

templates/default/viewthread.htm 找[xml]                                <a href="misc.php?action=viewpayments&tid=$tid">{lang price_thread} {$extcredits[$creditstrans][title]} <strong>$thread[price]</strong> {$extcredits[$creditstrans][unit]}</a>[/xml]之下加入[xml]                                <!--{if $forum['ismoderator'] && $thread['authorid'] != $discuz_uid}--><a href="misc.php?action=pay&tid=$tid">友情付費</a><!--{/if}-->[/xml]再找[xml]                                                        <!--{if $post['attachment']}-->
                                                                <div class="notice" style="width: 500px">{lang attachment}: <em>{lang attach_nopermission}</em></div>
                                                        <!--{elseif $hideattach[$post[pid]] && $post['attachments']}-->
                                                                <div class="notice" style="width: 500px">{lang attachment}: <em>{lang attachment_reply_show}</em></div>
                                                        <!--{elseif $post['attachlist']}-->
                                                                <div class="box postattachlist">
                                                                        <h4>{lang attachment}</h4>
                                                                        $post[attachlist]
                                                                </div>
                                                        <!--{/if}-->[/xml]改為[xml]                                                        <!--{if $post['attachment']
 ($nopay && $post['attachments'] && !$post['attachment'])}-->
                                                                <div class="notice" style="width: 500px">{lang attachment}: <em>{lang attach_nopermission}</em></div>
                                                        <!--{elseif $hideattach[$post[pid]] && $post['attachments']}-->
                                                                <div class="notice" style="width: 500px">{lang attachment}: <em>{lang attachment_reply_show}</em></div>
                                                        <!--{elseif $post['attachlist']}-->
                                                                <div class="box postattachlist">
                                                                        <h4>{lang attachment}</h4>
                                                                        $post[attachlist]
                                                                </div>
                                                        <!--{/if}-->[/xml]再找[xml]                <!--{if $thread['price'] > 0 && $allowrefund}--><option value="refund">{lang admin_refund}</option><!--{/if}-->[/xml]改為[xml]                <!--{if $thread['price'] > 0 && $allowrefund}--><option value="refund">{lang admin_refund}</option><option value="closerefund">{lang admin_closerefund}</option><!--{/if}-->[/xml]再找[xml]<!--{elseif $post['first'] && isset($threadpay)}-->
                                                        {template viewthread_pay}[/xml]刪除

============================================

templates/default/viewthread_printable.htm  找

( 這修改 是 可打印版本 顯示圖片真實地址 )[xml]                        <!--{if !$attach['price']
 $attach['payed']}-->

<img src="$attach[url]/$attach[attachment]" border="0"  alt="" /><!--{/if}-->[/xml]改為[xml]                        <!--{if !$attach['price']
 $attach['payed']}-->

<img src="attachment.php?aid=$attach[aid]" border="0"  alt="" /><!--{/if}-->[/xml]=====================================================

templates/default/topicadmin_refund.htm 找[xml]<form method="post" action="topicadmin.php?action=refund" id="postform">[/xml]之上加入 ( 緊記加在上面 )[xml]<!--{if $action == 'closerefund'}-->
        <form method="post" action="topicadmin.php?action=closerefund">
        <input type="hidden" name="formhash" value="{FORMHASH}">
        <div class="mainbox formbox">
        <h1>{lang admin_closerefund}</h1>
        <table cellspacing="0" cellpadding="0" width="100%">
        <tr>
        <th>{lang username}</th>
        <td>$discuz_userss <em class="tips">[<a href="$link_logout">{lang member_logout}</a>]</em></td>
        </tr>
        <input type="hidden" name="fid" value="$fid">
        <input type="hidden" name="tid" value="$tid">
        {template topicadmin_reason}
        <tr class="btns">
        <th> </th>
        <td>
        <input type="hidden" name="fid" value="$fid" />
        <input type="hidden" name="tid" value="$tid" />
        <button class="submit" type="submit" name="refundsubmit" id="postsubmit" value="true">{lang admin_closerefund}</button> {lang post_submit_hotkey}
        </td>
        </tr>
        </table></div>
<!--{else}-->[/xml]再找[xml]{template footer}[/xml]之上加入 ( 緊記加在上面 )[xml]<!--{/if}-->
============================================
∼ 完 ∼
============================================
複製這篇網址分享給朋友: http://discuz.bluelovers.net/thread-4612-1.html#pid7303

本篇的內容不含引用除另有聲明外,如符合 CC授權條款 則套用 姓名標示-非商業性-相同方式分享 3.0 通用版

套一句黃小琥說過的話:「你可以點歌,但是我可以選歌」

RE: [插件交流] 配合 DZ 積分基制 [sell=8] 出售內容 + 終止出售 插件

如何加入 sell 按鈕??@@
複製這篇網址分享給朋友: http://discuz.bluelovers.net/thread-4612-1.html#pid9799

TOP

RE: [插件交流] 配合 DZ 積分基制 [sell=8] 出售內容 + 終止出售 插件

在後台discuz代碼的地方 加入就可以= =
至於圖片 就需要自行去尋找下載
複製這篇網址分享給朋友: http://discuz.bluelovers.net/thread-4612-1.html#pid9802

本篇的內容不含引用除另有聲明外,如符合 CC授權條款 則套用 姓名標示-非商業性-相同方式分享 3.0 通用版

TOP

回覆 #1 admin 的帖子

哇~!這扁 文真的好多
值得向難度來挑戰
先謝謝管員妳的分享
一直對php都未了很深入
希望借此機會多了解語法的運用
複製這篇網址分享給朋友: http://discuz.bluelovers.net/thread-4612-1.html#pid43274

本篇的內容不含引用除另有聲明外,如符合 CC授權條款 則套用 姓名標示-非商業性-相同方式分享 3.0 通用版

TOP

RE: [插件交流] 配合 DZ 積分基制 [sell=8] 出售內容 + 終止出售 插件

support!!!!
複製這篇網址分享給朋友: http://discuz.bluelovers.net/thread-4612-1.html#pid44679

本篇的內容不含引用除另有聲明外,如符合 CC授權條款 則套用 姓名標示-非商業性-相同方式分享 3.0 通用版

TOP