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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原创]隐藏时效(过了隐藏时效,隐藏自动失效)

[复制链接]
guigeng 发表于 2005-10-22 10:36:22 | 显示全部楼层
哪这样不会有什么问题吧?
回复

使用道具 举报

 楼主| lu5266 发表于 2005-10-22 10:38:18 | 显示全部楼层
原帖由 lu5266 于 2005-10-22 10:16 发表



你安装的是这个插件的话
加在第一个那里就可以了

第二个你又安装了
我的买卖时效
那里是我已经加了



也就是
你只须在第一个那里加就可以了
回复

使用道具 举报

guigeng 发表于 2005-10-22 11:02:06 | 显示全部楼层
我的源代码给你看下~


  1. <?php

  2. /*
  3. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  4. :: [DISCUZ!]  Crossday Discuz! Board                                    ::
  5. :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com)                ::
  6. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  7. :: Author:  Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
  8. :: Version: 2.5F   2004/10/01 05:15                                     ::
  9. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  10. */
  11. //fix:  BY pk0909
  12. /*
  13. 1 多出来的空格
  14. 2 bbcode 解析问题
  15. 3 img code 对特殊符号的js未转义
  16. */

  17. if(!defined('IN_DISCUZ')) {
  18.         exit('Access Denied');
  19. }

  20. $searcharray=$replacearray= array();
  21. $post_codecount = $post_phpcodecount = -1;
  22. $codecount = 0 ;

  23. function censor($message) {
  24.         global $_DCACHE;

  25.         require_once(DISCUZ_ROOT.'/forumdata/cache/cache_censor.php');
  26.         return empty($_DCACHE['censor']) ? $message : @preg_replace($_DCACHE['censor']['find'], $_DCACHE['censor']['replace'], $message);
  27. }

  28. function credithide($creditsrequire, $message) {
  29.         if($GLOBALS['credit'] < $creditsrequire && !$GLOBALS['ismoderator']) {
  30.                 return "<b>**** Hidden to Credits Lower Than $creditsrequire ****</b>";
  31.         } else {
  32.                 return '<b>Below Message for Credits Higher Than '.$creditsrequire.'</b><br>'.
  33.                         '==============================<br><br>'.
  34.                         str_replace('\"', '"', $message).'<br><br>'.
  35.                         '==============================';
  36.         }
  37. }

  38. function codedisp($code) {
  39.         global $thisbg, $codecount, $post_codecount, $codehtml;
  40.         $post_codecount++;
  41.         $code = htmlspecialchars(str_replace('\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)));
  42.         $codehtml[$post_codecount] = "<blockquote class="code"><b class="smalltxt">CODE:</b>&nbsp;&nbsp;<a href="###" class="smalltxt" onclick="copycode(findobj('code$codecount'));">[Copy to clipboard]</a><hr size=1 color="".BORDERCOLOR.""><div style="padding:5px; font-family:Courier New;" id="code$codecount">$code</div></blockquote>";

  43.         $codecount++;
  44.         return "[\tDISCUZ_CODE_$post_codecount\t]";
  45. }

  46. function parseurl(&$message) {
  47.         return preg_match("/\[code\].+?\[\/code\]/is", $message) ? $message :
  48.                 substr(preg_replace(        array(
  49.                                         "/(?<=[^\]a-z0-9-="'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i",
  50.                                         "/(?<=[^\]a-z0-9\/\-_.~?=:.])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/i"
  51.                                 ), array(
  52.                                         "[url]\\1\\3[/url]",
  53.                                         "[email]\\0[/email]"
  54.                                 ), ' '.$message), 1);
  55. }

  56. function postify($message, $smileyoff, $bbcodeoff, $allowsmilies = 1, $allowhtml = 0, $allowbbcode = 1, $allowimgcode = 1) {
  57. // 帖子买卖-start
  58.         global $credit, $tid, $discuz_uid, $discuz_user, $codehtml, $post_codecount, $thisbg, $highlight, $table_posts,$thread, $mtime, $dateformat, $timeformat, $timeoffset, $db, $searcharray, $replacearray, $sellmessage,$ismoderator,$post_sellcount,$phpcodehtml,$post_phpcodecount;
  59.         $post_sellcount=0;
  60.         $post_codecount = -1;
  61.         $post_phpcodecount = -1;
  62.         $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "postsell(\\1,'\\2')", $message);
  63. // 帖子买卖-end


  64.         if(!$bbcodeoff && $allowbbcode) {
  65.                 $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);
  66.             $message = preg_replace("/\s*\[php\](.+?)\[\/php\]\s*/ies", "phpcodedisp('\\1')", $message);
  67.         }

  68.         if(!$allowhtml) {
  69.                 $message = dhtmlspecialchars($message);
  70.         }

  71.         if(!$smileyoff && $allowsmilies) {

  72.                 if(is_array($GLOBALS['_DCACHE']['smilies'])) {
  73.                         foreach($GLOBALS['_DCACHE']['smilies'] as $smiliey) {
  74.                                 $message = str_replace($smiliey['code'], "<img src="".SMDIR."/$smiliey[url]" align="absmiddle" border="0">",$message);
  75.                         }
  76.                 }
  77.         }

  78.         if(!$bbcodeoff && $allowbbcode) {

  79.                 if(empty($searcharray['bbcode_regexp']) || empty($replacearray['bbcode_regexp']) || empty($searcharray['bbcode_str']) || empty($replacearray['bbcode_str'])) {
  80.                         $searcharray['bbcode_regexp'] = array(
  81.                                 "/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is",
  82.                                 "/(\[box=(#[0-9A-F]{6}|[a-z]+)\])[\n\r]*(.+?)[\n\r]*(\[\/box\])/is",
  83.                                 "/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/){1}([^\["']+?)\s*\[\/url\]/ie",
  84.                                 "/\[url=www.([^\["']+?)\](.+?)\[\/url\]/is",
  85.                                 "/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms){1}:\/\/([^\["']+?)\](.+?)\[\/url\]/is",
  86.                                 "/\[email\]\s*([A-Za-z0-9\-_.]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\s*\[\/email\]/i",
  87.                                 "/\[email=([A-Za-z0-9\-_.]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\](.+?)\[\/email\]/is",
  88.                                 "/\[color=([#0-9a-zA-Z]{3,10})\]/i",
  89.                                 "/\[size=([\-0-9]{1,2})\]/i",
  90.                                 "/\[font=([^\[]+?)\]/i",
  91.                                 "/\[align=(left|right|center)\]/i",
  92.                                 "/\[center\]/i"
  93.                         );
  94.                         $replacearray['bbcode_regexp'] = array(
  95.                                 "<br><br><center><table border="0" width="90%" cellspacing="0" cellpadding="0"><tr><td>&nbsp;&nbsp;Quote:</td></tr><tr><td><table border="0" width="100%" cellspacing="1" cellpadding="10" bgcolor="".BORDERCOLOR.""><tr><td width="100%" bgcolor="".ALTBG2."" style="word-break:break-all">\\1</td></tr></table></td></tr></table></center><br>",
  96.                                 "<blockquote style="background-color: \\2 ;"><span class="bold">$title</span>\\3</blockquote>",
  97.                                 "cuturl('\\1\\2')",
  98.                                 "<a href="http://www.\\1" target="_blank">\\2</a>",
  99.                                 "<a href="\\1://\\2" target="_blank">\\3</a>",
  100.                                 "<a href="mailto:\\1@\\2">\\1@\\2</a>",
  101.                                 "<a href="mailto:\\1@\\2">\\3</a>",
  102.                                 "<font color="\\1">",
  103.                                 "<font size="\\1">",
  104.                                 "<font face="\\1">",
  105.                                 "<p align="\\1">",
  106.                                 "<p align="center">"
  107.                         );

  108.                         if($GLOBALS['_DCACHE']['bbcodes']) {
  109.                                 $searcharray['bbcode_regexp'] = array_merge($searcharray['bbcode_regexp'], $searcharray['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['searcharray']);
  110.                                 $replacearray['bbcode_regexp'] = array_merge($replacearray['bbcode_regexp'], $replacearray['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['replacearray']);
  111.                                 unset($GLOBALS['_DCACHE']['bbcodes']);
  112.                         }

  113.                         $searcharray['bbcode_str'] = array(
  114.                                 '[/color]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]',
  115.                                 '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]',
  116.                                 '[list=A]', '[*]', '[/list]','[/center]'
  117.                         );

  118.                         $replacearray['bbcode_str'] = array(
  119.                                 '</font>', '</font>', '</font>', '</p>', '<b>', '</b>', '<i>',
  120.                                 '</i>', '<u>', '</u>', '<ul>', '<ol type=1>', '<ol type=a>',
  121.                                 '<ol type=A>', '<li>', '</ul></ol>','</p>'
  122.                         );      
  123.                 }               

  124.                 @$message = str_replace($searcharray['bbcode_str'], $replacearray['bbcode_str'],
  125.                                 preg_replace($searcharray['bbcode_regexp'], $replacearray['bbcode_regexp'], $message));

  126.                 if(preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", $message)) {
  127.                         if(stristr($message, '[hide]')) {
  128.                                 $query = $db->query("SELECT pid FROM $table_posts WHERE tid='$tid' AND authorid='$discuz_uid' LIMIT 1");
  129.                            if(!$db->result($query, 0) && !$ismoderator){
  130.                                                         
  131.                                    $hideresult[0]=$thread[hidetime];  $hideresult[1]=$thread[dateline];
  132.                                    if($hideresult[0]){
  133.                                    $leavetime=$hideresult[0]*60*60 -($mtime[1]-$hideresult[1]);
  134.                                    $hideend=$hideresult[0]*60*60+$hideresult[1];
  135.                                    $hideresult[1] = gmdate("$dateformat $timeformat", $hideresult[1] + $timeoffset * 3600);        
  136.                                    $hideend= gmdate("$dateformat $timeformat", $hideend + $timeoffset * 3600);                           
  137.                                    $hidedate=floor($leavetime/60/60/24);
  138.                                    $hidehour=floor($leavetime/60/60%24);
  139.                                    $hideminute=ceil($leavetime/60%60);
  140.                                    }
  141.                                     else {$hideresult[0]=$hidedate=$hidehour=$hideminute=$hideend="无限"; $leavetime=1;
  142.                                           $hideresult[1] = gmdate("$dateformat $timeformat", $hideresult[1] + $timeoffset * 3600);
  143.                                        }
  144.                   }
  145.                   
  146.                                 if( $ismoderator || $db->result($query, 0) || $leavetime<=0) {
  147.                                         $message = preg_replace("/\[hide\]\s*(.+?)\s*\[\/hide\]/is", "<span class="bold">本主题你已回复,或者隐藏时效已过,以下为隐藏内容</span><br><hr color=blue><br><br>\\1<br><br><hr color=blue></font>", $message);
  148.                                 } else {
  149.                                         $message = preg_replace("/\[hide\](.+?)\[\/hide\]/is", "<b><font color=blue>本主题的部分内容必须回复或者过了隐藏时限才可以浏览<hr><font color=blue>时限: <font color=red>$hideresult[0]</font> 小时, 剩下: <font color=red>$hidedate</font> 天 <font color=red>$hidehour</font> 小时 <font color=red>$hideminute</font> 分   开始: <font color=red>$hideresult[1]</font> 结束:<font color=red>$hideend</font></font></b><hr>", $message);
  150.                                 }
  151.                         }

  152.                         $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "credithide(\\1,'\\2')", $message);
  153.                 }

  154.         }

  155.         if(!$bbcodeoff && $allowimgcode) {
  156.                 if(empty($searcharray['imgcode']) || empty($replacearray['imgcode'])) {
  157.                         $searcharray['imgcode'] = array(
  158.                                 "/\[swf\]\s*([^\[]+?)\s*\[\/swf\]/ies",
  159.                                 "/\[img\]\s*([^\[]+?)\s*\[\/img\]/ies",
  160.                                 "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[]+?)\s*\[\/img\]/ies"
  161.                         );
  162.                         $replacearray['imgcode'] = array(
  163.                                 "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle"> <a href="%s" target="_blank">Flash: %s</a> ')",
  164.                                 "bbcodeurl('\\1', '<img src="%s" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\';}" onmouseover="if(this.resized) this.style.cursor=\'hand\';" onclick="if(this.resized) {window.open(this.src);}">')",
  165.                                 "bbcodeurl('\\3', '<img width="\\1" height="\\2" src="%s" border="0">')"
  166.                         );
  167.                 }
  168.                 $message = preg_replace($searcharray['imgcode'], $replacearray['imgcode'], $message);
  169.         }

  170. // 帖子买卖--start
  171. for($si = 0; $si <= $post_sellcount; $si++) {
  172.   $message = str_replace("|\tDISCUZ_SELL_$si\t|", $sellmessage[$si], $message);
  173. }
  174. unset ($sellmessage);
  175. //帖子买卖--end


  176.         for($i = 0; $i <= $post_codecount; $i++) {

  177.         $message = str_replace("[\tDISCUZ_CODE_$i\t]", $codehtml[$i], $message);
  178.         }

  179.         if($highlight) {
  180.                 foreach(explode('+', $highlight) as $ret) {
  181.                         if($ret) {
  182.                                 $message = preg_replace("/(?<=[\s"\]>()]|^)(".preg_quote($ret, '/').")(([\.,;-?!()]+)?([\s"<\[]|$))/siU", "<u><b><font color="#FF0000">\\1</font></b></u>\\2", $message);
  183.                         }
  184.                 }
  185.         }
  186.         for($i = 0; $i <= $post_phpcodecount; $i++) {
  187.                         $message = str_replace("|\tDISCUZ_PHPCODE_$i\t|", $phpcodehtml[$i], $message);
  188.             }

  189.         $message = nl2br(str_replace(
  190.                                                         array("\t", '   ', '  '),
  191.                                                         array('&nbsp; &nbsp; &nbsp; &nbsp; ', '&nbsp; &nbsp;', '&nbsp;&nbsp;')
  192.                                                         , $message)
  193.                                         );

  194.         return $message;
  195. }

  196. function cuturl($url) {
  197.         $length = 65;
  198.         $urllink = "<a href="".(substr(strtolower($url), 0, 4) == 'www.' ? "http://$url" : $url).'" target="_blank">';
  199.         if(strlen($url) > $length) {
  200.                 $url = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
  201.         }
  202.         $urllink .= $url.'</a>';
  203.         return $urllink;
  204. }

  205. function bbcodeurl($url, $tags) {
  206.         if(!preg_match("/<.+?>/s",$url)) {
  207.                 if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) {
  208.                         $url = 'http://'.$url;
  209.                 }
  210.                 return str_replace('submit', '', sprintf($tags, $url, $url));
  211.         } else {
  212.                 return '&nbsp;'.$url;
  213.         }
  214. }

  215. function phpcodedisp($code) {
  216.         global $thisbg, $codecount, $post_phpcodecount, $phpcodehtml,$post;
  217.         $post_phpcodecount++;
  218.         $phpcode = phphighlite(str_replace("\\"", """, $code));
  219.                 $phpcodeid ="pcode_$post[pid]_$post_phpcodecount";
  220.                 $phpcodehtml[$post_phpcodecount] = "<blockquote class="code"><b class="smalltxt">PHP:</b>&nbsp;&nbsp;<a href="###" class="smalltxt" onclick="copycode(findobj('$phpcodeid'));">[Copy to clipboard]</a><hr size=1 color="".BORDERCOLOR.""><div style="padding:5px; font-family:Courier New;" id="$phpcodeid">$phpcode</div></blockquote>";
  221.         $phpcodecount++;
  222.         return "|\tDISCUZ_PHPCODE_$post_phpcodecount\t|";
  223. }
  224. function phphighlite($code) {
  225.         if(!strpos($code,"&lt;?\n") && !strpos($code,'&lt;?') &&  substr($code,0,2)!='&lt;?'){
  226.                 $code='<'.'?'.trim($code).' ?'.'>';
  227.                 $addedtags=1;
  228.         }
  229.         ob_start();
  230.         $oldlevel=error_reporting(0);
  231.         highlight_string($code);
  232.         error_reporting($oldlevel);
  233.         $buffer = ob_get_contents();
  234.         ob_end_clean();
  235.         if ($addedtags) {
  236.                 $openingpos = strpos($buffer,'&lt;?');
  237.                 $closingpos = strrpos($buffer, '?');
  238.                 $buffer=substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);
  239.         }
  240.         $buffer = str_replace("&quot;", """, $buffer);
  241.         $buffer = str_replace("<br />", '', $buffer);
  242.         return $buffer;
  243. }

  244. function clear_bbcode($code){
  245.         $rep = array('[', ']', ':', '(', ')');
  246.         for ($x = 0; $x < count($rep); $x++) {
  247.                 $code = str_replace($rep[$x], '&#'.ord($rep[$x]).';', $code);
  248.         }
  249.         return $code;
  250. }

  251. //贴子买卖funciton ========start
  252. function postsell($price, $message) {
  253.     global $thisbg, $post_sellcount,$db,$post, $sellmessage,$tid,$table_posts,$hacktable_postpay,$discuz_user,$issupermod,$ismoderator,$isadmin,$usermoney,$page,$thread, $mtime, $dateformat, $timeformat, $timeoffset,$issellfree;
  254.     //$message=stripslashes($message);
  255. $message = str_replace("\\"", """, preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1",
  256. $message));
  257.     $post_sellcount++;
  258.     $price=abs(intval($price));
  259.     $post['needmoney']=$post['needmoney']+$price;
  260.     $query = $db->query("SELECT COUNT(*) FROM $hacktable_postpay WHERE pid='$post[pid]' AND sellcount='$post_sellcount' ");
  261.     $payusercount=$db->result($query, 0);

  262.                                                         
  263.         $sellresult[0]=$thread[selltime];  $sellresult[1]=$thread[dateline];
  264.         if($sellresult[0]){
  265.           $leavetime=$sellresult[0]*60*60 -($mtime[1]-$sellresult[1]);
  266.           $sellend=$sellresult[0]*60*60+$sellresult[1];
  267.           $sellresult[1] = gmdate("$dateformat $timeformat", $sellresult[1] + $timeoffset * 3600);        
  268.           $sellend= gmdate("$dateformat $timeformat", $sellend + $timeoffset * 3600);                           
  269.           $selldate=floor($leavetime/60/60/24);
  270.           $sellhour=floor($leavetime/60/60%24);
  271.           $sellminute=ceil($leavetime/60%60);
  272.           $effdate=floor($sellresult[0]/24);
  273.           $effhour=floor($sellresult[0]%24);
  274.           }
  275.         else {$effdate=$effhour=$selldate=$sellhour=$sellminute=$sellend="无限"; $leavetime=1;
  276.                 $sellresult[1] = gmdate("$dateformat $timeformat", $sellresult[1] + $timeoffset * 3600);
  277.              }
  278.    
  279.    
  280.     if ($discuz_user){
  281.         if ($usermoney >= $price){
  282.             $paymessage="你的现金是:$usermoney ,可以<a href="postpay.php?action=pay&tid=$tid&pid=$post[pid]&sellcount=$post_sellcount&money=$price&page=$page">[立即付费]</a>。";
  283.         }else{
  284.             $paymessage="你的现金是:$usermoney ,无法付费。去[<a href='plugins.php?p=bank'>银行</a>]取款或者卖些积分吧。";
  285.         }
  286.     }else{
  287.             $paymessage= "非本站会员无权购买,请[<a href='logging.php?action=login'>登陆</a>],或者[<a href='register.php'>注册</a>]";
  288.     }
  289.      
  290.   if($leavetime>0) $paymessage.="<hr><b><font color='blue'>出售时限:&nbsp;&nbsp;<font color=red>$effdate</font> 天 <font color=red>$effhour</font> 小时&nbsp;&nbsp; 剩下:&nbsp;&nbsp; <font color=red>$selldate</font> 天 <font color=red>$sellhour</font> 小时 <font color=red>$sellminute</font> 分  <br> 开始: <font color=red>$sellresult[1]</font> 结束:<font color=red>$sellend</font></font></b>";


  291. $sm1="<br><center><table class='tableborder' cellSpacing='1' cellPadding='4' width='75%' border='0' align='center' bgcolor='#E4E4E3'><tr class='header'><td width='100%' colSpan='4'>&nbsp;付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'>&nbsp;编号:</td><td width='35%'><span class='small'>&nbsp;<input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'>&nbsp;价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'>&nbsp;<input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'>&nbsp;名单:</span></td><td><span class='small'>&nbsp;请付费后再查看!</span></td><td><span class='small'>&nbsp;人数:</span></td><td><span class='smalltxt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name=p103 value='$payusercount' size=6></span></td></tr><tr bgColor='#ffffff'><td align='middle' width='100%' colSpan='4'><font color ='#000000'>请付费察看本帖隐藏内容,$paymessage</font></td></tr></table></center>";
  292. $sm2="<br><center><table class='tableborder' cellSpacing='1' cellPadding='4' width='75%' border='0' align='center' bgcolor='#E4E4E3'><tr class='header'><td width='100%' colSpan='4'>&nbsp;付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'>&nbsp;编号:</td><td width='35%'><span class='small'>&nbsp;<input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'>&nbsp;价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'>&nbsp;<input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'>&nbsp;名单:</span></td><td><span class='small'>&nbsp;<a href= 'postpay.php?action=showpayuser&tid=$tid&pid=$post[pid]&sellcount=$post_sellcount'><font color=red>点击察看</font></a></span></td><td><span class='small'>&nbsp;人数:</span></td><td><span class='smalltxt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name=p103 value='$payusercount' size=6></span></td></tr><tr bgColor='#ffffff'><td align='middle' width='100%' colSpan='4'><font color ='blue'>感谢您的付费!你可以观看以下付费内容了。如发现非法敛财,可以投诉给版主</font></td></tr></table></center>";
  293. $sm3="<br><center><table class='tableborder' cellSpacing='1' cellPadding='4' width='75%' border='0' align='center' bgcolor='#E4E4E3'><tr class='header'><td width='100%' colSpan='4'>&nbsp;付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'>&nbsp;编号:</td><td width='35%'><span class='small'>&nbsp;<input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'>&nbsp;价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'>&nbsp;<input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'>&nbsp;名单:</span></td><td><span class='small'>&nbsp;<a href= 'postpay.php?action=showpayuser&tid=$tid&pid=$post[pid]&sellcount=$post_sellcount'><font color=red>点击察看</font></a></span></td><td><span class='small'>&nbsp;人数:</span></td><td><span class='smalltxt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name=p103 value='$payusercount' size=6></span></td></tr><tr bgColor='#ffffff'><td align='middle' width='100%' colSpan='4'><font color ='blue'><b>你是出售者或者是管理人员,所以无须付费查看以下付费内容</b></font></td></tr></table></center>";
  294. $sm4="<br><center><table class='tableborder' cellSpacing='1' cellPadding='4' width='75%' border='0' align='center' bgcolor='#E4E4E3'><tr class='header'><td width='100%' colSpan='4'>&nbsp;付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'>&nbsp;编号:</td><td width='35%'><span class='small'>&nbsp;<input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'>&nbsp;价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'>&nbsp;<input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'>&nbsp;名单:</span></td><td><span class='small'>&nbsp;<a href= 'postpay.php?action=showpayuser&tid=$tid&pid=$post[pid]&sellcount=$post_sellcount'><font color=red>点击察看</font></a></span></td><td><span class='small'>&nbsp;人数:</span></td><td><span class='smalltxt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name=p103 value='$payusercount' size=6></span></td></tr><tr bgColor='#ffffff'><td align='middle' width='100%' colSpan='4'><font color ='blue'><b>出售期限已过,所以你无须付费查看以下付费内容</b></font></td></tr></table></center>";
  295. $sm5="<br><center><table class='tableborder' cellSpacing='1' cellPadding='4' width='75%' border='0' align='center' bgcolor='#E4E4E3'><tr class='header'><td width='100%' colSpan='4'>&nbsp;付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'>&nbsp;编号:</td><td width='35%'><span class='small'>&nbsp;<input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'>&nbsp;价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'>&nbsp;<input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'>&nbsp;名单:</span></td><td><span class='small'>&nbsp;<a href= 'postpay.php?action=showpayuser&tid=$tid&pid=$post[pid]&sellcount=$post_sellcount'><font color=red>点击察看</font></a></span></td><td><span class='small'>&nbsp;人数:</span></td><td><span class='smalltxt'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name=p103 value='$payusercount' size=6></span></td></tr><tr bgColor='#ffffff'><td align='middle' width='100%' colSpan='4'><font color ='blue'><b>您有查看及下载特权,但也可完成提交支付。<br>$paymessage</b></font></td></tr></table></center>";
  296.       

  297.     if ($discuz_user){
  298.         $query = $db->query("SELECT COUNT(*) FROM $table_posts WHERE pid='$post[pid]' AND author='$discuz_user'");
  299.         $isauthor = $db->result($query, 0);
  300.         if($issupermod || $ismoderator || $isadmin || $isauthor || $leavetime<=0 ){
  301.             $post['paymoney']=$post['needmoney'];
  302.             $post['payed']=2;
  303.             if($issupermod || $ismoderator || $isadmin || $isauthor)
  304.                $sellmessage[$post_sellcount]=$sm3;
  305.             else $sellmessage[$post_sellcount]=$sm4;
  306.         }elseif($issellfree){
  307.                 $post['paymoney'] = $post['needmoney'];
  308.                 $post['payed'] = 2;
  309.                 $sellmessage[$post_sellcount] = $sm5;
  310.         
  311.         }else {
  312.             $query = $db->query("SELECT COUNT(*) FROM $hacktable_postpay WHERE pid='$post[pid]' AND  sellcount='$post_sellcount' and money='$price' and username='$discuz_user'");
  313.             if($db->result($query, 0)) {
  314.                 $post['paymoney']=$post['paymoney']+$price;
  315.                 $post['payed']=2;
  316.                 $sellmessage[$post_sellcount]=$sm2;
  317.             }else{
  318.                 $post['payed']=1;
  319.                 $message='';
  320.                 $sellmessage[$post_sellcount]=$sm1;
  321.             }   
  322.         }
  323.     }else{
  324.         $post['payed']=1;
  325.         $message='';
  326.         $sellmessage[$post_sellcount]=$sm1;
  327.     }
  328.     return "|\tDISCUZ_SELL_$post_sellcount\t| ".$message;
  329. }
  330. //贴子买卖funciton ========end

  331. ?>
复制代码
回复

使用道具 举报

guigeng 发表于 2005-10-22 11:03:00 | 显示全部楼层
要是有问题,麻烦你帮我改一下~
谢谢你了~
回复

使用道具 举报

 楼主| lu5266 发表于 2005-10-22 11:28:21 | 显示全部楼层
原帖由 guigeng 于 2005-10-22 11:03 发表
要是有问题,麻烦你帮我改一下~
谢谢你了~


没问题的说


可以的啊

已经正确了
回复

使用道具 举报

guigeng 发表于 2005-10-22 12:12:00 | 显示全部楼层
谢谢啊
回复

使用道具 举报

 楼主| lu5266 发表于 2005-10-22 12:15:39 | 显示全部楼层
原帖由 guigeng 于 2005-10-22 12:12 发表
谢谢啊

回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-22 04:20 , Processed in 0.098843 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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