Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 修改_出售使用代码_ [sell=xx] 出售内容 [/sell] 简体版

[复制链接]
haohao036 发表于 2006-1-14 14:25:46 | 显示全部楼层 |阅读模式
本地测试隐藏附件通过


更新都在繁体版。如要更新请点击进入https://discuz.dismall.com/viewth ... page%3D3&page=1

#############################################
#
# 插件作者:别问我是谁
#
# 插件名称:出售内容 [sell=??] 出售内容 [/sell]
#
# 适用版本:Discuz! 4.0.0
#
# 相关修改:无需升级数据库,修改 13 份文件
#
# 安装难度:对曾经有加过插件修改过档案者:易
#
# 最后更新:14 - 01 - 2006
#
# 本人发布的所有插件 欢迎转载 齐来分享 功德无量
#
#############################################


本人最想有的插件有四个 已做了两个

1.已提供:每区独立设定显示多少条论坛公告
2.已提供:改用回 [sell=??] 出售内容 [/sell] 代码

3,还未制作:作者及管理员可选择退款
4,还未制作:帖子加入排序功能

 不知以上有否插件作者会去制作呢 

=============== 程序说明 ==================

 将现时的出售 需要付费才可进入查看主题

 改为以往使用的 可进入观看帖子

 [sell=??] 出售内容 [/sell] 付费后查看内容

 将出售的内容隐藏 需付费后才可查看

 使用方法有两个  1. 填入出售的价格  2. 使用代码

 只需选其中一项 程式会完成整段出售代码

============= 本程式最大优点 =====================

 就算内容用了 [sell=??] 出售内容 [/sell] 这代码

 程式亦可作检查 是否超出你用户组的最高出售价格

 若是超出 程式会将这价格改为您用户组的最高出售价格

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

 除了 misc.php 加入一次数据库查询检查是否己付费

 其它全部档案 绝对没有增加数据库查询

 并在 include/newreply.inc.php 这文件

 在有出售的帖子内 并减少一次数据库查询

 每篇主题内只可有一次出售 再多也是无效

 就等于在同一帖放置多个 [hide] 一样道理

 回覆不可出售 因为这是修改版插件 不是新插件

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

 出售按钮制作 在 第5楼 

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

 无需升级数据库 只需修改档案

 ( 修改前请先备份以下档案 )
 ( 用后有什么问题 可将备份档案上传恢复正常 )

 修改前注意 你要有修改过 hide 对附件隐藏

 https://discuz.dismall.com/viewthread.php?tid=201256

============= 修改文件 =====================

 viewthread.php
 misc.php
 post.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/post_editpost.htm
 templates/default/viewthread.htm ( 所有风格有这份档 viewthread.htm 亦要修改 )

 以下这份 修正两个原程式错误
 templates/default/viewthread_printable.htm

 ( 修改上传完成 紧记 更新缓存 )

 完成后 只要进入以前有出售的帖内  按进编辑

 再提交一次 程式会将旧有的出售转换为现在新的

 花了数天制作 测试 修正 本人现时已很累了 

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

 viewthread.php 找

  1. if($thread['price'] > 0) {
  2.         if($maxchargespan && $timestamp - $thread['dateline'] >= $maxchargespan * 3600) {
  3.                 $db->query("UPDATE {$tablepre}threads SET price='0' WHERE tid='$tid'");
  4.                 $thread['price'] = 0;
  5.         } else {
  6.                 if(!$discuz_uid) {
  7.                         showmessage('group_nopermission', NULL, 'NOPERM');
  8.                 } elseif(!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
  9.                         $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
  10.                         if(!$db->num_rows($query)) {
  11.                                 require_once DISCUZ_ROOT.'./include/threadpay.inc.php';
  12.                                 exit();
  13.                         }
  14.                 }               
  15.         }
  16. }
复制代码


 改为

  1. $pricepay = $thread['price'];
  2. if($thread['price'] > 0) {
  3.         if($maxchargespan) {
  4.                 $daynow = intval(($timestamp - $thread[dateline])/3600);
  5.                 $paytimes = $maxchargespan - $daynow;
  6.         } else {
  7.                 $paytimes = "不限";
  8.                 }
  9.         if($maxchargespan && $timestamp - $thread['dateline'] >= $maxchargespan * 3600) {
  10.                 $db->query("UPDATE {$tablepre}threads SET price='-2' WHERE tid='$tid'");
  11.                 showmessage("本主题自发表起已超过最长出售时限,重新进入可免费查看。","viewthread.php?tid=$tid");
  12.         } else {
  13.                 if(!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
  14.                         $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
  15.                         if(!$db->num_rows($query)) {
  16.                         $nopay = 1;
  17.                 if($pay == 'pay') {
  18.                         require_once DISCUZ_ROOT.'./include/threadpay.inc.php';
  19.                         exit();
  20.                 }
  21.                         }
  22.                 }
  23.         }
  24. }
复制代码


 misc.php 找

  1. } elseif($action == 'pay') {
复制代码


 之下加入

  1.        $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
  2.         if($db->num_rows($query)) {
  3.                 showmessage("您已经付过费,不用再付。","viewthread.php?tid=$tid");
  4.         }
复制代码


 post.php 找


  1. if(empty($bbcodeoff) && !$allowhidecode && preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
  2.         showmessage('post_hide_nopermission');
  3. }
复制代码


 之下加入

  1.         if($maxprice == 0 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
  2.                 showmessage("抱歉!您的用户组不可发表出售,请返回。");        
  3.         }
复制代码


 若您有安装本人提供的每区独立设定可否出售 以下不用修改 改为修改以下

 找

  1.        if($forum['allowsell'] == '0' && $price) {
  2.                 showmessage('post_forum_sell_nopermission');        
  3.         }
复制代码


 之下加入

  1.        if($forum['allowsell'] == '0' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
  2.                 showmessage("抱歉!您的用户组不可发表出售,请返回。");        
  3.         }
复制代码


 topicadmin.php 找 ( 以下是删除主题后将付费记录删除 )

                     
  1.        $db->query("DELETE FROM {$tablepre}polls WHERE tid IN ($moderatetids)");
复制代码


 之下加入

                           
  1. $db->query("DELETE FROM {$tablepre}paymentlog WHERE tid IN ($moderatetids)");
复制代码


 再找 ( 以下是强制退款后将付费记录删除 )

  1.        $db->query("UPDATE {$tablepre}paymentlog SET amount='0', netamount='0' WHERE tid='$tid'");
复制代码


 改为

  
  1.            $db->query("DELETE FROM {$tablepre}paymentlog WHERE tid='$tid'");
复制代码


 再找 ( 以下是合并主题后将付费记录删除 )

      
  1.       $db->query("DELETE FROM {$tablepre}polls WHERE tid='$othertid'");
复制代码


 之下加入

            
  1. $db->query("DELETE FROM {$tablepre}paymentlog WHERE tid='$othertid'");
复制代码



 include/threadpay.inc.php 找

         
  1.    $post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);;
复制代码


 改为 这句有错 $timeoffset * 3600);; <-- 多了一个 ; 所以顺手改回正确

         
  1.     $post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
  2.                 $post['message'] = preg_replace("/\[sell=\d*\](.+?)\[\/sell\]/is", "**** 付费信息,已经隐藏 ****", $post['message']);
复制代码


 include/newthread.inc.php 找

     
  1. $price = $maxprice ? ($price <= $maxprice ? $price : $maxprice) : 0;
复制代码


 改为

  1. //----------------------------- 检查最高售价开始 --------------------------------
  2.         if($price){
  3.         if($price > $maxprice) {
  4.         $price = $maxprice;
  5.         }
  6.                 $message="[sell=".$price."]".$message."[/sell]";

  7.         }elseif(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))){

  8.         if(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
  9.         $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\2", $message);
  10.         $price = isset($postsell) ? (float)$postsell : '';
  11.         if($price > $maxprice) {
  12.         $price = $maxprice;
  13.         }
  14.         $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);

  15.         }elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
  16.         $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\1", $message);
  17.         $price = isset($postsell) ? (float)$postsell : '';
  18.         if($price > $maxprice) {
  19.         $price = $maxprice;
  20.         }
  21.         $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);

  22.         }elseif(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  23.         $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]*/ies", "\\2", $message);
  24.         $price = isset($postsell) ? (float)$postsell : '';
  25.         if($price > $maxprice) {
  26.         $price = $maxprice;
  27.         }
  28.         $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);

  29.         }elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  30.         $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\1", $message);
  31.         $price = isset($postsell) ? (float)$postsell : '';
  32.         if($price > $maxprice) {
  33.         $price = $maxprice;
  34.         }
  35.         $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);

  36.         }
  37.         }
  38. //----------------------------- 检查最高售价结束 --------------------------------
复制代码


 include/newreply.inc.php 找

  1. if(empty($thread)) {
  2.         showmessage('thread_nonexistence');
  3. } elseif($thread['price'] > 0) {
  4.         if(!$discuz_uid) {
  5.                 showmessage('group_nopermission', NULL, 'NOPERM');
  6.         } elseif(!$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
  7.                 $query = $db->query("SELECT tid FROM {$tablepre}paymentlog WHERE tid='$tid' AND uid='$discuz_uid'");
  8.                 if(!$db->num_rows($query)) {
  9.                         showmessage('undefined_action', NULL, 'HALTED');
  10.                 }
  11.         }
  12. }
复制代码


 改为 ( 以上数据库查询已无用,可将它减去 )

  1. if(empty($thread)) {
  2.         showmessage('thread_nonexistence');
  3. }
复制代码


 再找

         
  1.    $message = preg_replace("/\[hide=\d*\](.+?)\[\/hide\]/is", "[b]$language[post_hidden][/b]", $message);
复制代码


 之下加入

            
  1. $message = preg_replace("/\[sell=\d*\](.+?)\[\/sell\]/is", "[b]**** 付费信息,已经隐藏 ****[/b]", $message);
复制代码


 再找

      
  1. require_once DISCUZ_ROOT.'./include/forum.func.php';
复制代码


 之下加入

      
  1. if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))) {
  2.                 showmessage('抱歉!回覆不可使用出售代码,请返回修改。');
  3.         }
复制代码


 include/editpost.inc.php 找

               
  1.       $price = $thread['price'] < 0 ?
  2.                                 ($isorigauthor || !$price ? -1 : $price) :
  3.                                 ($maxprice ? ($price <= $maxprice ? ($price > 0 ? $price : 0) : $maxprice) : ($isorigauthor ? 0 : $thread['price']));
复制代码


 改为

  1. //-----------------------------检查最高售价开始--------------------------------
  2.         if($price != '-1' || $price != '-2') {

  3.         if($price > 0 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {

  4.         if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))){

  5.         if($price > 0 && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
  6.         $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\2", $message);
  7.         }elseif($price > 0 && preg_match("/\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
  8.         $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\1", $message);
  9.         }elseif($price > 0 && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  10.         $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]*/ies", "\\2", $message);
  11.         }elseif($price > 0 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  12.         $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\1", $message);
  13.         }
  14.         $postsell = isset($postsell) ? (float)$postsell : '';
  15.         if($thread['price'] != $postsell){
  16.                 $price = $postsell;
  17.         }
  18.         if($price > $maxprice) {
  19.         $price = $maxprice;
  20.         }
  21.                 $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
  22.         }

  23.         }elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {

  24.         if(preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))){

  25.         if(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
  26.         $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\2", $message);
  27.         }elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]\s*(.+?)\s*/is", $message)) {
  28.         $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\](.*)/ies", "\\1", $message);
  29.         }elseif(!$price && preg_match("/\s*(.+?)\s*\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  30.         $postsell = preg_replace("/\s*(.+?)\s*\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]*/ies", "\\2", $message);
  31.         }elseif(!$price && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  32.         $postsell = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "\\1", $message);
  33.         }
  34.         $price = isset($postsell) ? (float)$postsell : '';
  35.         if($price > $maxprice) {
  36.         $price = $maxprice;
  37.         }
  38.                 $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", '\[sell='.$price.'\]\\2\[\/sell\]', $message);
  39.         }

  40.         }elseif($price > 0 && !preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  41.         if($price > $maxprice) {
  42.         $price = $maxprice;
  43.         }
  44.                 $message = "[sell=".$price."]".$message."[/sell]";
  45.         }
  46.         }
  47. //-----------------------------检查最高售价结束--------------------------------
复制代码


 再找

  1. if($subject == '' && $message == '') {
复制代码


 之上加入 ( 紧记加在上面 )

  1.         if($postnumber > 1 && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", preg_replace("/(\[code\].*\[\/code\])/is", '', $message))){
  2.                 showmessage('抱歉!回覆不可使用出售代码,请返回修改。');
  3.         }
复制代码



 include/discuzcode.func.php 找

  1.        global $discuzcodes, $credits, $tid, $discuz_uid, $highlight, $maxsmilies, $db, $tablepre, $ishide;
复制代码


 改为

  1.        global $discuzcodes, $credits, $tid, $discuz_uid, $highlight, $maxsmilies, $db, $tablepre, $ishide, $nopay, $pricepay, $paytimes;
复制代码


 再找

  
  1.     if(!$bbcodeoff && $allowimgcode) {
复制代码


 之上加入 ( 紧记加在上面 )

  1. //--------------------- 出售内容开始 -------------------------
  2.         if($pricepay && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {

  3.         if($pricepay == '-1' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  4.         $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "<fieldset style="padding: 5px;width:97%;border:1px solid ".BORDERCOLOR."" align="center"><legend>&nbsp;<span class='outertxt'>出 售 无 效</span>&nbsp;&nbsp;</legend><table align='center' border='0' width='97%' cellspacing='6' cellpadding='0'><tr><td>本主题被 [强制退款],所有付费者已得到退款。</td></tr></table></fieldset><br><br>\\2", $message);

  5.         }elseif($pricepay == '-2' && preg_match("/\[sell=\d*\].+?\[\/sell\]/is", $message)) {
  6.         $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>&nbsp;&nbsp;<span class='outertxt'>感 谢 所 有 己 付 费 者</span>&nbsp;&nbsp;</LEGEND><br>&nbsp; &nbsp; 本主题自发表起已超过最长出售时限,现已免费查看。<br><br></FIELDSET></td></tr></table></td></tr></table><br>\\2", $message);

  7.         }else{

  8.         if($nopay == '1') {
  9.                 if(!$discuz_uid) {
  10.         $paymessage = "非论坛会员无权购买,请 [ <a href='logging.php?action=login'>登陆</a> ] 或者 [ <a href='register.php'>注册</a> ]。";
  11.                 }else{
  12.         $paymessage = "请付费查看本帖出售内容&nbsp;&nbsp;<a href="viewthread.php?tid=$tid&pay=pay">[ 我要付费 ]</a>";
  13.                 }
  14.         $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>&nbsp;&nbsp;<span class='outertxt'>收 费 单</span>&nbsp;&nbsp;</LEGEND><br>&nbsp; &nbsp; $paymessage<br><br></FIELDSET></td></tr></table></td></tr></table><br>", $message);
  15.         }else{
  16.         $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>&nbsp;&nbsp;<span class='outertxt'>感 谢 您 的 付 费</span>&nbsp;&nbsp;</LEGEND><br>&nbsp; &nbsp; 您可以查看以下内容。如发现非法骗财、可以向 版主投诉。<br>&nbsp; &nbsp; 经查证骗财、会被强制退款,将全数款项退还所有已付费者。<br><br></FIELDSET></td></tr></table></td></tr></table><br>\\2", $message);
  17.         }
  18.                 }
  19.         }
  20. //--------------------- 出售内容结束 -------------------------
复制代码



 include/printable.inc.php 找

  1. while($post = $db->fetch_array($query)) {
复制代码


 之下加入

  1.        if($nopay){
  2.         $post['message'] = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/is", "**** 付费信息,已经隐藏 ****", $post['message']);
  3.         }
复制代码


 ( 以下是将 可打印版本 在无权查看时不显示内容 )
 再找

  1.       if($post['attachment']) {
复制代码


 改为

  
  1.     if($post['attachment'] && !$nopay && !$ishide) {
复制代码

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

 templates/default/post_editpost.htm 找

  1. <!--{if $maxprice}-->
  2.         <tr>
  3.         <td class="altbg1">{lang price}({$extcredits[$creditstrans][title]}):</td>
  4.         <td class="altbg2">
  5.         <!--{if $thread['price'] == -1 || $thread['freecharge']}-->
  6.                 <input type="text" name="price" size="6" value="$thread[pricedisplay]" disabled> <span class="smalltxt">{$extcredits[$creditstrans][unit]}&nbsp;
  7.                 <!--{if $thread['price'] == -1}-->({lang post_price_refunded})<!--{else}-->({lang post_price_free})<!--{/if}-->
  8.                 </span></td>
  9.         <!--{else}-->
  10.                 <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>
  11.         <!--{/if}-->
  12.         </tr>
  13. <!--{/if}-->
复制代码


 改为

  1. <!--{if $maxprice && $postnumber == '1'}-->
  2.         <tr>
  3.         <td class="altbg1">{lang price}({$extcredits[$creditstrans][title]}):</td>
  4.         <td class="altbg2">
  5.         <!--{if $thread['price'] == -1 || $thread['price'] == -2 || $thread['freecharge']}-->
  6.                 <input type="hidden" name="price" value="$thread[price]">
  7.                 <input type="text" size="6" value="0" disabled> <span class="smalltxt">{$extcredits[$creditstrans][unit]}&nbsp;
  8.                 <!--{if $thread['price'] == -1}-->({lang post_price_refunded})<!--{else}-->({lang post_price_free})<!--{/if}-->
  9.                 </span></td>
  10.         <!--{else}-->
  11.                 <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>
  12.         <!--{/if}-->
  13.         </tr>
  14. <!--{/if}-->
复制代码


 拉到最底再找

  1. <input type="hidden" name="pid" value="$pid">
复制代码


 之下加入

  1. <input type="hidden" name="postnumber" value="$postnumber">
复制代码



 templates/default/viewthread.htm 找

  1.        <!--{if $thread['price'] > 0}-->&nbsp; <a href="misc.php?action=viewpayments&tid=$tid">{lang price_thread} {$extcredits[$creditstrans][title]} <span class="bold">$thread[price]</span> {$extcredits[$creditstrans][unit]}</a> &nbsp;<!--{/if}-->
复制代码


 改为

  1.       <!--{if $thread['price'] > 0}-->&nbsp; <a href="misc.php?action=viewpayments&tid=$tid">{lang price_thread} {$extcredits[$creditstrans][title]} <span class="bold">$thread[price]</span> {$extcredits[$creditstrans][unit]}</a> &nbsp;
  2.         <!--{if $forum['ismoderator']}-->&nbsp; <a href="misc.php?action=pay&tid=$tid">友情付费</a><!--{/if}-->
  3. <!--{/if}-->
复制代码


 再找

  1. <!--{if $ishide && $post['attachments'] && !$post['attachment']}-->
复制代码


 改为

   
  1.    <!--{if ($ishide || $nopay) && $post['attachments'] && !$post['attachment']}-->
复制代码


 再找

   
  1. <!--{if $forum['ismoderator'] || $post['authorid'] == $discuz_uid}-->&nbsp;<a href="post.php?action=edit&fid=$fid&tid=$tid&pid=$post[pid]&page=$page&extra=$extra"><img src="{IMGDIR}/edit.gif" border="0" align="absmiddle" alt="{lang edit_post}"></a><!--{/if}-->
复制代码


 改为

     
  1. <!--{if $forum['ismoderator'] || $post['authorid'] == $discuz_uid}-->&nbsp;<a href="post.php?action=edit&fid=$fid&tid=$tid&pid=$post[pid]&page=$page&extra=$extra&postnumber=$post[number]"><img src="{IMGDIR}/edit.gif" border="0" align="absmiddle" alt="{lang edit_post}"></a><!--{/if}-->
复制代码


 templates/default/viewthread_printable.htm

 找 ( 这修改是原程式的错误 不会转为论坛设定的语言 )

  1. <meta http-equiv="Content-Type" content="text/html; charset={CHARSET}">
复制代码


 改为

  1. <meta http-equiv="Content-Type" content="text/html; charset=$charset">
复制代码


 再找 ( 这修改是 可打印版本 显示图片真实地址 )

                  
  1.   {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">
复制代码


 改为

   
  1.                 {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">
复制代码


============================================
       ~ 完 ~
============================================

[ 本帖最后由 haohao036 于 2006-3-13 11:23 编辑 ]
 楼主| haohao036 发表于 2006-1-14 14:26:06 | 显示全部楼层

按钮修改



修改档案

include/bbcode.js
templates/default/post_bbinsert.htm
templates/default/templates.lang.php

 下 bb_sell.gif 上传到 images/default/ 之内

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

include/bbcode.js 找

  1. function email() {
复制代码


之上加入 ( 紧记加在上面 )

  1. function sell() {
  2.         if (helpmode) {
  3.                 alert(sell_help);
  4.         } else if (document.selection && document.selection.type == "Text") {
  5.                 var range = document.selection.createRange();
  6.                 range.text = "[sell=2]\r" + range.text + "\r[/sell]\r";
  7.         } else if (advmode) {
  8.                 AddTxt="[sell=2]\r\r[/sell]\r";
  9.                 AddText(AddTxt);
  10.         } else {   
  11.                 txt=prompt(sell_normal,2);     
  12.                 if (txt!=null) {         
  13.                         AddTxt="[sell="+txt+"]\r";
  14.                         AddText(AddTxt);
  15.                         AddText("\r[/sell]\r");
  16.                 }              
  17.         }
  18. }
复制代码


templates/default/post_bbinsert.htm 找

      
  1. var list_normal_input = "{lang post_discuzcode_list_normal_input}";
复制代码


之下加入

  1.     var sell_help = "{lang post_discuzcode_sell}\n\n{lang post_discuzcode_sell_comment}";
  2.         var sell_normal = "{lang post_discuzcode_sell_normal}";
复制代码


再找

   
  1.   <a href="javascript:alipay()"><img src="{IMGDIR}/bb_alipay.gif" border="0" alt="{lang post_discuzcode_alipay}"></a>
复制代码


之下加入

  1.      <a href="javascript:sell()"><img src="images/default/bb_sell.gif" border="0" alt="{lang post_discuzcode_sell}"></a>
复制代码



templates/default/templates.lang.php 找

     
  1. 'post_discuzcode_email_normal_input' => '请输入邮件地址。',
复制代码


之下加入

  1.       'post_discuzcode_sell' => '插入售卖帖子标签',
  2.         'post_discuzcode_sell_comment' => '给标签所包围的内容需付费察看。\n例如:[sell=1]售卖帖子[/sell]',
  3.         'post_discuzcode_sell_normal' => '请输入要售卖的金额。',
复制代码


=================================================
         ~ 完 ~
=================================================

[ 本帖最后由 haohao036 于 2006-1-14 14:29 编辑 ]
回复

使用道具 举报

liwen240 发表于 2006-1-14 14:40:39 | 显示全部楼层
好啊!
回复

使用道具 举报

newo 发表于 2006-1-14 22:50:34 | 显示全部楼层
多谢楼主啊~~帮了大忙!
回复

使用道具 举报

別問我是誰 发表于 2006-1-14 23:11:49 | 显示全部楼层
 您的發言非常精彩 請再接再勵 
回复

使用道具 举报

福帅 发表于 2006-1-15 12:10:51 | 显示全部楼层
發言非常精彩 
回复

使用道具 举报

pinkhomepage 发表于 2006-1-15 16:19:49 | 显示全部楼层
耶,终于有了~HOHOHO
回复

使用道具 举报

soryuden 发表于 2006-3-13 01:44:51 | 显示全部楼层
什么时候能出4.1的版本啊
回复

使用道具 举报

別問我是誰 发表于 2006-3-13 01:48:14 | 显示全部楼层
4.1 亦可使用
回复

使用道具 举报

wptang 发表于 2006-3-13 02:18:39 | 显示全部楼层
装了一个多小时 D4.1上没任何反应……  

2楼的装上就是  抱歉!您的用户组不可发表出售,请返回。  管理员账号和普通账号都一样……


[ 本帖最后由 wptang 于 2006-3-13 02:54 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-18 12:36 , Processed in 0.112541 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表