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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原创] · 插件式鲜花鸡蛋送给作者 1.0 by oytktk

[复制链接]
研究者joe 发表于 2005-11-2 19:54:26 | 显示全部楼层

嚴重問題~~樓主出錯~


給雞蛋~~但顯示的是鮮花數~~  大家沒留到嗎?

        $thread['flower']=$thread['flower']>0?$thread['flower']="<img border=0 title='鲜花数:".$thread['flower']."' src='images/common/flower.gif' align=absmiddle>":'';
        $thread['egg']=$thread['egg']>0?$thread['egg']="<img border=0 title='鸡蛋数:".$thread['egg']."' src='images/common/eggs.gif' align=absmiddle>":'';


這裡可能有誤~~樓主修理好它吧~~~
回复

使用道具 举报

 楼主| oytktk 发表于 2005-11-2 20:16:32 | 显示全部楼层
这个也是严重问题?

你在模板文件里找到第二个鲜花数改为鸡蛋数就OK了~
回复

使用道具 举报

Dante 发表于 2005-11-2 20:38:50 | 显示全部楼层
顶你呀,楼主!
回复

使用道具 举报

jiayuan1 发表于 2005-11-3 16:45:08 | 显示全部楼层
楼猪帮我看看啊!
回复

使用道具 举报

M55 发表于 2005-11-3 17:33:29 | 显示全部楼层
原帖由 研究者joe 于 2005-11-2 19:54 发表

給雞蛋~~但顯示的是鮮花數~~  大家沒留到嗎?

        $thread['flower']=$thread['flower']>0?$thread['flower']="< ...


哈哈!我真的准备开始崇拜你了

老兄啊,你是不认真看帖啊,看帖安装HACK,你不光是应该看第一页,其实有很多重要的信息是散布在后面的跟帖里的。

教你一招:

不管安装什么 HACK ,应该把发这个 HACK 的帖全部从头到尾全部看完再准备安装,这样就可以在很大的程度上减少你安装这个 HACK 时的麻烦……

其实你这个问题在后面的跟帖里就有提过(好象就是我提的哦)

[ 本帖最后由 M55 于 2005-11-3 17:35 编辑 ]
回复

使用道具 举报

kian87 发表于 2005-11-17 14:46:04 | 显示全部楼层
有个小小的问题~

被送花或扔蛋的贴子在这符号#2 旁边是有个“花的图像”

但我安装后,在这“花的图像”旁多了个“?”出来
请问是那里出错了?
回复

使用道具 举报

lennonyan 发表于 2005-11-26 19:51:55 | 显示全部楼层
有辦法將$felist['tid']改成 帖子名稱嗎?
回复

使用道具 举报

恒乐 发表于 2005-12-28 19:08:24 | 显示全部楼层
大哥,不知道为什么,我的论坛鲜花后会显示这个,鲜花不了哦!

Discuz! info: MySQL Query Error

User: 恒乐
Time: 2005-12-28 7:06pm
Script: /plugins.php

SQL: UPDATE cdb_posts SET flower=flower+1 WHERE pid='10624'
Error: Unknown column 'flower' in 'field list'
程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖

Similar error report has beed dispatched to administrator before.
回复

使用道具 举报

恒乐 发表于 2005-12-28 19:12:15 | 显示全部楼层
这个文件不知道有没错:flegg

<?
$fe = getconfig('flegg');
$fes = $_DCACHE['plugins'][$p];
$navtitle = $fes['plug_title'];

if(!$discuz_user)showmessage("请先登录!","javascript:history.go(-1)");

$query = $db->query("SELECT username, money FROM $table_members WHERE username='$discuz_user'");
$fuser=$db->fetch_array($query);

if($action && !$pid){
        if(!$username)showmessage("参数不足, 无法进行!","javascript:history.go(-1)");
        $query = $db->query("SELECT username, uid FROM $table_members WHERE username='$username'");
        $tuser=$db->fetch_array($query);
        $touser=$tuser['username'];
        $touid=$tuser['uid'];
}else{
        $query = $db->query("SELECT author, authorid, tid FROM $table_posts WHERE pid='$pid'");
        $fpost=$db->fetch_array($query);
        $touser=$fpost['author'];
        $touid=$fpost['authorid'];
        $tid=$fpost['tid'];
}

$muchflower='';
for($i=2;$i<=$fe['much'];$i++){
        $muchflower.='<option value='.$i.'>&nbsp;&nbsp;'.$i.'&nbsp;&nbsp;</option>';
}

$mucheggs='';
for($i=2;$i<=$fe['much'];$i++){
        $mucheggs.='<option value='.$i.'>&nbsp;&nbsp;'.$i.'&nbsp;&nbsp;</option>';
}

if($action=='flower' && ($flowers*$fe['flower']) > $fuser['money'])showmessage("对不起, 您的现金已经买不起鲜花了!","javascript:history.go(-1)");
if($action=='eggs' && ($eggss*$fe['eggs']) > $fuser['money'])showmessage("对不起, 您的现金已经买不起鸡蛋了!","javascript:history.go(-1)");

$moneyadd=$fe['moneyadd']*$flowers;
$moneydec=$fe['moneydec']*$eggss;
$credadd=$fe['credadd']*$flowers;
$creddec=$fe['creddec']*$eggss;
$flowers=$flowers?$flowers:0;
$eggss=$eggss?$eggss:0;

$flowerss=$flowers*$fe['flower'];
$eggsss=$eggss*$fe['eggs'];


if($flowers>$fe['much'] || $eggss>$fe['much'])showmessage("超过指定的数量, 请不要耍花招!","javascript:history.go(-1)");

$msg_1="

恭喜您, 社区会员 ".$discuz_user." 送了您 ".$flowers." 束鲜花!

贴子地址: 单击打开贴子连接

由此对您的影响是:

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&
&&   论坛积分: + ".$credadd."
&
&&   论坛币: + ".$moneyadd."
&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

";


$msg_2="

恭喜您, 社区会员 ".$discuz_user." 送了你 ".$flowers." 束鲜花!

由此对您的影响是:

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&
&&   论坛积分: + ".$credadd."
&
&&   论坛币: + ".$moneyadd."
&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

";



$msg_3="

请注意, 社区会员 ".$discuz_user." 向你扔了 ".$eggss." 个鸡蛋!

贴子地址: 单击打开贴子连接

由此对您的影响是:

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&
&&   论坛积分: - ".$creddec."
&
&&   论坛币: - ".$moneydec."
&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

";


$msg_4="

请注意, 社区会员 ".$discuz_user." 向你扔了 ".$eggss." 个鸡蛋!

由此对您的影响是:

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&
&&   论坛积分: - ".$creddec."
&
&&   论坛币: - ".$moneydec."
&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

";

$aswhat=dhtmlspecialchars($aswhat);

if($start=='yes' && $action=='flower'){
        $query = $db->query("SELECT * FROM $table_felog WHERE asfe='flower' and fromuser='$discuz_user' and touser='$touser' and tid='$tid'");
        if($asone=$db->fetch_array($query))showmessage("对不起, 请不要重复送鲜花!","javascript:history.go(-1)");
        $msg=$msg_2;
        if($discuz_user==$touser)showmessage("自己送自己鲜花?!~~没必要这样吧?!","javascript:history.go(-1)");
        if($tid){
        $msg=$msg_1;
        $db->query("UPDATE $table_posts SET flower=flower+$flowers WHERE pid='$pid'");
        $db->query("UPDATE $table_threads SET flower=flower+$flowers WHERE tid='$tid'");}
        $db->query("UPDATE $table_members SET flowers=flowers+$flowers,money=money+$moneyadd,credit=credit+$credadd WHERE username='$touser'");
        $db->query("UPDATE $table_members SET money=money-$flowerss WHERE username='$discuz_user'");              
        $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message) VALUES('$discuz_user', '$discuz_uid', '$touid', 'inbox', '1', '恭喜, 有人送鲜花给你啦!', '$timestamp', '$msg')");
        $db->query("INSERT INTO $table_felog (fromuser, touser, asfe, score, tid, aswhat) VALUES ('$discuz_user', '$touser', 'flower', '$flowers', '$tid', '$aswhat')");
        $db->query("UPDATE LOW_PRIORITY $table_members SET newpm='1' WHERE uid='$touid'", 'UNBUFFERED');
        showmessage("您已经成功的向 <b>".$touser."</b> 送了 <font color=red>".$flowers."</font> 束鲜花!","plugins.php?p=flegg");
}elseif($start=='yes' && $action=='eggs'){
        $query = $db->query("SELECT * FROM $table_felog WHERE asfe='eggs' and fromuser='$discuz_user' and touser='$touser' and tid='$tid'");
        if($asone=$db->fetch_array($query))showmessage("对不起, 请不要重复扔鸡蛋!","javascript:history.go(-1)");
        if($discuz_user==$touser)showmessage("自己扔自己鸡蛋?!~~您受了什么刺激了?!","javascript:history.go(-1)");
        $msg=$msg_4;
        if($tid){
        $msg=$msg_3;
        $db->query("UPDATE $table_posts SET egg=egg+$eggss WHERE pid='$pid'");
        $db->query("UPDATE $table_threads SET egg=egg+$eggss WHERE tid='$tid'");}
        $db->query("UPDATE $table_members SET eggs=eggs+$eggss,money=money-$moneydec,credit=credit-$creddec WHERE username='$touser'");
        $db->query("UPDATE $table_members SET money=money-$eggsss WHERE username='$discuz_user'");              
        $db->query("INSERT INTO $table_pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message) VALUES('$discuz_user', '$discuz_uid', '$touid', 'inbox', '1', '请注意, 有人向你扔鸡蛋啦!', '$timestamp', '$msg')");
        $db->query("INSERT INTO $table_felog (fromuser, touser, asfe, score, tid, aswhat) VALUES ('$discuz_user', '$touser', 'eggs', '$eggss', '$tid', '$aswhat')");
        $db->query("UPDATE LOW_PRIORITY $table_members SET newpm='1' WHERE uid='$touid'", 'UNBUFFERED');
        showmessage("您已经成功的向 <b>".$touser."</b> 扔了 <font color=red>".$eggss."</font> 个鸡蛋!","plugins.php?p=flegg");
}else{
//记录...排行...

$query = $db->query("SELECT uid, username, flowers FROM $table_members WHERE flowers>0 ORDER BY flowers DESC LIMIT 10");
$ii=0;
while($flist=$db->fetch_array($query)){
        for($i=0;$i<$flist['flowers'];$i++){
                if($i<10)$flpk[$flist['uid']].="<img border=0 src='images/common/flower.gif'>";
        }
        if($i>=10)$flpk[$flist['uid']].="......共 <font color=red>".$flist['flowers']."</font> 束鲜花!";
        $ii++;
        $floop[]=$flist;
}
if($ii==0)$emptyf="目前没有人得到鲜花!";


$query = $db->query("SELECT uid, username, eggs FROM $table_members WHERE eggs>0 ORDER BY eggs DESC LIMIT 10");
$ii=0;
while($elist=$db->fetch_array($query)){
        for($i=0;$i<$elist['eggs'];$i++){
        if($i<10)$egpk[$elist['uid']].="<img border=0 src='images/common/eggs.gif'>";
        }
        if($i>=10)$egpk[$elist['uid']].="......共 <font color=red>".$elist['eggs']."</font> 个鸡蛋!";
        $ii++;
        $eloop[]=$elist;
}
if($ii==0)$emptye="目前没有人得到鸡蛋!";

if($fe['felist']){


        //页数处理
                $query = $db->query("SELECT COUNT(*) FROM $table_felog");
                $count = $db->result($query, 0);
                $pagenum = 30;
                $page = intval($page) ? intval($page) : 1;
                $start = ($page - 1) * $pagenum;
                $multipage = multi($count, $pagenum, $page, "plugins.php?p=flegg");
        //-----------

$liststart=$start+1;
$listend=$liststart+$pagenum-1;



$query = $db->query("SELECT fromuser, id, touser, asfe, score, tid, aswhat FROM $table_felog ORDER BY id DESC LIMIT $start , $pagenum");
$ii=0;
while($felist=$db->fetch_array($query)){
$fepk[$felist['id']]='';
for($i=0;$i<$felist['score'];$i++){
        $fepk[$felist['id']].="<img border=0 src='images/common/".$felist['asfe'].".gif'>";
        }
$ii++;
$felist['tid']=$felist['tid']?"<a href='viewthread.php?tid=".$felist['tid']."' title='点击打开送礼的贴子'>贴子位置</a>":'';
$felist['what']=cutstr($felist['aswhat'],90);
$feloop[]=$felist;
}
}

$fekf=$ii!=0?"以下是送鲜花和扔鸡蛋的记录":"目前还没有任何鲜花和鸡蛋的记录!";

}
include template('flower');
?>

[ 本帖最后由 恒乐 于 2005-12-28 19:22 编辑 ]
回复

使用道具 举报

恒乐 发表于 2005-12-28 19:34:26 | 显示全部楼层
还有viewthear.php

<?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 转入最新帖
*/

define('CURRSCRIPT',  'viewthread');

require_once './include/common.php';
require_once DISCUZ_ROOT.'./include/forum.php';
require_once DISCUZ_ROOT.'./include/discuzcode.php';

$discuz_action = 3;

if ($tid && $forum){
        $thread = $forum;
}elseif($fid && defined('ViewLastPost')) {
        $followforum = '';
        foreach($_DCACHE['forums'] as $ffid => $fforum) {
                if($fforum['fup'] == $fid && $fforum['type'] == 'sub') {
                        $followforum .= ','.$ffid;
                }
        }
        $followforumadd = $followforum ? "f.fid in ($fid{$followforum})" : "f.fid=$fid";
        $query = $db->query("SELECT f.* $accessadd1 , t.* FROM $table_forums f, $table_threads t $accessadd2 WHERE $followforumadd AND f.fid=t.fid ORDER BY t.lastpost DESC LIMIT 1");
        if(!$forum = $db->fetch_array($query)) {
                        showmessage('thread_nonexistence');
        }
        $thread = $forum;
        $fid = $forum['fid'];
        if(@!include DISCUZ_ROOT.'./forumdata/cache/style_'.intval(!empty($forum['styleid']) ? $forum['styleid'] : $styleid).'.php') {
                        $styleid = $_DCACHE['settings']['styleid'];
                        $cachelost .= (@include DISCUZ_ROOT.'./forumdata/cache/style_'.$styleid.'.php') ? '' : ' style_'.$styleid;
        }
} else {
        showmessage('thread_nonexistence');
}

if (defined('ViewLastPost')) {
                $page = @ceil(($thread['replies'] + 1) / $ppp);
}

$tid = $thread['tid'];
$codecount = 0;
$oldtopics = $_COOKIE['oldtopics'] ? $_COOKIE['oldtopics'] : "\t";
if(!strstr($oldtopics, "\t$tid\t")) {
        $oldtopics .= "$tid\t";
        setcookie('oldtopics', $oldtopics, $timestamp + 900, $cookiepath, $cookiedomain);
}

if($forum['type'] == 'forum') {
        $navigation .= "&raquo; <a href=\"forumdisplay.php?fid=$fid&page=$fpage\"> $forum[name]</a> &raquo; $thread[subject]";
        $navtitle .= ' - '.strip_tags($forum['name']).' - '.$thread['subject'];
} else {
        $query = $db->query("SELECT fid, name, moderator FROM $table_forums WHERE fid='$forum[fup]'");
        $fup = $db->fetch_array($query);
        $navigation .= "&raquo; <a href=\"forumdisplay.php?fid=$fup[fid]\">$fup[name]</a> &raquo; <a href=\"forumdisplay.php?fid=$fid&page=$fpage\"> $forum[name]</a> &raquo; $thread[subject]";
        $navtitle .= ' - '.strip_tags($fup['name']).' - '.strip_tags($forum['name']).' - '.$thread['subject'];
}

$ismoderator = modcheck($discuz_user);

if(!$forum['allowview']) {
        if(!$forum['viewperm'] && !$allowview) {
                showmessage('group_nopermission', NULL, 'HALTED');
        } elseif($forum['viewperm'] && !strstr($forum['viewperm'], "\t$groupid\t")) {
                showmessage('forum_nopermission', NULL, 'HALTED');
        }
}

if($thread['creditsrequire'] && $thread['creditsrequire'] > $credit && !$ismoderator && ($thread['authorid'] !=$discuz_uid)) {
        showmessage('thread_nopermission', NULL, 'HALTED');
}

if($forum['password'] && $forum['password'] != $_COOKIE["fidpw$fid"]) {
        header("Location: {$boardurl}forumdisplay.php?fid=$fid&sid=$sid");
        exit();
}

if(!$action && $tid) {

        if($discuz_uid && $newpm) {
                require DISCUZ_ROOT.'./include/pmprompt.php';
        }

        $highlightstatus = str_replace('+', '', $highlight) ? 1 : 0;
        $karmaoptions = '';
        if($allowkarma && $maxkarmarate) {
                $offset = ceil($maxkarmarate / 6);
                for($vote = - $maxkarmarate + $offset; $vote <= $maxkarmarate; $vote += $offset) {
                        $votenum = $vote > 0 ? '+'.$vote : $vote;
                        $karmaoptions .= $vote ? "<option value=\"$vote\">$votenum</option>\n" : NULL;
                }
        }
        unset($vote, $votenum, $offset);
       
        $pageMax = ceil(($thread['replies']+1) / $ppp);
        $page = intval($page) ? intval($page) : 1;
        $page = $page > $pageMax ? $pageMax : $page;
        $start_limit = ($page - 1) * $ppp;



        $fpage = intval($fpage);
        $multipage = multi($thread['replies'] + 1, $ppp, $page, "viewthread.php?tid=$tid&fpage=$fpage&highlight=".rawurlencode($highlight));

        $thread[subject] = cutstr($thread[subject],77);
        $polloptions = array();
        if($thread['poll']) {
                $query = $db->query("SELECT pollopts FROM $table_polls WHERE tid='$tid'");
                $pollopts = unserialize($db->result($query, 0));
                if (is_array($pollopts) && count($pollopts)){
                        foreach($pollopts['options'] as $option) {
                                $polloptions[] = array(       
                                        'option'        => dhtmlspecialchars(stripslashes($option[0])),
                                        'votes'                => $option[1],
                                        'width'                => @round($option[1] * 300 / $pollopts['max']) + 2,
                                        'percent'        => @sprintf ("%01.2f", $option[1] * 100 / $pollopts['total'])
                                );
                        }
                        $allowvote = $allowvote && $discuz_uid && (empty($thread['closed']) || $alloweditpoll) && !in_array($discuz_user, $pollopts['voters']);
                        $optiontype = $pollopts['multiple'] ? 'checkbox' : 'radio';
                }else{
                        unset ($pollopts);
                }
        }
        //-----------------------------形象
        require_once './forumdata/cache/cache_plugins.php';
        $imagesset = $_DCACHE['plugins_settings'][virtualimage];
        if($imagesset[openalpha]){$alpha = "FILTER: alpha(opacity=\"+WearArray+\")";}
        //-----------------------------
        $query = $db->query("SELECT * FROM $table_medal where medalid <> '0';");

        while($medalist = $db->fetch_array($query)) {
                $medalshow[$medalist[medalid]]="<img src=\"$medalist[medalpic]\" title=\"$medalist[medalname]\n$medalist[medalexpl]\">";
        }

        $altbg1 = ALTBG1;
        $altbg2 = ALTBG2;
        $postlist = $attachelist = array();
        $newpostanchor = $topiccount = $have_attachment = 0;
        $postcount = $start_limit;
        $post_phpcodecount = -1;
        // ----------------------------------------------------------------
        //  User's Digest Counting 1.51 By Polo!
        //  Added: m.userdigests,
        // ----------------------------------------------------------------
        //增加m.adminid字段显示
        $post_user_info_sql = 'm.uid, m.username, m.gender, m.groupid, m.adminid, m.regdate, m.lastactivity, m.postnum, m.medals, m.credit, m.userdigests, m.email, m.site, m.icq, m.oicq, m.yahoo, m.msn, m.location, m.avatar, m.avatarwidth, m.avatarheight, m.signature, m.customstatus, m.flowers, m.eggs, m.showemail, m.bank, m.money, m.bankmimi, m.bankstatus, m.hw, m.useimages, m.adminid';
    // ----------------------------------------------------------------
        $query = $db->query("
                                        SELECT p.*, $post_user_info_sql
                                        FROM $table_posts p
                                        LEFT JOIN $table_members m ON m.uid=p.authorid
                                        WHERE p.tid='$tid' ORDER BY dateline LIMIT $start_limit, $ppp");

        while($post = $db->fetch_array($query)) {
        if($post['medals']){
                $medalid = strtok($post['medals'],",");
                $medalout='';
                while($medalid){
                        $medalout.= $medalshow[$medalid];
                        $medalid = strtok(",");
                }
                $post['medals'] = $medalout;
        }

                if(!$newpostanchor && $post['dateline'] > $lastvisit) {
                        $post['newpostanchor'] = '<a name="newpost"></a>';
                        $newpostanchor = 1;
                } else {
                        $post['newpostanchor'] = '';
                }
                $topiccount ++;
                $post['postcount'] = $postcount+1;
                $post['thisbg'] = ${'altbg'.($postcount++ % 2 + 1)};
                $post['dateline'] = gmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
if (!$post[hw]) {
        $post[hw]='未婚';
}

                if($post['username']) {
                       
                        if($userstatusby > 0 ){
                                if($userstatusby == 2 && $post['adminid'] == 0) {
                                        foreach($_DCACHE['ranks'] as $rank) {
                                                if($post['postnum'] > $rank['postshigher']) {
                                                        $post['authortitle'] = $rank['ranktitle'];
                                                        $post['stars'] = $rank['stars'];
                                                        break;
                                                }
                                        }
                                }else{
                                        $post['authortitle'] = $_DCACHE['usergroups'][$post['groupid']]['grouptitle'];
                                        $post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars'];
                                }
                        }

                        $post['regdate'] = gmdate($dateformat, $post['regdate'] + $timeoffset * 3600);
        // ----------------------------------------------------------------
        //  User's Digest Counting 1.51 By Polo!
        //  Added: Next Line
        // ----------------------------------------------------------------

        $post['userdigests'] = $post['userdigests'] ? "<a href=\"digest.php?authorid=".$post['authorid']."\">".$post['userdigests']."</a>" : NULL;

        // ----------------------------------------------------------------

                        if($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
                                $post['avatar'] = '<img src="'.$_DCACHE['usergroups'][$post['groupid']]['groupavatar'].'" border="0">';
                        } elseif($_DCACHE['usergroups'][$post['groupid']]['allowavatar'] && $post['avatar']) {
                                $post['avatar'] = '<img src="'.$post['avatar'].'" width="'.$post['avatarwidth'].'" height="'.$post['avatarheight'].'" border="0">';
                        } else {
                                $post['avatar'] = '';
                        }
                } else {
                        if(!$post['authorid']) {
                                $post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')).'.x';
                        }
                        $post['postnum'] = $post['credit'] = $post['regdate'] = 'N/A';
                }
//------------------------------------------------------------形象
                        if ($imagesset['orderuse']!='1' && ($post['useimages'] != 1 ||  $post[gender]==0)){
                              $post['avatar'] = $post['avatar'];
                        }else{
                            if ($post[gender]==1){
                                     $tempequip =  '0-0-0-0-0-0-0-0-init-init-0-init-0-init-init-0-0-0-init-0-0-0-0-0-0-0';  //
                                     $sex = "m";
                                     $upid = "init";
                            }else if ($post[gender]==2){
                                     $tempequip =  '0-0-0-0-0-0-0-0-initf-initf-0-initf-0-initf-initf-0-0-0-initf-0-0-0-0-0-0-0'; //女性
                                     $sex = "f";
                                     $upid = "initf";
                            }

                            $userwearip =  '400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-400-40 0-400-400';//商品

                            $cookiearray = split('-', $tempequip);
                            $weararray = split('-', $userwearip);

                            $imagescookie = $db->query("SELECT * FROM $tablepre"."images_user  where userid = '$post[uid]' and dafaultuse = '1' and (suitable = '$sex' or suitable = 't')");
                            while ($userimages = $db->fetch_array($imagescookie)){
                                     $tempi = $userimages[classid];
                                     $cookiearray[$tempi] = $userimages[picid];
                                     if($imagesset[beold]){
                                         $images_weardate = $userimages[endurance] - (time() -  $userimages[lastuse]);
                                         $images_weardate = ceil($images_weardate/8640);
                                         if ($images_weardate <= 0){
                                             $db->query("UPDATE $tablepre"."images_user SET  dafaultuse = '3' WHERE userid='$post[uid]' and picid = '$userimages[facepicid]' and classid=  '$userimages[classid]' and dafaultuse='1'");
                                             if($userimages[classid] ==  8||$userimages[classid]==9||$userimages[classid]==11||$userimages[classid] ==13||$userimages[classid]==14||$userimages[classid]==18){
                                                  $userupid = $upid;
                                             }else{
                                                  $userupid = "0";
                                             }
                                             $cookiearray[$tempi] = $userupid;
                                         }else{
                                             $weararray[$tempi] = $images_weardate;
                                         }
                                    }else{
                                         $weararray[$tempi] = 100;
                                    }
                            }
                            if ($post[gender]==0){
                                     $userimages = "";//形象
                            }else{$userimages = implode("-", $cookiearray);}
                            $userwear = implode("-", $weararray);
                            $post['avatar'] = "
                            <!-- 形象開始-->
                            <DIV id=Show{$post['pid']}
                                style=\"PADDING-RIGHT: 0px; PADDING-LEFT: 0px; LEFT: 0px;  PADDING-BOTTOM: 0px; WIDTH: 140px; PADDING-TOP: 0px; POSITION: relative; TOP: 0px; HEIGHT:  226px\"></DIV>
                            <SCRIPT language=JavaScript>
                            var currface = \"$userimages\";
                            if (currface ==\"\") {
                                currface = \"0\";
                            }
                            var currwear = \"$userwear\";
                            var showArray = currface.split('-');
                            var WearArray = currwear.split('-');
                            if (showArray[6] != '0'){
                                 showArray[8] = 0;
                                 showArray[9] = 0;
                            }
                            var s=\"\";
                            for (var i=0; i<26; i++){
                                if(showArray != '0'){
                                   if((showArray == 'init') || (showArray == 'initf')){
                                        s+=\"<IMG  src=images/virtualimage/\"+i+\"/\"+showArray+\".gif style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:\"+i+\";'>\";
                                   }else{
                                        s+=\"<IMG  src=images/virtualimage/\"+i+\"/\"+showArray+\".gif style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:\"+i+\";".$alpha." '>\";
                                   }
                                }
                            }
                            s+=\"<IMG src=images/virtualimage/blank.gif  style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:50'>\";
                            if (currface=='0'){
                                    s=\"<IMG src=images/virtualimage/noface.gif  style='padding:0;position:absolute;top:0;left:0;width:154;height:94;'>\";
                            }
                            Show{$post['pid']}.innerHTML=s;
                            </SCRIPT>
                            <!-- 形象結束-->
                            ";
                       }
                       //--------------------------------------------------------------

                $post['karma'] = '';
                if($post['rate'] && $post['ratetimes']) {
                        $rateimg = $post['rate'] > 0 ? 'agree.gif' : 'disagree.gif';
                        for($i = 0; $i < round(abs($post['rate']) / $post['ratetimes']); $i++) {
                                $post['karma'] .= '<img src="'.IMGDIR.'/'.$rateimg.'" align="right">';
                        }
                }

                $post['ljl_karma'] = '';
    if($post['rate'] && $post['ratetimes']) {
      $rateimg = $post['rate'] > 0 ? 'agree.gif' : 'disagree.gif';
      for($i = 0; $i < round(abs($post['rate']) / $post['ratetimes']); $i++) {
        $post['ljl_karma'] .= '&nbsp;<img src="'.IMGDIR.'/'.$rateimg.'">';
      }
    }
    if($post['rate']) {
      $post['rate'] >0 ? $ljl_sign = '+' : $ljl_sign = NULL;
      $post['ljl_karma'] = '<tr><td colspan="3">此贴被 <font color=red>'.$ljl_sign.$post['rate'].'</font> 点积分'.$post['ljl_karma'].'</td></tr>';
      $ljlquery = $db->query("SELECT k.*, m.username FROM $table_karmalog k
              LEFT JOIN $table_members m ON k.uid = m.uid
              WHERE pid='$post[pid]' ORDER BY dateline DESC");
      while($lp_karma = $db->fetch_array($ljlquery)) {
        $lp_karma['score'] >0 ? $ljl_sign = '+' : $ljl_sign = NULL;
        $post['ljl_karma'].='<tr><td>评分者:【<a href=viewpro.php?username='.AddSlashes($lp_karma['username']).'>'.AddSlashes($lp_karma['username']).'</a>】</td><td>分数:<font color=red>'.$ljl_sign.$lp_karma['score'].'</font></td><td>&nbsp;时间:'.gmdate("$dateformat $timeformat", $lp_karma['dateline'] + ($timeoffset * 3600)).'</td></tr>';
      }
      $post['ljl_karma'] = '<br><br><center><table border="0" cellspacing="0" cellpadding="1"
bgcolor="#698CC3"><tr><td><table border="0" cellspacing="0" cellpadding="4" bgcolor="#FFFFFF">'.$post['ljl_karma'].'</table></td></tr></table></center>';
    }
$post['subject'] = $post['subject'] ? $post['subject'] : NULL;
$post['flower'] = $post['flower']>0 ? "<img border=0 src='images/common/flower.gif' align=absmiddle>×".$post['flower'] : NULL;
        $post['egg'] = $post['egg']>0 ? "<img border=0 src='images/common/eggs.gif' align=absmiddle>×".$post['egg'] : NULL;

                       

                $post['message'] = postify($post['message'], $post['smileyoff'], $post['bbcodeoff'], $forum['allowsmilies'], $forum['allowhtml'], $forum['allowbbcode'], $forum['allowimgcode']);
                if($post['modmessage'] != '') {
                    $post['mod_message'] = postmod($post['modmessage']);
                }
                $post['signature'] = $post['usesig'] && $post['signature'] ? postify($post['signature'], 1, 0, 0, 0, $_DCACHE['usergroups'][$post['groupid']]['allowsigbbcode'], $_DCACHE['usergroups'][$post['groupid']]['allowsigimgcode']) : NULL;

                if(!$have_attachment && $post['aid']) $have_attachment = 1 ;

                $postlist[] = $post;
        }
       
        if (empty($postlist)) {
                showmessage('undefined_action', NULL, 'HALTED');
        }
   checkpthreadpay();
        if ($have_attachment) {
                require_once DISCUZ_ROOT.'./include/attachment.php';
                $query = $db->query("select * from $table_attachments where tid='$tid' ORDER BY aid");
                while($attach = $db->fetch_array($query)) {
                        $attach[checkid] = substr(md5($attach['filesize']),0,5);
                        $extension = strtolower(fileext($attach['filename']));
                        $attach['attachicon'] = attachtype($extension."\t".$attach['filetype']);
                        if($attachimgpost && in_array($extension, array('jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp'))) {
                                $attach['attachimg'] = 1;
                        } else {
                                $attach['attachimg'] = 0;
                        }
                        $attach['attachsize'] = sizecount($attach['filesize']);
                        $attach['dateline'] = $attach['dateline']?gmdate("$dateformat $timeformat", $attach['dateline'] + $timeoffset * 3600): '';
                        $attachelist["$attach[pid]"][] = $attach;
                }
        }

        $typearray = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
if($thread['badge']) {
        $string = sprintf('%02d', $thread['badge']);
        $stylestr = sprintf('%03b', $string[0]);
        //$thread['badge'] .= $string[1];        
    } else {
        $thread['badge'] = '';
    }
$forumselect = $forumjump ? forumselect() : NULL;

        $usesigcheck = $signature ? 'checked' : NULL;
        $allowpost = (!$forum['postperm'] && $allowpost) || ($forum['postperm'] && strstr($forum['postperm'], "\t$groupid\t")) || $forum['allowpost'];
        $allowpostreply = (!$thread['closed'] || $ismoderator) && (!$delayreply || ($delayreply && (($timestamp - $thread[dateline] ) < $delayreply * 86400)) || $ismoderator) && ((!$forum['replyperm'] && $allowpost) || ($forum['replyperm'] && strstr($forum['replyperm'], "\t$groupid\t")) || $forum['allowreply']);


        if($delayviewcount) {
                $logfile = DISCUZ_ROOT.'./forumdata/viewcount.log';
                if(substr($timestamp, -2) == '00') {
                        require DISCUZ_ROOT.'./include/misc.php';
                        updateviews();
                }

                if(@$fp = fopen($logfile, 'a')) {
                        fwrite($fp, "$tid\n");
                        fclose($fp);
                }elseif($adminid == 1) {
                        showmessage('view_log_invalid');
                }
        } else {
                $db->query("UPDATE LOW_PRIORITY $table_threads SET views=views+1 WHERE tid='$tid'", 'UNBUFFERED');
        }

        include template('viewthread');

} elseif($action == 'printable' && $tid) {         
  if ($thread['pflag']>0){
                 showmessage('交易帖子,严禁打印!');
        }
        require DISCUZ_ROOT.'./include/printable.php';

}

function checkpthreadpay(){
               global $ispthreadpayed,$postlist,$tid,$thread,$discuz_user,$ismoderator,$db,$table_pthreadpay,$fid,$did,$timestamp,$have_attachment;
                @include DISCUZ_ROOT.'./forumdata/cache/cache_plugins.php';
                $pthreadpay = $_DCACHE['plugins_settings']['pthreadpay'];
        if ( $timestamp - $thread[dateline] < $pthreadpay[sellabate]*86400){
                if ( ($postlist[0][postcount]==1) && ($pthreadpay['forumid']=='' || strstr($pthreadpay['forumid'].';', $fid.';')  )  ){        
                                                        
                      if ($thread['pflag']==1){
                                      $isadmininfo=$isinfo=$isnotsell='';
                                //帖子主人和管理员                                                                                                         
                                        if($ismoderator){                        
                                                        $isadmininfo='<a href="plugins.php?p=pthreadpay&tid='.$tid.'&handle=amercement">罚款</a>';
                                        }
                                      if($thread[author ]==$discuz_user){
                                                        $isinfo.='&nbsp;&nbsp;<a href="plugins.php?p=pthreadpay&tid='.$tid.'&handle=sell">修改</a>';
                                        }elseif( $db->result($db->query("SELECT COUNT(id) FROM $table_pthreadpay where username='$discuz_user' AND tid=$tid"),0)==0 ){
                                                         //没有购买帖子的人  
                                                         $isinfo.='&nbsp;&nbsp;<a href="plugins.php?p=pthreadpay&tid='.$tid.'&handle=buy">购买</a>';
                                                         $have_attachment=0;
                                                         $isnotsell='<br>======== 以下信息需要付费才能查看  ==========<br>';
                                  }
                                  if ($thread[psellcount]>0){
                                          $isinfo.='&nbsp;&nbsp;<a href="plugins.php?p=pthreadpay&tid='.$tid.'&handle=showall">购买者</a> ';
                                        }
                                $BORDERCOLOR=BORDERCOLOR;
                                $BORDERWIDTH=BORDERWIDTH;
                                $TABLESPACE=TABLESPACE;
                                $ALTBG2=ALTBG2;
                                $remain=$thread[pcount]-$thread[psellcount];
                                                                                                        
$echoinfo = <<<EOT
                  <center>
                    <table cellspacing="0" cellpadding="0" border="0" width="80%">
                          <tr><td bgcolor="$BORDERCOLOR">
                                          <table border="0" cellspacing="$BORDERWIDTH" cellpadding="$TABLESPACE" width="100%">
                                          <tr><td class="category" align="center" colspan="2" width="100%">交易信息</td></tr>
                                          <tr><td bgcolor="$ALTBG2" align="center" width="80%" valign=top>
                                                                  &nbsp;&nbsp;剩余:<strong>$remain</strong>
                                                            &nbsp;&nbsp;总售:<strong>$thread[pcount]</strong>
                                                            &nbsp;&nbsp;售价:<strong>$thread[pmoney]</strong>                                                                                                                                                                 
                                                            &nbsp;&nbsp;已售:<strong>$thread[psellcount]</strong><br>
                                                            &nbsp;&nbsp;开售时间:<strong>$thread[pselldate]</strong>
                                                           &nbsp;&nbsp;
                                                                   </td><td bgcolor="$ALTBG2" align="left" width="20%" valign=top>
                                                                  $isinfo
                                                                  </td>
                                          </td></tr>
                                          <tr><td bgcolor="$ALTBG2" align="left" colspan="2"  width="100%" valign=top>
                                                                  &nbsp;&nbsp;注:发布欺诈信息将处于收入的 <strong>$pthreadpay[amercement]</strong> 倍罚款!并退回买方购买款。&nbsp;&nbsp;&nbsp;&nbsp;        &nbsp;&nbsp;$isadmininfo                                                                                                                        
                                          </tr>
                                          </table>
                          </td></tr></table></center>
                          <br>                                                                                                               
EOT;
        if($isnotsell==''){
                        $postlist[0][message]=$echoinfo.$postlist[0][message];
        }else{
                         $postlist[0][message]=$echoinfo.$isnotsell;
        }
                                                               
                                        }elseif($thread['pflag']=='-1'){//处罚帖子
                                                $postlist[0][message]='<center>====== 该帖违反交易规定,已经被处罚! ======</center><br><br>'.$postlist[0][message];
                                        }elseif($thread[author]==$discuz_user){//没有买卖帖子                                       
                                                if ( $timestamp - $thread[dateline] < $pthreadpay[selldate]*60){
                                                        $postlist[0][message]='<center>====== <a href="plugins.php?p=pthreadpay&tid='.$tid.'&handle=sell">出售该帖</a> ======</center><br><br>'.$postlist[0][message];
                                                }        
                                        }        //end        pflag
                                       
                                }// end        fpage
        }//
                        if ($pthreadpay[adclose]==0){                                
                                  $adinfoarr=explode('|',$pthreadpay[adcontent]);
                                   $i=0;                                
                                  while ($i < count($postlist) ) {
                                                                            $adinfo=$adinfoarr[mt_rand(0,count($adinfoarr)-1)];
                                                                                if($pthreadpay[adplace]=='top'){        
                                                                                                                $postlist[$i][message]='<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td  align="center">'.$adinfo.'</td></tr><tr><td >'.$postlist[$i][message].'</td></tr></table>';
                                                                                }elseif($pthreadpay[adplace]=='left'){
                                                                                                                $postlist[$i][message]='<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td width="20%" align="left">'.$adinfo.'</td><td width="80%">'.$postlist[$i][message].'</td></tr></table>';
                                                                                }elseif($pthreadpay[adplace]=='right'){
                                                                                                                $postlist[$i][message]='<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td width="80%">'.$postlist[$i][message].'</td><td width="20%" align="right" >'.$adinfo.'</td></tr></table>';
                                                                                }else{
                                                                                                                $postlist[$i][message]='<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>'.$postlist[$i][message].'</td></tr><tr><td align="center">'.$adinfo.'</td></rd></table>';
                                                                                }
                                                                 if($pthreadpay[adshowall]==0){
                                                                                break;
                                                                 }
                                                                 $i++;
                                        }//end while                 
                        }// end adclose
}


?>
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-2 15:22 , Processed in 0.115589 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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