我的源代码给你看下~
- <?php
- /*
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: [DISCUZ!] Crossday Discuz! Board ::
- :: (c) 2001-2005 Comsenz Technology Ltd (www.discuz.com) ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: Author: Crossday (tech@discuz.com) Cnteacher (cnteacher@discuz.com) ::
- :: Version: 2.5F 2004/10/01 05:15 ::
- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- */
- //fix: BY pk0909
- /*
- 1 多出来的空格
- 2 bbcode 解析问题
- 3 img code 对特殊符号的js未转义
- */
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
- $searcharray=$replacearray= array();
- $post_codecount = $post_phpcodecount = -1;
- $codecount = 0 ;
- function censor($message) {
- global $_DCACHE;
- require_once(DISCUZ_ROOT.'/forumdata/cache/cache_censor.php');
- return empty($_DCACHE['censor']) ? $message : @preg_replace($_DCACHE['censor']['find'], $_DCACHE['censor']['replace'], $message);
- }
- function credithide($creditsrequire, $message) {
- if($GLOBALS['credit'] < $creditsrequire && !$GLOBALS['ismoderator']) {
- return "<b>**** Hidden to Credits Lower Than $creditsrequire ****</b>";
- } else {
- return '<b>Below Message for Credits Higher Than '.$creditsrequire.'</b><br>'.
- '==============================<br><br>'.
- str_replace('\"', '"', $message).'<br><br>'.
- '==============================';
- }
- }
- function codedisp($code) {
- global $thisbg, $codecount, $post_codecount, $codehtml;
- $post_codecount++;
- $code = htmlspecialchars(str_replace('\"', '"', preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1", $code)));
- $codehtml[$post_codecount] = "<blockquote class="code"><b class="smalltxt">CODE:</b> <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>";
- $codecount++;
- return "[\tDISCUZ_CODE_$post_codecount\t]";
- }
- function parseurl(&$message) {
- return preg_match("/\[code\].+?\[\/code\]/is", $message) ? $message :
- substr(preg_replace( array(
- "/(?<=[^\]a-z0-9-="'\\/])((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/|www\.)([a-z0-9\/\-_+=.~!%@?#%&;:$\\()|]+)/i",
- "/(?<=[^\]a-z0-9\/\-_.~?=:.])([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4}))/i"
- ), array(
- "[url]\\1\\3[/url]",
- "[email]\\0[/email]"
- ), ' '.$message), 1);
- }
- function postify($message, $smileyoff, $bbcodeoff, $allowsmilies = 1, $allowhtml = 0, $allowbbcode = 1, $allowimgcode = 1) {
- // 帖子买卖-start
- 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;
- $post_sellcount=0;
- $post_codecount = -1;
- $post_phpcodecount = -1;
- $message = preg_replace("/\[sell=(\d+)\]\s*(.+?)\s*\[\/sell\]/ies", "postsell(\\1,'\\2')", $message);
- // 帖子买卖-end
- if(!$bbcodeoff && $allowbbcode) {
- $message = preg_replace("/\s*\[code\](.+?)\[\/code\]\s*/ies", "codedisp('\\1')", $message);
- $message = preg_replace("/\s*\[php\](.+?)\[\/php\]\s*/ies", "phpcodedisp('\\1')", $message);
- }
- if(!$allowhtml) {
- $message = dhtmlspecialchars($message);
- }
- if(!$smileyoff && $allowsmilies) {
- if(is_array($GLOBALS['_DCACHE']['smilies'])) {
- foreach($GLOBALS['_DCACHE']['smilies'] as $smiliey) {
- $message = str_replace($smiliey['code'], "<img src="".SMDIR."/$smiliey[url]" align="absmiddle" border="0">",$message);
- }
- }
- }
- if(!$bbcodeoff && $allowbbcode) {
- if(empty($searcharray['bbcode_regexp']) || empty($replacearray['bbcode_regexp']) || empty($searcharray['bbcode_str']) || empty($replacearray['bbcode_str'])) {
- $searcharray['bbcode_regexp'] = array(
- "/\s*\[quote\][\n\r]*(.+?)[\n\r]*\[\/quote\]\s*/is",
- "/(\[box=(#[0-9A-F]{6}|[a-z]+)\])[\n\r]*(.+?)[\n\r]*(\[\/box\])/is",
- "/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/){1}([^\["']+?)\s*\[\/url\]/ie",
- "/\[url=www.([^\["']+?)\](.+?)\[\/url\]/is",
- "/\[url=(https?|ftp|gopher|news|telnet|rtsp|mms){1}:\/\/([^\["']+?)\](.+?)\[\/url\]/is",
- "/\[email\]\s*([A-Za-z0-9\-_.]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\s*\[\/email\]/i",
- "/\[email=([A-Za-z0-9\-_.]+)@([A-Za-z0-9\-_]+[.][A-Za-z0-9\-_.]+)\](.+?)\[\/email\]/is",
- "/\[color=([#0-9a-zA-Z]{3,10})\]/i",
- "/\[size=([\-0-9]{1,2})\]/i",
- "/\[font=([^\[]+?)\]/i",
- "/\[align=(left|right|center)\]/i",
- "/\[center\]/i"
- );
- $replacearray['bbcode_regexp'] = array(
- "<br><br><center><table border="0" width="90%" cellspacing="0" cellpadding="0"><tr><td> 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>",
- "<blockquote style="background-color: \\2 ;"><span class="bold">$title</span>\\3</blockquote>",
- "cuturl('\\1\\2')",
- "<a href="http://www.\\1" target="_blank">\\2</a>",
- "<a href="\\1://\\2" target="_blank">\\3</a>",
- "<a href="mailto:\\1@\\2">\\1@\\2</a>",
- "<a href="mailto:\\1@\\2">\\3</a>",
- "<font color="\\1">",
- "<font size="\\1">",
- "<font face="\\1">",
- "<p align="\\1">",
- "<p align="center">"
- );
- if($GLOBALS['_DCACHE']['bbcodes']) {
- $searcharray['bbcode_regexp'] = array_merge($searcharray['bbcode_regexp'], $searcharray['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['searcharray']);
- $replacearray['bbcode_regexp'] = array_merge($replacearray['bbcode_regexp'], $replacearray['bbcode_regexp'], $GLOBALS['_DCACHE']['bbcodes']['replacearray']);
- unset($GLOBALS['_DCACHE']['bbcodes']);
- }
- $searcharray['bbcode_str'] = array(
- '[/color]', '[/size]', '[/font]', '[/align]', '[b]', '[/b]',
- '[i]', '[/i]', '[u]', '[/u]', '[list]', '[list=1]', '[list=a]',
- '[list=A]', '[*]', '[/list]','[/center]'
- );
- $replacearray['bbcode_str'] = array(
- '</font>', '</font>', '</font>', '</p>', '<b>', '</b>', '<i>',
- '</i>', '<u>', '</u>', '<ul>', '<ol type=1>', '<ol type=a>',
- '<ol type=A>', '<li>', '</ul></ol>','</p>'
- );
- }
- @$message = str_replace($searcharray['bbcode_str'], $replacearray['bbcode_str'],
- preg_replace($searcharray['bbcode_regexp'], $replacearray['bbcode_regexp'], $message));
- if(preg_match("/\[hide=?\d*\].+?\[\/hide\]/is", $message)) {
- if(stristr($message, '[hide]')) {
- $query = $db->query("SELECT pid FROM $table_posts WHERE tid='$tid' AND authorid='$discuz_uid' LIMIT 1");
- if(!$db->result($query, 0) && !$ismoderator){
-
- $hideresult[0]=$thread[hidetime]; $hideresult[1]=$thread[dateline];
- if($hideresult[0]){
- $leavetime=$hideresult[0]*60*60 -($mtime[1]-$hideresult[1]);
- $hideend=$hideresult[0]*60*60+$hideresult[1];
- $hideresult[1] = gmdate("$dateformat $timeformat", $hideresult[1] + $timeoffset * 3600);
- $hideend= gmdate("$dateformat $timeformat", $hideend + $timeoffset * 3600);
- $hidedate=floor($leavetime/60/60/24);
- $hidehour=floor($leavetime/60/60%24);
- $hideminute=ceil($leavetime/60%60);
- }
- else {$hideresult[0]=$hidedate=$hidehour=$hideminute=$hideend="无限"; $leavetime=1;
- $hideresult[1] = gmdate("$dateformat $timeformat", $hideresult[1] + $timeoffset * 3600);
- }
- }
-
- if( $ismoderator || $db->result($query, 0) || $leavetime<=0) {
- $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);
- } else {
- $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);
- }
- }
- $message = preg_replace("/\[hide=(\d+)\]\s*(.+?)\s*\[\/hide\]/ies", "credithide(\\1,'\\2')", $message);
- }
- }
- if(!$bbcodeoff && $allowimgcode) {
- if(empty($searcharray['imgcode']) || empty($replacearray['imgcode'])) {
- $searcharray['imgcode'] = array(
- "/\[swf\]\s*([^\[]+?)\s*\[\/swf\]/ies",
- "/\[img\]\s*([^\[]+?)\s*\[\/img\]/ies",
- "/\[img=(\d{1,3})[x|\,](\d{1,3})\]\s*([^\[]+?)\s*\[\/img\]/ies"
- );
- $replacearray['imgcode'] = array(
- "bbcodeurl('\\1', ' <img src="images/attachicons/flash.gif" align="absmiddle"> <a href="%s" target="_blank">Flash: %s</a> ')",
- "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);}">')",
- "bbcodeurl('\\3', '<img width="\\1" height="\\2" src="%s" border="0">')"
- );
- }
- $message = preg_replace($searcharray['imgcode'], $replacearray['imgcode'], $message);
- }
- // 帖子买卖--start
- for($si = 0; $si <= $post_sellcount; $si++) {
- $message = str_replace("|\tDISCUZ_SELL_$si\t|", $sellmessage[$si], $message);
- }
- unset ($sellmessage);
- //帖子买卖--end
- for($i = 0; $i <= $post_codecount; $i++) {
- $message = str_replace("[\tDISCUZ_CODE_$i\t]", $codehtml[$i], $message);
- }
- if($highlight) {
- foreach(explode('+', $highlight) as $ret) {
- if($ret) {
- $message = preg_replace("/(?<=[\s"\]>()]|^)(".preg_quote($ret, '/').")(([\.,;-?!()]+)?([\s"<\[]|$))/siU", "<u><b><font color="#FF0000">\\1</font></b></u>\\2", $message);
- }
- }
- }
- for($i = 0; $i <= $post_phpcodecount; $i++) {
- $message = str_replace("|\tDISCUZ_PHPCODE_$i\t|", $phpcodehtml[$i], $message);
- }
- $message = nl2br(str_replace(
- array("\t", ' ', ' '),
- array(' ', ' ', ' ')
- , $message)
- );
- return $message;
- }
- function cuturl($url) {
- $length = 65;
- $urllink = "<a href="".(substr(strtolower($url), 0, 4) == 'www.' ? "http://$url" : $url).'" target="_blank">';
- if(strlen($url) > $length) {
- $url = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));
- }
- $urllink .= $url.'</a>';
- return $urllink;
- }
- function bbcodeurl($url, $tags) {
- if(!preg_match("/<.+?>/s",$url)) {
- if(!in_array(strtolower(substr($url, 0, 6)), array('http:/', 'https:', 'ftp://', 'rtsp:/', 'mms://'))) {
- $url = 'http://'.$url;
- }
- return str_replace('submit', '', sprintf($tags, $url, $url));
- } else {
- return ' '.$url;
- }
- }
- function phpcodedisp($code) {
- global $thisbg, $codecount, $post_phpcodecount, $phpcodehtml,$post;
- $post_phpcodecount++;
- $phpcode = phphighlite(str_replace("\\"", """, $code));
- $phpcodeid ="pcode_$post[pid]_$post_phpcodecount";
- $phpcodehtml[$post_phpcodecount] = "<blockquote class="code"><b class="smalltxt">PHP:</b> <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>";
- $phpcodecount++;
- return "|\tDISCUZ_PHPCODE_$post_phpcodecount\t|";
- }
- function phphighlite($code) {
- if(!strpos($code,"<?\n") && !strpos($code,'<?') && substr($code,0,2)!='<?'){
- $code='<'.'?'.trim($code).' ?'.'>';
- $addedtags=1;
- }
- ob_start();
- $oldlevel=error_reporting(0);
- highlight_string($code);
- error_reporting($oldlevel);
- $buffer = ob_get_contents();
- ob_end_clean();
- if ($addedtags) {
- $openingpos = strpos($buffer,'<?');
- $closingpos = strrpos($buffer, '?');
- $buffer=substr($buffer, 0, $openingpos).substr($buffer, $openingpos+5, $closingpos-($openingpos+5)).substr($buffer, $closingpos+5);
- }
- $buffer = str_replace(""", """, $buffer);
- $buffer = str_replace("<br />", '', $buffer);
- return $buffer;
- }
- function clear_bbcode($code){
- $rep = array('[', ']', ':', '(', ')');
- for ($x = 0; $x < count($rep); $x++) {
- $code = str_replace($rep[$x], '&#'.ord($rep[$x]).';', $code);
- }
- return $code;
- }
- //贴子买卖funciton ========start
- function postsell($price, $message) {
- 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;
- //$message=stripslashes($message);
- $message = str_replace("\\"", """, preg_replace("/^[\n\r]*(.+?)[\n\r]*$/is", "\\1",
- $message));
- $post_sellcount++;
- $price=abs(intval($price));
- $post['needmoney']=$post['needmoney']+$price;
- $query = $db->query("SELECT COUNT(*) FROM $hacktable_postpay WHERE pid='$post[pid]' AND sellcount='$post_sellcount' ");
- $payusercount=$db->result($query, 0);
-
- $sellresult[0]=$thread[selltime]; $sellresult[1]=$thread[dateline];
- if($sellresult[0]){
- $leavetime=$sellresult[0]*60*60 -($mtime[1]-$sellresult[1]);
- $sellend=$sellresult[0]*60*60+$sellresult[1];
- $sellresult[1] = gmdate("$dateformat $timeformat", $sellresult[1] + $timeoffset * 3600);
- $sellend= gmdate("$dateformat $timeformat", $sellend + $timeoffset * 3600);
- $selldate=floor($leavetime/60/60/24);
- $sellhour=floor($leavetime/60/60%24);
- $sellminute=ceil($leavetime/60%60);
- $effdate=floor($sellresult[0]/24);
- $effhour=floor($sellresult[0]%24);
- }
- else {$effdate=$effhour=$selldate=$sellhour=$sellminute=$sellend="无限"; $leavetime=1;
- $sellresult[1] = gmdate("$dateformat $timeformat", $sellresult[1] + $timeoffset * 3600);
- }
-
-
- if ($discuz_user){
- if ($usermoney >= $price){
- $paymessage="你的现金是:$usermoney ,可以<a href="postpay.php?action=pay&tid=$tid&pid=$post[pid]&sellcount=$post_sellcount&money=$price&page=$page">[立即付费]</a>。";
- }else{
- $paymessage="你的现金是:$usermoney ,无法付费。去[<a href='plugins.php?p=bank'>银行</a>]取款或者卖些积分吧。";
- }
- }else{
- $paymessage= "非本站会员无权购买,请[<a href='logging.php?action=login'>登陆</a>],或者[<a href='register.php'>注册</a>]";
- }
-
- if($leavetime>0) $paymessage.="<hr><b><font color='blue'>出售时限: <font color=red>$effdate</font> 天 <font color=red>$effhour</font> 小时 剩下: <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>";
- $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'> 付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'> 编号:</td><td width='35%'><span class='small'> <input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'> 价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'> <input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'> 名单:</span></td><td><span class='small'> 请付费后再查看!</span></td><td><span class='small'> 人数:</span></td><td><span class='smalltxt'> <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>";
- $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'> 付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'> 编号:</td><td width='35%'><span class='small'> <input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'> 价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'> <input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'> 名单:</span></td><td><span class='small'> <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'> 人数:</span></td><td><span class='smalltxt'> <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>";
- $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'> 付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'> 编号:</td><td width='35%'><span class='small'> <input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'> 价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'> <input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'> 名单:</span></td><td><span class='small'> <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'> 人数:</span></td><td><span class='smalltxt'> <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>";
- $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'> 付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'> 编号:</td><td width='35%'><span class='small'> <input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'> 价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'> <input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'> 名单:</span></td><td><span class='small'> <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'> 人数:</span></td><td><span class='smalltxt'> <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>";
- $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'> 付款证明</td></tr><tr bgColor='#ffffff'><td width='15%'> 编号:</td><td width='35%'><span class='small'> <input type='text' name='p101' value='$tid-$post[pid]-$post[postcount]'></span></td><td width='15%'> 价格:</td><td width='35%'><img src='images/common/money0.gif'><span class='small'> <input type=text name=p102 value='$price' size=6>金币</span></td></tr><tr bgColor='#ffffff'><td><span class='small'> 名单:</span></td><td><span class='small'> <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'> 人数:</span></td><td><span class='smalltxt'> <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>";
-
- if ($discuz_user){
- $query = $db->query("SELECT COUNT(*) FROM $table_posts WHERE pid='$post[pid]' AND author='$discuz_user'");
- $isauthor = $db->result($query, 0);
- if($issupermod || $ismoderator || $isadmin || $isauthor || $leavetime<=0 ){
- $post['paymoney']=$post['needmoney'];
- $post['payed']=2;
- if($issupermod || $ismoderator || $isadmin || $isauthor)
- $sellmessage[$post_sellcount]=$sm3;
- else $sellmessage[$post_sellcount]=$sm4;
- }elseif($issellfree){
- $post['paymoney'] = $post['needmoney'];
- $post['payed'] = 2;
- $sellmessage[$post_sellcount] = $sm5;
-
- }else {
- $query = $db->query("SELECT COUNT(*) FROM $hacktable_postpay WHERE pid='$post[pid]' AND sellcount='$post_sellcount' and money='$price' and username='$discuz_user'");
- if($db->result($query, 0)) {
- $post['paymoney']=$post['paymoney']+$price;
- $post['payed']=2;
- $sellmessage[$post_sellcount]=$sm2;
- }else{
- $post['payed']=1;
- $message='';
- $sellmessage[$post_sellcount]=$sm1;
- }
- }
- }else{
- $post['payed']=1;
- $message='';
- $sellmessage[$post_sellcount]=$sm1;
- }
- return "|\tDISCUZ_SELL_$post_sellcount\t| ".$message;
- }
- //贴子买卖funciton ========end
- ?>
复制代码 |