============================================
include/newreply.inc.php 找
- if(empty($thread)) {
- showmessage('thread_nonexistence');
- } elseif($thread['price'] > 0) {
- if($thread['special'] == 0) {
- 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)) {
- showmessage('undefined_action', NULL, 'HALTED');
- }
- }
- }
- }
复制代码
改为 ( 以上数据库查询已无用,可将它减去 )
- if(empty($thread)) {
- showmessage('thread_nonexistence');
- }
复制代码
再找
- $message = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "[b]$language[post_hidden][/b]", $message);
复制代码
之下加入
- $message = preg_replace("/\[sell=\d*\](.+?)\[\/sell\]/is", "[b]**** 付费信息,已经隐藏 ****[/b]", $message);
复制代码
再找
- $post['message'] = preg_replace("/\[hide=?\d*\](.+?)\[\/hide\]/is", "[b]$language[post_hidden][/b]", $post['message']);
复制代码
之下加入
- $post['message'] = preg_replace("/\[sell=\d*\](.+?)\[\/sell\]/is", "[b]**** 付费信息,已经隐藏 ****[/b]", $post['message']);
复制代码
再找
- require_once DISCUZ_ROOT.'./include/forum.func.php';
复制代码
之下加入
- if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
- showmessage('抱歉!回复不可使用出售代码,请返回修改。');
- }
复制代码
============================================
templates/default/post_newthread.htm
找以下删除
- {lang post_price_free_comment}
复制代码
============================================
include/editpost.inc.php 找
- $price = $thread['price'] < 0 && !$thread['special'] ?
- ($isorigauthor || !$price ? -1 : $price) :
- ($maxprice ? ($price <= $maxprice ? ($price > 0 ? $price : 0) : $maxprice) : ($isorigauthor ? 0 : $thread['price']));
复制代码
改为
- //-----------------------------检查最高售价开始--------------------------------
- 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]";
- }
- }
- //-----------------------------检查最高售价结束--------------------------------
复制代码
再找
- if($subject == '' && $message == '') {
复制代码
之上加入 ( 紧记加在上面 )
- if($postnumber > 1 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))){
- showmessage('抱歉!回复不可使用出售代码,请返回修改。');
- }
复制代码
============================================
include/discuzcode.func.php 找
- global $discuzcodes, $credits, $tid, $discuz_uid, $highlight, $maxsmilies, $db, $tablepre, $ishide;
复制代码
改为
- global $discuzcodes, $credits, $tid, $discuz_uid, $highlight, $maxsmilies, $db, $tablepre, $ishide, $nopay, $pricepay, $paytimes;
复制代码
再找
- if(!$bbcodeoff && $allowbbcode) {
复制代码
之上加入 ( 紧记加在上面 )
- //--------------------- 出售内容开始 -------------------------
- 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 style="padding: 5px;width:97%;border:1px solid ".BORDERCOLOR."" align="center"><legend> <span class='outertxt'>出 售 无 效</span> </legend><table align='center' border='0' width='97%' cellspacing='6' cellpadding='0'><tr><td>本主题被 [强制退款],所有付费者已得到退款。</td></tr></table></fieldset><br><br>\\2", $message);
- }elseif($pricepay == '-2' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
- $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "<br><TABLE cellPadding='3' cellSpacing='1' width='97%' align='center' class='tableborder'><TR><TD class='header' align='center'>超 过 出 售 时 限<TR><TD align='center' class='altbg2'><table border='0' width='100%' cellspacing='3' cellpadding='0'><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><br> 本主题自发表起已超过最长出售时限,现已免费查看。<br><br></FIELDSET></td></tr></table></td></tr></table><br>\\2", $message);
- }elseif($pricepay == '-3' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
- $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "<br><TABLE cellPadding='3' cellSpacing='1' width='97%' align='center' class='tableborder'><TR><TD class='header' align='center'>终 止 出 售<TR><TD align='center' class='altbg2'><table border='0' width='100%' cellspacing='3' cellpadding='0'><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><br> 本主题被 [终止出售],现已免费查看。<br><br></FIELDSET></td></tr></table></td></tr></table><br>\\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="viewthread.php?tid=$tid&pay=pay">[ 我要付费 ]</a>";
- }
- $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "<br><TABLE cellPadding='3' cellSpacing='1' width='97%' align='center' class='tableborder'><TR><TD class='header' align='center'>收 费 单<TR><TD align='center' class='altbg2'><table border='0' width='100%' cellspacing='3' cellpadding='0'><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 style='width:100%;border:1px double ".BORDERCOLOR."'><LEGEND> <span class='outertxt'>收 费 单</span> </LEGEND><br> $paymessage<br><br></FIELDSET></td></tr></table></td></tr></table><br>", $message);
- }else{
- $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "<br><TABLE cellPadding='3' cellSpacing='1' width='97%' align='center' class='tableborder'><TR><TD class='header' align='center'>付 费 证 明<TR><TD align='center' class='altbg2'><table border='0' width='100%' cellspacing='3' cellpadding='0'><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 style='width:100%;border:1px double ".BORDERCOLOR."'><LEGEND> <span class='outertxt'>感 谢 您 的 付 费</span> </LEGEND><br> 您可以查看以下内容。如发现非法骗财、可以向 版主投诉。<br> 经查证骗财、会被强制退款,将全数款项退还所有已付费者。<br><br></FIELDSET></td></tr></table></td></tr></table><br>\\2", $message);
- }
- }
- }
- //--------------------- 出售内容结束 -------------------------
复制代码
============================================
include/printable.inc.php 找
- while($post = $db->fetch_array($query)) {
复制代码
之下加入
- if($nopay){
- $post['message'] = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "**** 付费信息,已经隐藏 ****", $post['message']);
- }
复制代码
再找 ( 以下是将 可打印版本 在无权查看时不显示内容 )
- if($post['attachment']) {
复制代码
改为
- if($post['attachment'] && !$nopay && !$ishide) {
复制代码
============================================
templates/default/post_editpost.htm 找
- <!--{if $maxprice && $isfirstpost && !$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}-->
复制代码
改为
- <!--{if $maxprice && $isfirstpost && !$thread['special'] && $postnumber == '1'}-->
- <tr>
- <td class="altbg1">{lang price}({$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}-->
复制代码
再拉到最底再找
- <input type="hidden" name="pid" value="$pid">
复制代码
之下加入
- <input type="hidden" name="postnumber" value="$postnumber">
复制代码
=====================================================
templates/default/templates.lang.php 找
- 'post_price_refunded' => '本主题被强制退款',
复制代码
之下加入
- 'post_price_closerefund' => '本主题被终止出售',
复制代码
再找
- 'admin_refund' => '强制退款',
复制代码
之下加入
- 'admin_closerefund' => '终止出售',
复制代码
============================================
templates/default/viewthread.htm 找
- <a href="misc.php?action=viewpayments&tid=$tid">{lang price_thread} {$extcredits[$creditstrans][title]} <span class="bold">$thread[price]</span> {$extcredits[$creditstrans][unit]}</a>
复制代码
之下加入
- <!--{if $forum['ismoderator'] && $thread['authorid'] != $discuz_uid}--><a href="misc.php?action=pay&tid=$tid">友情付费</a> <!--{/if}-->
复制代码
再找
- <!--{if $ishide && $post['attachments'] && !$post['attachment']}-->
复制代码
改为
- <!--{if ($ishide || $nopay) && $post['attachments'] && !$post['attachment']}-->
复制代码
再找
- <!--{if $forum['ismoderator'] || $post['authorid'] == $discuz_uid}--> <a href="post.php?action=edit&fid=$fid&tid=$tid&pid=$post[pid]&page=$page&extra=$extra">{lang edit}</a> <!--{/if}-->
复制代码
改为
- <!--{if $forum['ismoderator'] || $post['authorid'] == $discuz_uid}--> <a href="post.php?action=edit&fid=$fid&tid=$tid&pid=$post[pid]&page=$page&extra=$extra&postnumber=$post[number]">{lang edit}</a> <!--{/if}-->
复制代码
再找
- <!--{if $thread['price'] > 0 && $allowrefund && $thread['special'] == 0}--><option value="refund">{lang admin_refund}</option><!--{/if}-->
复制代码
改为
- <!--{if $thread['price'] > 0 && $allowrefund && $thread['special'] == 0}--><option value="refund">{lang admin_refund}</option><option value="closerefund">{lang admin_closerefund}</option><!--{/if}-->
复制代码
============================================
templates/default/viewthread_printable.htm 找
( 这修改 是 可打印版本 显示图片真实地址 )
- {lang attach_img}: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <b>$attach[filename]</b> ($attach[dateline], $attach[attachsize]) / {lang attach_download_count} $attach[downloads]<br>{$boardurl}attachment.php?aid=$attach[aid]<br><br><img src="$attachurl/$attach[attachment]" border="0" onload="if(this.width >screen.width*0.8) this.width=screen.width*0.8" alt="" />
复制代码
改为
- {lang attach_img}: <!--{if $attach['description']}-->[{$attach[description]}]<!--{/if}--> <b>$attach[filename]</b> ($attach[dateline], $attach[attachsize]) / {lang attach_download_count} $attach[downloads]<br>{$boardurl}attachment.php?aid=$attach[aid]<br><br><img src="attachment.php?aid=$attach[aid]" border="0" onload="if(this.width >screen.width*0.8) this.width=screen.width*0.8" alt="" />
复制代码
=====================================================
templates/default/topicadmin_refund.htm 找
- <form method="post" action="topicadmin.php?action=refund">
复制代码
之上加入 ( 紧记加在上面 )
- <!--{if $action == 'closerefund'}-->
- <form method="post" action="topicadmin.php?action=closerefund">
- <input type="hidden" name="formhash" value="{FORMHASH}">
- <table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
- <tr class="header">
- <td colspan="2">{lang admin_closerefund}</td>
- </tr>
- <tr>
- <td class="altbg1" width="21%">{lang username}:</td>
- <td class="altbg2">$discuz_userss <span class="smalltxt">[<a href="$link_logout">{lang member_logout}</a>]</span></td>
- </tr>
- </table><br>
- <input type="hidden" name="fid" value="$fid">
- <input type="hidden" name="tid" value="$tid">
- <center><input type="submit" name="refundsubmit" value="{lang admin_closerefund}"></center>
- </form>
- <!--{else}-->
复制代码
再找
之上加入 ( 紧记加在上面 )
============================================
~ 完 ~
============================================ |