Example #1
0
$page = max(1, intval($page));
$start_limit = ($page - 1) * $tpp;
if ($action == 'index') {
    $myinvitenum = intval($db->result_first("SELECT COUNT(*) FROM {$tablepre}invites WHERE uid='{$discuz_uid}' AND dateline>'{$timestamp}'-86400 AND dateline<'{$timestamp}'"));
    if (!submitcheck('buysubmit')) {
        $invitenum = intval($db->result_first("SELECT COUNT(*) FROM {$tablepre}invites WHERE uid='{$discuz_uid}' AND status IN ('1', '3')"));
        $multipage = multi($invitenum, $tpp, $page, "invite.php");
        $invitelist = $inviteuserlist = array();
        $query = $db->query("SELECT dateline, expiration, invitecode, status\r\n\t\t\t\tFROM {$tablepre}invites\r\n\t\t\t\tWHERE uid='{$discuz_uid}' AND status IN ('1', '3') ORDER BY dateline DESC LIMIT {$start_limit},{$tpp}");
        while ($invite = $db->fetch_array($query)) {
            $invite['expiration'] = round(($invite['expiration'] - $timestamp) / 86400);
            $invitelist[] = $invite;
        }
        $query = $db->query("SELECT i.dateline, i.expiration, i.invitecode, m.username, m.uid\r\n\t\t\t\tFROM {$tablepre}invites i, {$tablepre}members m\r\n\t\t\t\tWHERE i.uid='{$discuz_uid}' AND i.status='2' AND i.reguid=m.uid ORDER BY i.regdateline DESC LIMIT 0, 10");
        while ($inviteuser = $db->fetch_array($query)) {
            $inviteuser['avatar'] = discuz_uc_avatar($inviteuser['uid'], 'small');
            $inviteuserlist[] = $inviteuser;
        }
        include template('invite_index');
    } else {
        if (!$allowinvite) {
            showmessage('group_nopermission', NULL, 'NOPERM');
        }
        if ($maxinvitenum && $myinvitenum == $maxinvitenum) {
            showmessage('invite_num_range_invalid');
        }
        $amount = intval($amount);
        $buyinvitecredit = $amount ? $amount * $inviteprice : 0;
        if (!$amount || $amount < 0) {
            showmessage('invite_num_invalid');
        } elseif (${'extcredits' . $creditstransextra[4]} < $buyinvitecredit && $buyinvitecredit) {
Example #2
0
                    ?>
<a name="new"></a><?php 
                    $new = 1;
                }
                ?>
<a<?php 
                if ($msgfromurl && $pm['msgfromid'] != $discuz_uid) {
                    ?>
 href="<?php 
                    echo $msgfromurl;
                    ?>
"<?php 
                }
                ?>
 class="avatar"><?php 
                echo discuz_uc_avatar($pm['msgfromid'], 'small');
                ?>
</a>
<p>
<span class="time right"><?php 
                echo $pm['dateline'];
                ?>
</span>
<cite<?php 
                if ($pm['new']) {
                    ?>
 class="new"<?php 
                }
                ?>
><?php 
                if ($pm['msgfromid'] != $discuz_uid) {
.mynarrow { margin: 5px -10px 5px 10px; padding-top: 8px; width: 200px; border-top: 1px dashed #ccc; }
.mynarrow h3.lightlink a { text-decoration: none; }
.with_side .side { width: 220px; }
.with_side .main { margin-left:-220px; }
.with_side .content { margin-left:220px; }
</style><? if(is_array($my_list['wide'])) { foreach($my_list['wide'] as $value) { ?><hr class="dashline" />
<h3 class="blocktitle lightlink"><a href="<?=$value['appurl']?>&from=space"><?=$value['appname']?></a></h3>
<p><? eval($value['myml']); ?></p><? } } } ?>
</div>
</div>
<div class="side">
<div class="profile_side">
<? if($bannedmessages & 2 && ($member['groupid'] == 4 || $member['groupid'] == 5)) { ?>
<div class="avatar">头像被屏蔽</div>
<? } else { ?>
<div class="avatar"><? echo discuz_uc_avatar($member['uid']); ?></div>
<? } ?>
<ul id="profile_act">
<?=$pluginhooks['profile_side_top']?>
<li class="pm"><a href="pm.php?action=new&amp;uid=<?=$member['uid']?>" id="sendpm" prompt="sendpm" onclick="showWindow('sendpm', this.href);return false;">发短消息</a></li>
<li class="buddy"><a href="my.php?item=buddylist&amp;newbuddyid=<?=$member['uid']?>&amp;buddysubmit=yes" id="addbuddy" prompt="addbuddy" onclick="ajaxmenu(this, 3000);doane(event);">加为好友</a></li>
<? if($discuz_uid && $magicstatus) { ?><li class="magic"><a href="magic.php?action=index&amp;username=<?=$member['usernameenc']?>" target="_blank">使用道具</a></li><? } if($allowviewuserthread) { ?>
<li class="searchthread"><a href="my.php?item=threads&amp;uid=<?=$member['uid']?>">查看主题</a></li>
<li class="searchpost"><a href="my.php?item=posts&amp;uid=<?=$member['uid']?>">查看回复</a></li>
<? } else { ?>
<li class="searchpost"><a href="search.php?srchuid=<?=$member['uid']?>&amp;srchfid=all&amp;srchfrom=0&amp;searchsubmit=yes">搜索帖子</a></li>
<? } if($ucappopen['UCHOME']) { ?>
<li class="space"><a href="<?=$uchomeurl?>/space.php?uid=<?=$member['uid']?>" target="_blank">个人空间</a></li>
<? } elseif($ucappopen['XSPACE']) { ?>
<li class="space"><a href="<?=$xspaceurl?>/?uid-<?=$member['uid']?>" target="_blank">个人空间</a></li>
<? } ?>
Example #4
0
function viewthread_procpost($post, $lastvisit, $ordertype, $special = 0)
{
    global $_G;
    if (!$_G['forum_newpostanchor'] && $post['dateline'] > $lastvisit) {
        $post['newpostanchor'] = '<a name="newpost"></a>';
        $_G['forum_newpostanchor'] = 1;
    } else {
        $post['newpostanchor'] = '';
    }
    $post['lastpostanchor'] = $ordertype != 1 && $_G['forum_numpost'] == $_G['forum_thread']['replies'] || $ordertype == 1 && $_G['forum_numpost'] == $_G['forum_thread']['replies'] + 2 ? '<a name="lastpost"></a>' : '';
    if ($_G['forum_pagebydesc']) {
        if ($ordertype != 1) {
            $post['number'] = $_G['forum_numpost'] + $_G['forum_ppp2']--;
        } else {
            $post['number'] = $post['first'] == 1 ? 1 : $_G['forum_numpost'] - $_G['forum_ppp2']--;
        }
        $post['count'] = $_G['ppp'] == $_G['forum_ppp3'] ? $_G['ppp'] - $_G['forum_postcount'] - 1 : $_G['forum_ppp3'] - $_G['forum_postcount'] - 1;
    } else {
        if ($ordertype != 1) {
            $post['number'] = ++$_G['forum_numpost'];
        } else {
            $post['number'] = $post['first'] == 1 ? 1 : --$_G['forum_numpost'];
        }
        $post['count'] = $_G['forum_postcount'];
    }
    $_G['forum_postcount']++;
    $post['dbdateline'] = $post['dateline'];
    $post['dateline'] = dgmdate($post['dateline'], 'u');
    $post['groupid'] = $_G['cache']['usergroups'][$post['groupid']] ? $post['groupid'] : 7;
    if ($post['username']) {
        $_G['forum_onlineauthors'][] = $post['authorid'];
        $post['usernameenc'] = rawurlencode($post['username']);
        !$special && ($post['groupid'] = getgroupid($post['authorid'], $_G['cache']['usergroups'][$post['groupid']], $post));
        $post['readaccess'] = $_G['cache']['usergroups'][$post['groupid']]['readaccess'];
        if ($_G['cache']['usergroups'][$post['groupid']]['userstatusby'] == 1) {
            $post['authortitle'] = $_G['cache']['usergroups'][$post['groupid']]['grouptitle'];
            $post['stars'] = $_G['cache']['usergroups'][$post['groupid']]['stars'];
        }
        $post['taobaoas'] = addslashes($post['taobao']);
        $post['regdate'] = dgmdate($post['regdate'], 'd');
        $post['lastdate'] = dgmdate($post['lastactivity'], 'd');
        $post['authoras'] = !$post['anonymous'] ? ' ' . addslashes($post['author']) : '';
        if ($post['medals']) {
            loadcache('medals');
            foreach ($post['medals'] = explode("\t", $post['medals']) as $key => $medalid) {
                list($medalid, $medalexpiration) = explode("|", $medalid);
                if (isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
                    $post['medals'][$key] = $_G['cache']['medals'][$medalid];
                } else {
                    unset($post['medals'][$key]);
                }
            }
        }
        $post['avatar'] = discuz_uc_avatar($post['authorid']);
        $post['groupicon'] = $post['avatar'] ? g_icon($post['groupid'], 1) : '';
        $post['banned'] = $post['status'] & 1;
        $post['warned'] = ($post['status'] & 2) >> 1;
    } else {
        if (!$post['authorid']) {
            $post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')) . '.x';
        }
    }
    $post['attachments'] = array();
    $post['imagelist'] = $post['attachlist'] = '';
    if ($post['attachment']) {
        if ($_G['group']['allowgetattach']) {
            $_G['forum_attachpids'] .= ",{$post['pid']}";
            $post['attachment'] = 0;
            if (preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $post['message'], $matchaids)) {
                $_G['forum_attachtags'][$post['pid']] = $matchaids[1];
            }
        } else {
            $post['message'] = preg_replace("/\\[attach\\](\\d+)\\[\\/attach\\]/i", '', $post['message']);
        }
    }
    $_G['forum_ratelogpid'] .= $_G['setting']['ratelogrecord'] && $post['ratetimes'] ? ',' . $post['pid'] : '';
    if ($_G['setting']['commentnumber'] && ($post['first'] && $_G['setting']['commentfirstpost'] || !$post['first'])) {
        $_G['forum_commonpid'] .= $post['comment'] ? ',' . $post['pid'] : '';
    }
    $post['allowcomment'] = $_G['setting']['commentnumber'] && ($_G['setting']['commentpostself'] || $post['authorid'] != $_G['uid']) && ($post['first'] && $_G['setting']['commentfirstpost'] && in_array($_G['group']['allowcommentpost'], array(1, 3)) || !$post['first'] && in_array($_G['group']['allowcommentpost'], array(2, 3)));
    $_G['forum']['allowbbcode'] = $_G['forum']['allowbbcode'] ? $_G['cache']['usergroups'][$post['groupid']]['allowcusbbcode'] ? 2 : 1 : 0;
    $post['signature'] = $post['usesig'] ? $_G['setting']['sigviewcond'] ? strlen($post['message']) > $_G['setting']['sigviewcond'] ? $post['signature'] : '' : $post['signature'] : '';
    $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $_G['forum']['allowsmilies'], $_G['forum']['allowbbcode'], $_G['forum']['allowimgcode'] && $_G['setting']['showimages'] ? 1 : 0, $_G['forum']['allowhtml'], $_G['forum']['jammer'] && $post['authorid'] != $_G['uid'] ? 1 : 0, 0, $post['authorid'], $_G['forum']['allowmediacode'], $post['pid']);
    $post['first'] && ($_G['forum_firstpid'] = $post['pid']);
    $_G['forum_firstpid'] = intval($_G['forum_firstpid']);
    return $post;
}
Example #5
0
        showmessage('undefined_action', NULL, 'HALTED');
    } elseif (!($task = $db->fetch_first("SELECT t.taskid, mt.status FROM {$tablepre}tasks t LEFT JOIN {$tablepre}mytasks mt ON mt.taskid=t.taskid AND mt.uid='{$discuz_uid}' WHERE t.taskid='{$id}' AND t.available='2'"))) {
        showmessage('task_nonexistence', NULL, 'HALTED');
    } elseif ($task['status'] != '0') {
        showmessage('undefined_action');
    }
    $db->query("DELETE FROM {$tablepre}mytasks WHERE uid='{$discuz_uid}' AND taskid='{$id}'", 'UNBUFFERED');
    $db->query("UPDATE {$tablepre}tasks SET applicants=applicants-1 WHERE taskid='{$id}'", 'UNBUFFERED');
    if (!$db->result_first("SELECT COUNT(*) FROM {$tablepre}mytasks WHERE uid='{$discuz_uid}' AND status='0'")) {
        $db->query("UPDATE {$tablepre}members SET prompt=prompt^2 WHERE uid='{$discuz_uid}' AND prompt=prompt|2", 'UNBUFFERED');
    }
    showmessage('task_giveup', "task.php?item=view&id={$id}");
} elseif ($action == 'parter' && $id) {
    $query = $db->query("SELECT * FROM {$tablepre}mytasks WHERE taskid='{$id}' ORDER BY dateline DESC LIMIT 0, 8");
    while ($parter = $db->fetch_array($query)) {
        $parter['avatar'] = discuz_uc_avatar($parter['uid'], 'small');
        $csc = explode("\t", $parter['csc']);
        $parter['csc'] = floatval($csc[0]);
        $parterlist[] = $parter;
    }
    include template('task_parter');
    dexit();
} else {
    showmessage('undefined_action', NULL, 'HALTED');
}
include template('task');
function taskmessage($csc, $msg)
{
    extract($GLOBALS, EXTR_SKIP);
    include_once language('messages');
    include template('header_ajax');
Example #6
0
	$allowviewpro = $discuz_uid && $uid == $discuz_uid ? 1 : $allowviewpro;

	if(!$allowviewpro) {
		showmessage('group_nopermission', NULL, 'NOPERM');
	}

	include_once DISCUZ_ROOT.'./forumdata/cache/cache_usergroups.php';

	$discuz_action = 62;

	$member = $db->fetch_first("SELECT m.uid, mf.customstatus, m.username, m.groupid, mf.taobao, mf.alipay, mf.avatar, mf.avatarwidth, mf.avatarheight, mf.buyercredit, mf.sellercredit, m.regdate FROM {$tablepre}members m LEFT JOIN {$tablepre}memberfields mf USING(uid) WHERE m.uid='$uid'");
	if(!$member) {
		showmessage('member_nonexistence', NULL, 'NOPERM');
	}

	$member['avatar'] = '<div class="avatar">'.discuz_uc_avatar($member['uid']);
	if($_DCACHE['usergroups'][$member['groupid']]['groupavatar']) {
		$member['avatar'] .= '<br /><img src="'.$_DCACHE['usergroups'][$member['groupid']]['groupavatar'].'" border="0" alt="" />';
	}
	$member['avatar'] .= '</div>';

	$member['taobaoas'] = str_replace("'", '', addslashes($member['taobao']));
	$member['regdate'] = gmdate($dateformat, $member['regdate'] + $timeoffset * 3600);
	$member['usernameenc'] = rawurlencode($member['username']);
	$member['buyerrank'] = 0;
	if($member['buyercredit']){
		foreach($ec_credit['rank'] AS $level => $credit) {
			if($member['buyercredit'] <= $credit) {
				$member['buyerrank'] = $level;
				break;
			}
function updaterequest($requestdata, $requesttemplatebody, $requesttemplate, $specialfid, $mode, $key, &$nocache)
{
    global $db, $tablepre, $timestamp, $boardurl, $dateformat, $timeformat, $rewritestatus, $uc, $_DCACHE;
    $function = $requestdata['function'];
    $fids = isset($requestdata['fids']) ? $requestdata['fids'] : NULL;
    $startrow = isset($requestdata['startrow']) ? intval($requestdata['startrow']) : 0;
    $items = isset($requestdata['items']) ? intval($requestdata['items']) : 10;
    $digest = isset($requestdata['digest']) ? intval($requestdata['digest']) : 0;
    $stick = isset($requestdata['stick']) ? intval($requestdata['stick']) : 0;
    $newwindow = isset($requestdata['newwindow']) ? $requestdata['newwindow'] : 1;
    $LinkTarget = $newwindow == 1 ? " target='_blank'" : ($newwindow == 2 ? " target='main'" : NULL);
    $sidestatus = !empty($requestdata['sidestatus']) ? 1 : 0;
    $boardurl = empty($requestdata['boardurl']) ? $mode ? $boardurl : '' : $requestdata['boardurl'] . '/';
    if ($function == 'threads') {
        $orderby = isset($requestdata['orderby']) ? in_array($requestdata['orderby'], array('lastpost', 'dateline', 'replies', 'views', 'hourviews', 'todayviews', 'weekviews', 'monthviews')) ? $requestdata['orderby'] : 'lastpost' : 'lastpost';
        $hours = isset($requestdata['hours']) ? intval($requestdata['hours']) : 0;
        $highlight = isset($requestdata['highlight']) ? $requestdata['highlight'] : 0;
        $picpre = isset($requestdata['picpre']) ? urldecode($requestdata['picpre']) : NULL;
        $maxlength = !empty($requestdata['maxlength']) ? intval($requestdata['maxlength']) : 50;
        $fnamelength = isset($requestdata['fnamelength']) ? intval($requestdata['fnamelength']) : 0;
        $recommend = !empty($requestdata['recommend']) ? 1 : 0;
        $tids = isset($requestdata['tids']) ? $requestdata['tids'] : NULL;
        $keyword = !empty($requestdata['keyword']) ? $requestdata['keyword'] : NULL;
        $typeids = isset($requestdata['typeids']) ? $requestdata['typeids'] : NULL;
        $sortids = isset($requestdata['sortids']) ? $requestdata['sortids'] : NULL;
        $special = isset($requestdata['special']) ? intval($requestdata['special']) : 0;
        $rewardstatus = isset($requestdata['rewardstatus']) ? intval($requestdata['rewardstatus']) : 0;
        $threadtype = isset($requestdata['threadtype']) ? intval($requestdata['threadtype']) : 0;
        $threadsort = isset($requestdata['threadsort']) ? intval($requestdata['threadsort']) : 0;
        $tag = !empty($requestdata['tag']) ? trim($requestdata['tag']) : NULL;
        $messagelength = !empty($requestdata['messagelength']) ? intval($requestdata['messagelength']) : 255;
        require DISCUZ_ROOT . './forumdata/cache/cache_forums.php';
        $datalist = array();
        $threadtypeids = array();
        if ($keyword) {
            if (preg_match("(AND|\\+|&|\\s)", $keyword) && !preg_match("(OR|\\|)", $keyword)) {
                $andor = ' AND ';
                $keywordsrch = '1';
                $keyword = preg_replace("/( AND |&| )/is", "+", $keyword);
            } else {
                $andor = ' OR ';
                $keywordsrch = '0';
                $keyword = preg_replace("/( OR |\\|)/is", "+", $keyword);
            }
            $keyword = str_replace('*', '%', addcslashes($keyword, '%_'));
            foreach (explode('+', $keyword) as $text) {
                $text = trim($text);
                if ($text) {
                    $keywordsrch .= $andor;
                    $keywordsrch .= "t.subject LIKE '%{$text}%'";
                }
            }
            $keyword = " AND ({$keywordsrch})";
        } else {
            $keyword = '';
        }
        $sql = ($specialfid && $sidestatus ? ' AND t.fid = ' . $specialfid : ($fids ? ' AND t.fid IN (\'' . str_replace('_', '\',\'', $fids) . '\')' : '')) . $keyword . ($tids ? ' AND t.tid IN (\'' . str_replace('_', '\',\'', $tids) . '\')' : '') . ($typeids ? ' AND t.typeid IN (\'' . str_replace('_', '\',\'', $typeids) . '\')' : '') . ($sortids ? ' AND t.sortid IN (\'' . str_replace('_', '\',\'', $sortids) . '\')' : '') . ($special >= 0 && $special < 127 ? threadrange($special, 'special', 7) : '') . ($special & 16 && $rewardstatus ? $rewardstatus == 1 ? ' AND t.price < 0' : ' AND t.price > 0' : '') . ($digest > 0 && $digest < 15 ? threadrange($digest, 'digest') : '') . ($stick > 0 && $stick < 15 ? threadrange($stick, 'displayorder') : '');
        if (in_array($orderby, array('hourviews', 'todayviews', 'weekviews', 'monthviews'))) {
            $historytime = 0;
            switch ($orderby) {
                case 'hourviews':
                    $historytime = $timestamp - 3600 * $hours;
                    break;
                case 'todayviews':
                    $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp), date('Y', $timestamp));
                    break;
                case 'weekviews':
                    $week = gmdate('w', $timestamp) - 1;
                    $week = $week != -1 ? $week : 6;
                    $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp) - $week, date('Y', $timestamp));
                    break;
                case 'monthviews':
                    $historytime = mktime(0, 0, 0, date('m', $timestamp), 1, date('Y', $timestamp));
                    break;
            }
            $sql .= ' AND t.dateline>=' . $historytime;
            $orderby = 'views';
        }
        $sqlfrom = strexists($requesttemplate, '{message}') ? ",p.message FROM `{$tablepre}threads` t LEFT JOIN `{$tablepre}posts` p ON p.tid=t.tid AND p.first='1'" : "FROM `{$tablepre}threads` t";
        if (strexists($requesttemplate, '{imgattach}')) {
            $sqlfrom = ",a.remote,a.attachment,a.thumb {$sqlfrom} INNER JOIN `{$tablepre}attachments` a ON a.tid=t.tid";
            $sql .= " AND a.isimage='1' AND a.readperm='0' AND a.price='0'";
            $attachadd .= "GROUP BY a.tid";
            $attachurl = $_DCACHE['settings']['attachurl'];
            $attachurl = preg_match("/^((https?|ftps?):\\/\\/|www\\.)/i", $attachurl) ? $attachurl : $boardurl . $attachurl;
        }
        if ($recommend) {
            $sqlfrom .= " INNER JOIN `{$tablepre}forumrecommend` fc ON fc.tid=t.tid";
        }
        if ($tag) {
            $tags = explode(' ', $tag);
            foreach ($tags as $tagk => $tagv) {
                if (!preg_match('/^([\\x7f-\\xff_-]|\\w){3,20}$/', $tagv)) {
                    unset($tags[$tagk]);
                }
            }
            if ($tags = implode("','", $tags)) {
                $sqlfrom .= " INNER JOIN `{$tablepre}threadtags` tag ON tag.tid=t.tid AND tag.tagname IN ('{$tags}')";
            }
        }
        $query = $db->query("SELECT t.tid,t.fid,t.readperm,t.author,t.authorid,t.subject,t.dateline,t.lastpost,t.lastposter,t.views,t.replies,t.highlight,t.digest,t.typeid,t.sortid\r\n\t\t\t{$sqlfrom} WHERE t.readperm='0'\r\n\t\t\t{$sql}\r\n\t\t\tAND t.displayorder>='0'\r\n\t\t\tAND t.fid>'0'\r\n\t\t\t{$attachadd}\r\n\t\t\tORDER BY t.{$orderby} DESC\r\n\t\t\tLIMIT {$startrow},{$items};");
        while ($data = $db->fetch_array($query)) {
            $datalist[$data['tid']]['fid'] = $data['fid'];
            $datalist[$data['tid']]['fname'] = isset($_DCACHE['forums'][$data['fid']]['name']) ? str_replace('\\\'', '&#39;', addslashes($_DCACHE['forums'][$data['fid']]['name'])) : NULL;
            $datalist[$data['tid']]['fnamelength'] = strlen($datalist[$data['tid']]['fname']);
            $datalist[$data['tid']]['subject'] = isset($data['subject']) ? str_replace('\\\'', '&#39;', addslashes($data['subject'])) : NULL;
            $datalist[$data['tid']]['dateline'] = gmdate("{$dateformat} {$timeformat}", $data['dateline'] + $_DCACHE['settings']['timeoffset'] * 3600);
            $datalist[$data['tid']]['lastpost'] = gmdate("{$dateformat} {$timeformat}", $data['lastpost'] + $_DCACHE['settings']['timeoffset'] * 3600);
            $datalist[$data['tid']]['lastposter'] = $data['lastposter'];
            $datalist[$data['tid']]['authorid'] = $data['authorid'];
            $datalist[$data['tid']]['views'] = $data['views'];
            $datalist[$data['tid']]['replies'] = $data['replies'];
            $datalist[$data['tid']]['highlight'] = $data['highlight'];
            $datalist[$data['tid']]['message'] = cutmessage($data['message'], $messagelength);
            $datalist[$data['tid']]['imgattach'] = ($data['remote'] ? $_DCACHE['settings']['ftp']['attachurl'] : $attachurl) . "/{$data['attachment']}" . ($_DCACHE['settings']['thumbstatus'] && $data['thumb'] ? '.thumb.jpg' : '');
            if ($data['author']) {
                $datalist[$data['tid']]['author'] = $data['author'];
            } else {
                $datalist[$data['tid']]['author'] = 'Anonymous';
                $datalist[$data['tid']]['authorid'] = 0;
            }
            if ($data['lastposter']) {
                $datalist[$data['tid']]['lastposter'] = $data['lastposter'];
            } else {
                $datalist[$data['tid']]['lastposter'] = '';
            }
            $datalist[$data['tid']]['typeid'] = $data['typeid'];
            $datalist[$data['tid']]['sortid'] = $data['sortid'];
            $datalist[$data['tid']]['subjectprefix'] = '';
            $threadtypeids[] = $data['typeid'];
            $threadtypeids[] = $data['sortid'];
        }
        if (($threadsort || $threadtype) && $threadtypeids) {
            $typelist = array();
            $query = $db->query("SELECT typeid, name FROM {$tablepre}threadtypes WHERE typeid IN ('" . implode('\',\'', $threadtypeids) . "')");
            while ($typearray = $db->fetch_array($query)) {
                $typelist[$typearray['typeid']] = $typearray['name'];
            }
            foreach ($datalist as $tid => $value) {
                $subjectprefix = '';
                if ($threadsort && $value['sortid'] && isset($typelist[$value['sortid']])) {
                    $subjectprefix .= '[' . $typelist[$value['sortid']] . ']';
                }
                if ($threadtype && $value['typeid'] && isset($typelist[$value['typeid']])) {
                    $subjectprefix .= '[' . $typelist[$value['typeid']] . ']';
                }
                $datalist[$tid]['subjectprefix'] = $subjectprefix;
            }
        }
        $writedata = '';
        if (is_array($datalist)) {
            $colorarray = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282');
            $prefix = $picpre ? "<img src='{$picpre}' border='0' align='absmiddle'>" : NULL;
            $requesttemplate = !$requesttemplate ? '{prefix} {subject}<br />' : $requesttemplate;
            $order = 1;
            foreach ($datalist as $tid => $value) {
                $SubjectStyles = '';
                if ($highlight && $value['highlight']) {
                    $string = sprintf('%02d', $value['highlight']);
                    $stylestr = sprintf('%03b', $string[0]);
                    $SubjectStyles .= " style='";
                    $SubjectStyles .= $stylestr[0] ? 'font-weight: bold;' : NULL;
                    $SubjectStyles .= $stylestr[1] ? 'font-style: italic;' : NULL;
                    $SubjectStyles .= $stylestr[2] ? 'text-decoration: underline;' : NULL;
                    $SubjectStyles .= $string[1] ? 'color: ' . $colorarray[$string[1]] : NULL;
                    $SubjectStyles .= "'";
                }
                $replace['{link}'] = $boardurl . "viewthread.php?tid={$tid}";
                $value['prefixlength'] = $value['subjectprefix'] ? strlen(strip_tags($value['subjectprefix'])) : 0;
                $value['maxlength'] = $maxlength - $value['prefixlength'];
                $replace['{subject_nolink}'] = $value['subjectprefix'] . cutstr($value['subject'], $fnamelength ? $value['maxlength'] - $value['fnamelength'] : $value['maxlength'], '');
                $replace['{subject_full}'] = $value['subjectprefix'] . $value['subject'];
                $replace['{prefix}'] = $prefix;
                $replace['{forum}'] = "<a href='" . $boardurl . "forumdisplay.php?fid={$value['fid']}'{$LinkTarget}>{$value['fname']}</a>";
                $replace['{dateline}'] = $value['dateline'];
                $replace['{subject}'] = "<a href='" . $boardurl . "viewthread.php?tid={$tid}' title='{$value['subject']}'{$SubjectStyles}{$LinkTarget}>" . $replace['{subject_nolink}'] . "</a>";
                $replace['{message}'] = $value['message'];
                if ($value['authorid']) {
                    $replace['{author}'] = "<a href='" . $boardurl . "space.php?uid={$value['authorid']}'{$LinkTarget}>{$value['author']}</a>";
                } else {
                    $replace['{author}'] = $value['author'];
                }
                $replace['{author_nolink}'] = $value['author'];
                if ($value['lastposter'] !== '') {
                    $replace['{lastposter}'] = "<a href='" . $boardurl . "space.php?username=" . rawurlencode($value['lastposter']) . "'{$LinkTarget}>{$value['lastposter']}</a>";
                    $replace['{lastposter_nolink}'] = $value['lastposter'];
                } else {
                    $replace['{lastposter}'] = $replace['{lastposter_nolink}'] = 'Anonymous';
                }
                $replace['{lastpost}'] = $value['lastpost'];
                $replace['{views}'] = $value['views'];
                $replace['{replies}'] = $value['replies'];
                $replace['{imgattach}'] = $value['imgattach'];
                $replace['{order}'] = $order++;
                $writedata .= nodereplace($replace, $requesttemplate);
            }
        }
    } elseif ($function == 'forums') {
        $fups = isset($requestdata['fups']) ? $requestdata['fups'] : NULL;
        $orderby = isset($requestdata['orderby']) ? in_array($requestdata['orderby'], array('displayorder', 'threads', 'posts')) ? $requestdata['orderby'] : 'displayorder' : 'displayorder';
        $datalist = array();
        $query = $db->query("SELECT `fid`,`fup`,`name`,`status`,`threads`,`posts`,`todayposts`,`displayorder`,`type`\r\n\t\t\tFROM `{$tablepre}forums`\r\n\t\t\tWHERE `type`!='group'\r\n\t\t\t" . ($fups ? "AND `fup` IN ('" . str_replace('_', '\',\'', $fups) . "') " : "") . "\r\n\t\t\tAND `status`='1'\r\n\t\t\tORDER BY " . ($orderby == 'displayorder' ? " `displayorder` ASC " : " `{$orderby}` DESC") . "\r\n\t\t\tLIMIT {$startrow}," . ($items > 0 ? $items : 65535) . ";");
        while ($data = $db->fetch_array($query)) {
            $datalist[$data['fid']]['name'] = str_replace('\\\'', '&#39;', addslashes($data['name']));
            $datalist[$data['fid']]['threads'] = $data['threads'];
            $datalist[$data['fid']]['posts'] = $data['posts'];
            $datalist[$data['fid']]['todayposts'] = $data['todayposts'];
        }
        $writedata = '';
        if (is_array($datalist)) {
            $requesttemplate = !$requesttemplate ? '{forumname}<br />' : $requesttemplate;
            $order = 1;
            foreach ($datalist as $fid => $value) {
                $replace['{link}'] = $boardurl . "forumdisplay.php?fid={$fid}";
                $replace['{forumname_nolink}'] = $value['name'];
                $replace['{forumname}'] = "<a href='" . $boardurl . "forumdisplay.php?fid={$fid}'{$LinkTarget}>{$value['name']}</a>";
                $replace['{threads}'] = $value['threads'];
                $replace['{posts}'] = $value['posts'];
                $replace['{todayposts}'] = $value['todayposts'];
                $replace['{order}'] = $order++;
                $writedata .= nodereplace($replace, $requesttemplate);
            }
        }
    } elseif ($function == 'memberrank') {
        $orderby = isset($requestdata['orderby']) ? in_array($requestdata['orderby'], array('credits', 'extcredits', 'posts', 'digestposts', 'regdate', 'hourposts', 'todayposts', 'weekposts', 'monthposts')) ? $requestdata['orderby'] : 'credits' : 'credits';
        $hours = isset($requestdata['hours']) ? intval($requestdata['hours']) : 0;
        $datalist = array();
        switch ($orderby) {
            case 'credits':
                $sql = "SELECT m.`username`,m.`uid`,m.`credits` FROM `{$tablepre}members` m ORDER BY m.`credits` DESC";
                break;
            case 'extcredits':
                $requestdata['extcredit'] = intval($requestdata['extcredit']);
                $sql = "SELECT m.`username`,m.`uid`,m.`extcredits{$requestdata['extcredit']}` FROM `{$tablepre}members` m ORDER BY m.`extcredits{$requestdata['extcredit']}` DESC";
                break;
            case 'posts':
                $sql = "SELECT m.`username`,m.`uid`,m.`posts` FROM `{$tablepre}members` m ORDER BY m.`posts` DESC";
                break;
            case 'digestposts':
                $sql = "SELECT m.`username`,m.`uid`,m.`digestposts` FROM `{$tablepre}members` m ORDER BY m.`digestposts` DESC";
                break;
            case 'regdate':
                $sql = "SELECT m.`username`,m.`uid`,m.`regdate` FROM `{$tablepre}members` m ORDER BY m.`regdate` DESC";
                break;
            case 'hourposts':
                $historytime = $timestamp - 3600 * intval($hours);
                $sql = "SELECT DISTINCT(p.author) AS username,p.authorid AS uid,COUNT(p.pid) AS postnum FROM `{$tablepre}posts` p WHERE p.`dateline`>={$historytime} AND p.`authorid`!='0' GROUP BY p.`author` ORDER BY `postnum` DESC";
                break;
            case 'todayposts':
                $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp), date('Y', $timestamp));
                $sql = "SELECT DISTINCT(p.author) AS username,p.authorid AS uid,COUNT(p.pid) AS postnum FROM `{$tablepre}posts` p WHERE p.`dateline`>={$historytime} AND p.`authorid`!='0' GROUP BY p.`author` ORDER BY `postnum` DESC";
                break;
            case 'weekposts':
                $week = gmdate('w', $timestamp) - 1;
                $week = $week != -1 ? $week : 6;
                $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp) - $week, date('Y', $timestamp));
                $sql = "SELECT DISTINCT(p.author) AS username,p.authorid AS uid,COUNT(p.pid) AS postnum FROM `{$tablepre}posts` p LEFT JOIN `{$tablepre}memberfields` mf ON mf.`uid` = p.`authorid` WHERE p.`dateline`>={$historytime} AND p.`authorid`!='0' GROUP BY p.`author` ORDER BY `postnum` DESC";
                break;
            case 'monthposts':
                $historytime = mktime(0, 0, 0, date('m', $timestamp), 1, date('Y', $timestamp));
                $sql = "SELECT DISTINCT(p.author) AS username,p.authorid AS uid,COUNT(p.pid) AS postnum FROM `{$tablepre}posts` p LEFT JOIN `{$tablepre}memberfields` mf ON mf.`uid` = p.`authorid` WHERE p.`dateline`>={$historytime} AND p.`authorid`!='0' GROUP BY p.`author` ORDER BY `postnum` DESC";
                break;
        }
        $query = $db->query($sql . " LIMIT {$startrow},{$items};");
        while ($data = $db->fetch_array($query, MYSQL_NUM)) {
            $data[2] = $orderby == 'regdate' ? gmdate($dateformat, $data[2] + $_DCACHE['settings']['timeoffset'] * 3600) : $data[2];
            $datalist[] = $data;
        }
        $writedata = '';
        if (is_array($datalist)) {
            $requesttemplate = !$requesttemplate ? '{regdate} {member} {value}<br />' : $requesttemplate;
            $order = 1;
            foreach ($datalist as $value) {
                $replace['{regdate}'] = $replace['{value}'] = '';
                if ($orderby == 'regdate') {
                    $replace['{regdate}'] = $value[2];
                } else {
                    $replace['{value}'] = $value[2];
                }
                $replace['{uid}'] = $value[1];
                $replace['{member}'] = "<a href='" . $boardurl . "space.php?uid={$value['1']}'{$LinkTarget}>{$value['0']}</a>";
                $replace['{avatar}'] = "<a title='" . htmlspecialchars($value[0]) . "' href='" . $boardurl . "space.php?uid={$value['1']}'{$LinkTarget}>" . discuz_uc_avatar($value[1]) . "</a>";
                $replace['{avatarsmall}'] = "<a title='" . htmlspecialchars($value[0]) . "' href='" . $boardurl . "space.php?uid={$value['1']}'{$LinkTarget}>" . discuz_uc_avatar($value[1], 'small') . "</a>";
                $replace['{avatarbig}'] = "<a title='" . htmlspecialchars($value[0]) . "' href='" . $boardurl . "space.php?uid={$value['1']}'{$LinkTarget}>" . discuz_uc_avatar($value[1], 'big') . "</a>";
                $replace['{order}'] = $order++;
                $writedata .= nodereplace($replace, $requesttemplate);
            }
        }
    } elseif ($function == 'stats') {
        $info = isset($requestdata['info']) ? $requestdata['info'] : NULL;
        if (is_array($info)) {
            $language = $info;
            $info_index = '';
            $statsinfo = array();
            $statsinfo['forums'] = $statsinfo['threads'] = $statsinfo['posts'] = 0;
            $query = $db->query("SELECT `status`,`threads`,`posts`\r\n\t\t\t\t\tFROM `{$tablepre}forums` WHERE\r\n\t\t\t\t\t`status`='1';\r\n\t\t\t\t\t");
            while ($forumlist = $db->fetch_array($query)) {
                $statsinfo['forums']++;
                $statsinfo['threads'] += $forumlist['threads'];
                $statsinfo['posts'] += $forumlist['posts'];
            }
            unset($info['forums'], $info['threads'], $info['posts']);
            foreach ($info as $index => $value) {
                if ($index == 'members') {
                    $sql = "SELECT COUNT(*) FROM `{$tablepre}members`;";
                } elseif ($index == 'online') {
                    $sql = "SELECT COUNT(*) FROM `{$tablepre}sessions`;";
                } elseif ($index == 'onlinemembers') {
                    $sql = "SELECT COUNT(*) FROM `{$tablepre}sessions` WHERE `uid`>'0';";
                }
                if ($index == 'members' || $index == 'online' || $index == 'onlinemembers') {
                    $statsinfo[$index] = $db->result_first($sql);
                }
            }
            unset($index, $value);
            $writedata = '';
            $requesttemplate = !$requesttemplate ? '{name} {value}<br />' : $requesttemplate;
            foreach ($language as $index => $value) {
                $replace['{name}'] = $value;
                $replace['{value}'] = $statsinfo[$index];
                $writedata .= str_replace(array_keys($replace), $replace, $requesttemplate);
            }
        }
    } elseif ($function == 'images') {
        $maxwidth = isset($requestdata['maxwidth']) ? $requestdata['maxwidth'] : 0;
        $maxheight = isset($requestdata['maxheight']) ? $requestdata['maxheight'] : 0;
        require DISCUZ_ROOT . './forumdata/cache/cache_forums.php';
        $datalist = array();
        $sql = ($specialfid && $sidestatus ? ' AND t.fid = ' . $specialfid : ($fids ? ' AND t.fid IN (\'' . str_replace('_', '\',\'', $fids) . '\')' : '')) . ($digest > 0 && $digest < 15 ? threadrange($digest, 'digest') : '');
        $imagesql = "AND `attach`.`isimage`" . (!empty($requestdata['isimage']) ? $requestdata['isimage'] == 1 ? "='1'" : ($requestdata['isimage'] == 2 ? "='0'" : ">='0'") : ">='0'");
        $methodsql = !empty($requestdata['threadmethod']) ? 'GROUP BY `attach`.`tid`' : '';
        $hours = isset($requestdata['hours']) ? intval($requestdata['hours']) : 0;
        $orderby = isset($requestdata['orderby']) ? in_array($requestdata['orderby'], array('dateline', 'downloads', 'hourdownloads', 'todaydownloads', 'weekdownloads', 'monthdownloads')) ? $requestdata['orderby'] : 'dateline' : 'dateline';
        $orderbysql = $historytime = '';
        switch ($orderby) {
            case 'dateline':
                $orderbysql = "ORDER BY `attach`.`dateline` DESC";
                break;
            case 'downloads':
                $orderbysql = "ORDER BY `attach`.`downloads` DESC";
                break;
            case 'hourdownloads':
                $historytime = $timestamp - 3600 * intval($hours);
                $orderbysql = "ORDER BY `attach`.`downloads` DESC";
                break;
            case 'todaydownloads':
                $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp), date('Y', $timestamp));
                $orderbysql = "ORDER BY `attach`.`downloads` DESC";
                break;
            case 'weekdownloads':
                $week = gmdate('w', $timestamp) - 1;
                $week = $week != -1 ? $week : 6;
                $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp) - $week, date('Y', $timestamp));
                $orderbysql = "ORDER BY `attach`.`downloads` DESC";
                break;
            case 'monthdownloads':
                $historytime = mktime(0, 0, 0, date('m', $timestamp), 1, date('Y', $timestamp));
                $orderbysql = "ORDER BY `attach`.`downloads` DESC";
                break;
        }
        $historytime = !$historytime ? $timestamp - 2592000 : $historytime;
        $htsql = "`attach`.`dateline`>={$historytime}";
        $query = $db->query("SELECT attach.*,t.tid,t.fid,t.digest,t.author,t.subject,t.displayorder\r\n\t\t\tFROM `{$tablepre}attachments` attach\r\n\t\t\tINNER JOIN `{$tablepre}threads` t\r\n\t\t\tON `t`.`tid`=`attach`.`tid` AND `displayorder`>='0'\r\n\t\t\tWHERE {$htsql} AND `attach`.`readperm`='0' AND `attach`.`price`='0'\r\n\t\t\t{$imagesql}\r\n\t\t\t{$sql}\r\n\t\t\t{$methodsql}\r\n\t\t\t{$orderbysql}\r\n\t\t\tLIMIT {$startrow},{$items};");
        $attachurl = $_DCACHE['settings']['attachurl'];
        $attachurl = preg_match("/^((https?|ftps?):\\/\\/|www\\.)/i", $attachurl) ? $attachurl : $boardurl . $attachurl;
        $i = 0;
        while ($data = $db->fetch_array($query)) {
            $key = $requestdata['threadmethod'] ? $data['tid'] : $i++;
            $datalist[$key]['threadlink'] = $boardurl . "redirect.php?goto=findpost&ptid={$data['tid']}&pid={$data['pid']}";
            $datalist[$key]['imgfile'] = ($data['remote'] ? $_DCACHE['settings']['ftp']['attachurl'] : $attachurl) . "/{$data['attachment']}" . ($_DCACHE['settings']['thumbstatus'] && $data['thumb'] ? '.thumb.jpg' : '');
            $datalist[$key]['file'] = $boardurl . "attachment.php?aid={$data['aid']}&k=" . md5($data[aid] . md5($_DCACHE['settings']['authkey']) . $timestamp) . "&t={$timestamp}";
            $datalist[$key]['subject'] = str_replace('\\\'', '&#39;', $data['subject']);
            $datalist[$key]['filename'] = str_replace('\\\'', '&#39;', $data['filename']);
            $datalist[$key]['author'] = addslashes($data['author']);
            $datalist[$key]['downloads'] = $data['downloads'];
            $datalist[$key]['author'] = $data['author'];
            $datalist[$key]['filesize'] = number_format($data['filesize']);
            $datalist[$key]['dateline'] = gmdate("{$dateformat} {$timeformat}", $data['dateline'] + $_DCACHE['settings']['timeoffset'] * 3600);
            $datalist[$key]['fname'] = isset($_DCACHE['forums'][$data['fid']]['name']) ? str_replace('\\\'', '&#39;', addslashes($_DCACHE['forums'][$data['fid']]['name'])) : NULL;
            $datalist[$key]['description'] = $data['description'] ? str_replace('\\\'', '&#39;', addslashes($data['description'])) : NULL;
        }
        $writedata = '';
        if (is_array($datalist)) {
            $imgsize = ($maxwidth ? " width='{$maxwidth}'" : NULL) . ($maxheight ? " height='{$maxheight}'" : NULL);
            $requesttemplate = !$requesttemplate ? '{file} ({filesize} Bytes)<br />' : $requesttemplate;
            $order = 1;
            foreach ($datalist as $value) {
                $replace['{link}'] = $value['threadlink'];
                $replace['{imgfile}'] = $value['imgfile'];
                $replace['{url}'] = $value['file'];
                $replace['{subject}'] = $value['subject'];
                $replace['{filesubject}'] = $value['filename'];
                $replace['{filedesc}'] = $value['description'];
                $replace['{author}'] = $value['author'];
                $replace['{dateline}'] = $value['dateline'];
                $replace['{downloads}'] = $value['downloads'];
                $replace['{filesize}'] = $value['filesize'];
                $replace['{file}'] = "<a href='{$value['file']}'{$LinkTarget}>{$value['filename']}</a>";
                $replace['{image}'] = "<a href='{$value['threadlink']}'{$LinkTarget}><img{$imgsize} src='{$value['imgfile']}' border='0'></a>";
                $replace['{order}'] = $order++;
                $writedata .= nodereplace($replace, $requesttemplate);
            }
        }
    } elseif ($function == 'module') {
        $requestrun = TRUE;
        $settings = unserialize(get_magic_quotes_gpc() ? stripslashes($requestdata['settings']) : $requestdata['settings']);
        if (@(!(include DISCUZ_ROOT . './include/request/' . $requestdata['module']))) {
            return;
        }
    } else {
        return;
    }
    $data = parsenode($writedata, $requesttemplatebody);
    if ($rewritestatus) {
        $searcharray = $replacearray = array();
        if ($GLOBALS['rewritestatus'] & 1) {
            $searcharray[] = "/\\<a href\\=\\'" . preg_quote($boardurl, '/') . "forumdisplay\\.php\\?fid\\=(\\d+)\\'/";
            $replacearray[] = "<a href='{$boardurl}forum-\\1-1.html'";
        }
        if ($GLOBALS['rewritestatus'] & 2) {
            $searcharray[] = "/\\<a href\\=\\'" . preg_quote($boardurl, '/') . "viewthread\\.php\\?tid\\=(\\d+)\\'/";
            $replacearray[] = "<a href='{$boardurl}thread-\\1-1-1.html'";
        }
        if ($GLOBALS['rewritestatus'] & 4) {
            $searcharray[] = "/\\<a href\\=\\'" . preg_quote($boardurl, '/') . "space\\.php\\?uid\\=(\\d+)\\'/";
            $searcharray[] = "/\\<a href\\=\\'" . preg_quote($boardurl, '/') . "space\\.php\\?username\\=([^&]+?)\\'/";
            $replacearray[] = "<a href='{$boardurl}space-uid-\\1.html'";
            $replacearray[] = "<a href='{$boardurl}space-username-\\1.html'";
        }
        $data = preg_replace($searcharray, $replacearray, $data);
    }
    return $data;
}
Example #8
0
		$buddynum = uc_friend_totalnum($discuz_uid, $friendtype);
		$buddies = $buddynum ? uc_friend_ls($discuz_uid, $page, $tpp, $buddynum, $friendtype) : array();
		$multipage = multi($buddynum, $tpp, $page, "my.php?item=buddylist$extratype");

		if($buddies) {
			foreach($buddies as $key => $buddy) {
				$buddylist[$buddy['friendid']] = $buddy;
			}
			unset($buddies);
			$query = $db->query("SELECT m.uid, m.gender, mf.msn, s.uid AS online FROM {$tablepre}members m
				LEFT JOIN {$tablepre}sessions s ON s.uid=m.uid
				LEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid
				WHERE m.uid IN (".implodeids(array_keys($buddylist)).")");
			while($member = $db->fetch_array($query)) {
				if(isset($buddylist[$member['uid']])) {
					$buddylist[$member['uid']]['avatar'] = discuz_uc_avatar($member['uid'], 'small');
					$buddylist[$member['uid']]['gender'] = $member['gender'];
					$buddylist[$member['uid']]['online'] = $member['online'];
					$buddylist[$member['uid']]['msn'] = explode("\t", $member['msn']);
				} else {
					unset($buddylist[$member['uid']]);
				}
			}
		}

	} else {

		$buddyarray = uc_friend_ls($discuz_uid, 1, $buddynum, $buddynum);

		if($action == 'edit') {
Example #9
0
$debate['negapoint'] = discuzcode($debate['negapoint'], 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
if ($debate['affirmvotes'] || $debate['negavotes']) {
    if ($debate['affirmvotes'] && $debate['affirmvotes'] > $debate['negavotes']) {
        $debate['affirmvoteswidth'] = 100;
        $debate['negavoteswidth'] = intval($debate['negavotes'] / $debate['affirmvotes'] * 100);
    } elseif ($debate['negavotes'] && $debate['negavotes'] > $debate['affirmvotes']) {
        $debate['negavoteswidth'] = 100;
        $debate['affirmvoteswidth'] = intval($debate['affirmvotes'] / $debate['negavotes'] * 100);
    } else {
        $debate['affirmvoteswidth'] = $debate['negavoteswidth'] = 100;
    }
} else {
    $debate['negavoteswidth'] = $debate['affirmvoteswidth'] = 0;
}
if ($debate['umpirepoint']) {
    $debate['umpirepoint'] = discuzcode($debate['umpirepoint'], 0, 0, 0, 1, 1, 1, 0, 0, 0, 0);
}
$debate['umpireurl'] = rawurlencode($debate['umpire']);
list($debate['bestdebater'], $debate['bestdebateruid'], $debate['bestdebaterstand'], $debate['bestdebatervoters'], $debate['bestdebaterreplies']) = explode("\t", $debate['bestdebater']);
$debate['bestdebaterurl'] = rawurlencode($debate['bestdebater']);
$query = $sdb->query("SELECT author, authorid FROM {$tablepre}posts p LEFT JOIN {$tablepre}debateposts dp ON p.pid=dp.pid WHERE p.tid='{$tid}' AND p.invisible='0' AND dp.stand='1' GROUP BY dp.uid ORDER BY p.dateline DESC LIMIT 5");
while ($affirmavatar = $sdb->fetch_array($query)) {
    $debate['affirmavatars'] .= '<a title="' . $affirmavatar['author'] . '" target="_blank" href="space.php?uid=' . $affirmavatar['authorid'] . '">' . discuz_uc_avatar($affirmavatar['authorid'], 'small') . '</a>';
}
$query = $sdb->query("SELECT author, authorid FROM {$tablepre}posts p LEFT JOIN {$tablepre}debateposts dp ON p.pid=dp.pid WHERE p.tid='{$tid}' AND p.invisible='0' AND dp.stand='2' GROUP BY dp.uid ORDER BY p.dateline DESC LIMIT 5");
while ($negaavatar = $sdb->fetch_array($query)) {
    $debate['negaavatars'] .= '<a title="' . $negaavatar['author'] . '" target="_blank" href="space.php?uid=' . $negaavatar['authorid'] . '">' . discuz_uc_avatar($negaavatar['authorid'], 'small') . '</a>';
}
if ($fastpost && $allowpostreply && $thread['closed'] == 0) {
    $firststand = $sdb->result_first("SELECT stand FROM {$tablepre}debateposts WHERE tid='{$tid}' AND uid='{$discuz_uid}' AND stand<>'0' ORDER BY dateline LIMIT 1");
}
Example #10
0
<?php

/*
	[Discuz!] (C)2001-2009 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$Id: assistant.inc.php 19591 2009-09-07 04:49:41Z monkey $
*/
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if ($requestrun) {
    $nocache = 1;
    $avatar = discuz_uc_avatar($GLOBALS['discuz_uid'], 'small');
    $fidadd = isset($_GET['fid']) ? '&srchfid=' . $_GET['fid'] : '';
    @(include DISCUZ_ROOT . './forumdata/cache/cache_usergroups.php');
    if ($_DCACHE['usergroups'][$GLOBALS['groupid']]['type'] == 'member' && $_DCACHE['usergroups'][$GLOBALS['groupid']]['creditslower'] != 999999999) {
        $creditupgrade = $_DCACHE['usergroups'][$GLOBALS['groupid']]['creditslower'] - $GLOBALS['credits'];
    } else {
        $creditupgrade = '';
    }
    include template('request_assistant');
} else {
    $request_version = '1.0';
    $request_name = $requestlang['assistant_name'];
    $request_description = $requestlang['assistant_desc'];
    $request_copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>';
    $request_settings = array();
}
Example #11
0
    ?>
&amp;tid=<?php 
    echo $tid;
    ?>
&amp;extra=<?php 
    echo $extra;
    ?>
&amp;replysubmit=yes&amp;infloat=yes&amp;handlekey=fastpost" onSubmit="return fastpostvalidate(this)">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="postauthor">
<?php 
    if ($discuz_uid) {
        ?>
<div class="avatar"><?php 
        echo discuz_uc_avatar($discuz_uid);
        ?>
</div><?php 
    }
    ?>
</td>
<td class="postcontent">
<input type="hidden" name="formhash" value="<?php 
    echo FORMHASH;
    ?>
" />
<input type="hidden" name="subject" value="" />
<input type="hidden" name="usesig" value="<?php 
    echo $usesigcheck;
    ?>
" />
    if (!$member['signature']) {
        ?>
$('signaturemessage').click();<?php 
    }
    if (!$member['bio']) {
        ?>
$('biomessage').click();<?php 
    }
}
?>
return true;
}

function updateavatar() {
$('avatar').src='<?php 
echo discuz_uc_avatar($discuz_uid, 'middle', TRUE);
?>
?random=1'+Math.random();
$('avatarctrl').style.display = 'none';
}

function updatetextarea(id, msg) {
$(id).updated = 0;
$(id).value = msg;
$(id).style.color = '<?php 
echo LIGHTTEXT;
?>
';
$(id).onclick = function(){
this.style.color = '<?php 
echo TABLETEXT;
Example #13
0
 include_once DISCUZ_ROOT . './uc_client/client.php';
 $buddynum = uc_friend_totalnum($discuz_uid);
 if (!submitcheck('buddysubmit', 1)) {
     $buddylist = array();
     $buddies = $buddynum ? uc_friend_ls($discuz_uid, $page, $tpp, $buddynum) : array();
     $multipage = multi($buddynum, $tpp, $page, "my.php?item=buddylist");
     if ($buddies) {
         foreach ($buddies as $key => $buddy) {
             $buddylist[$buddy['friendid']] = $buddy;
         }
         unset($buddies);
         $query = $db->query("SELECT m.uid, m.gender, mf.msn, s.uid AS online FROM {$tablepre}members m \r\n\t\t\t\tLEFT JOIN {$tablepre}sessions s ON s.uid=m.uid\r\n\t\t\t\tLEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid\r\n\t\t\t\tWHERE m.uid IN (" . implodeids(array_keys($buddylist)) . ")");
         while ($member = $db->fetch_array($query)) {
             $uid = $member['uid'];
             if (isset($buddylist[$uid])) {
                 $buddylist[$uid]['avatar'] = discuz_uc_avatar($uid, 'small');
                 $buddylist[$uid]['gender'] = $member['gender'];
                 $buddylist[$uid]['online'] = $member['online'];
                 $buddylist[$uid]['msn'] = explode("\t", $member['msn']);
             } else {
                 unset($buddylist[$uid]);
             }
         }
     }
 } else {
     $buddyarray = $buddynum ? uc_friend_ls($discuz_uid, 1, $buddynum, $buddynum) : array();
     if ($action == 'edit') {
         if ($comment = cutstr(dhtmlspecialchars($comment), 255)) {
             $friendid = intval($friendid);
             uc_friend_delete($discuz_uid, array($friendid));
             uc_friend_add($discuz_uid, $friendid, $comment);
Example #14
0
/*
	[Discuz!] (C)2001-2009 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$Id: modlist.inc.php 16697 2008-11-14 07:36:51Z monkey $
*/
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if ($requestrun) {
    $modlist = array();
    if ($GLOBALS['forum']['moderators']) {
        $moderators = daddslashes(explode("\t", $GLOBALS['forum']['moderators']), 1);
        if ($GLOBALS['modworkstatus']) {
            $query = $db->query("SELECT m.uid, m.username, sum(mw.count) as actioncount FROM {$tablepre}members m LEFT JOIN {$tablepre}modworks mw on m.uid=mw.uid WHERE m.username in (" . implodeids($moderators) . ") GROUP BY mw.uid ORDER BY actioncount DESC");
        } else {
            $query = $db->query("SELECT m.uid, m.username, m.posts FROM {$tablepre}members m WHERE m.username in (" . implodeids($moderators) . ") ORDER BY posts DESC");
        }
        while ($modrow = $db->fetch_array($query)) {
            $modrow['avatar'] = discuz_uc_avatar($modrow['uid'], 'small');
            $modrow['actioncount'] = intval($modrow['actioncount']);
            $modlist[] = $modrow;
        }
    }
    include template('request_modlist');
} else {
    $request_version = '1.0';
    $request_name = $requestlang['modlist_name'];
    $request_description = $requestlang['modlist_desc'];
    $request_copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>';
}
</div>
<p><input type="text" name="answer" id="answer" style="display:none" autocomplete="off" size="36" class="txt" tabindex="1" /></p>
</div>
<div class="logininfo multinfo">
<?php 
    if ($discuz_uid) {
        ?>
<h4><?php 
        echo $discuz_userss;
        ?>
, <a href="javascript:;" onclick="ajaxget('float_register.php?action=logout&formhash=<?php 
        echo FORMHASH;
        ?>
', 'returnmessage', 'returnmessage');doane(event);">退出</a></h4>
<p><?php 
        echo discuz_uc_avatar($discuz_uid, 'small');
        ?>
</p>
<?php 
    } else {
        ?>
<h4>没有帐号?<a href="<?php 
        echo $regname;
        ?>
" onclick="floatwin('close_login');floatwin('open_register', this.href, 600, 400, '600,0');return false;" title="注册帐号"><?php 
        echo $reglinkname;
        ?>
</a></h4>
<p>忘记密码, <a href="javascript:;" onclick="display('loginform');display('loginfield_selectinput');<?php 
        if ($secqaacheck || $seccodecheck) {
            ?>
Example #16
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: thread_reward.php 9199 2010-04-27 09:10:37Z liulanbo $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$bapid = 0;
$rewardprice = abs($_G['forum_thread']['price']);
$dateline = $_G['forum_thread']['dateline'] + 1;
$bestpost = array();
if ($_G['forum_thread']['price'] < 0 && $page == 1) {
    foreach ($postlist as $key => $post) {
        if ($post['dbdateline'] == $dateline) {
            $bapid = $key;
            break;
        }
    }
}
if ($bapid) {
    $bestpost = DB::fetch_first("SELECT p.* FROM " . DB::table($posttable) . " p WHERE p.pid='{$bapid}'");
    $bestpost['message'] = messagecutstr($bestpost['message'], 400);
    $bestpost['avatar'] = discuz_uc_avatar($bestpost['authorid'], 'small');
}
Example #17
0
        $debate['negavoteswidth'] = $debate['negavoteswidth'] > 0 ? $debate['negavoteswidth'] : 5;
    } elseif ($debate['negavotes'] && $debate['negavotes'] > $debate['affirmvotes']) {
        $debate['negavoteswidth'] = 100;
        $debate['affirmvoteswidth'] = intval($debate['affirmvotes'] / $debate['negavotes'] * 100);
        $debate['affirmvoteswidth'] = $debate['affirmvoteswidth'] > 0 ? $debate['affirmvoteswidth'] : 5;
    } else {
        $debate['affirmvoteswidth'] = $debate['negavoteswidth'] = 100;
    }
} else {
    $debate['negavoteswidth'] = $debate['affirmvoteswidth'] = 5;
}
if ($debate['umpirepoint']) {
    $debate['umpirepoint'] = discuzcode($debate['umpirepoint'], 0, 0, 0, 1, 1, 1, 0, 0, 0, 0);
}
$debate['umpireurl'] = rawurlencode($debate['umpire']);
list($debate['bestdebater'], $debate['bestdebateruid'], $debate['bestdebaterstand'], $debate['bestdebatervoters'], $debate['bestdebaterreplies']) = explode("\t", $debate['bestdebater']);
$debate['bestdebaterurl'] = rawurlencode($debate['bestdebater']);
$posttable = getposttablebytid($_G['tid']);
$query = $sdb->query("SELECT author, authorid FROM " . DB::table($posttable) . " p LEFT JOIN " . DB::table('forum_debatepost') . " dp ON p.pid=dp.pid WHERE p.tid='{$_G['tid']}' AND p.invisible='0' AND dp.stand='1' GROUP BY dp.uid ORDER BY p.dateline DESC LIMIT 8");
while ($affirmavatar = $sdb->fetch_array($query)) {
    $affirmavatar['avatar'] = discuz_uc_avatar($affirmavatar['authorid'], 'small');
    $debate['affirmavatars'][] = $affirmavatar;
}
$query = $sdb->query("SELECT author, authorid FROM " . DB::table($posttable) . " p LEFT JOIN " . DB::table('forum_debatepost') . " dp ON p.pid=dp.pid WHERE p.tid='{$_G['tid']}' AND p.invisible='0' AND dp.stand='2' GROUP BY dp.uid ORDER BY p.dateline DESC LIMIT 8");
while ($negaavatar = $sdb->fetch_array($query)) {
    $negaavatar['avatar'] = discuz_uc_avatar($negaavatar['authorid'], 'small');
    $debate['negaavatars'][] = $negaavatar;
}
if ($_G['setting']['fastpost'] && $allowpostreply && $_G['forum_thread']['closed'] == 0) {
    $firststand = $sdb->result_first("SELECT stand FROM " . DB::table('forum_debatepost') . " WHERE tid='{$_G['tid']}' AND uid='{$_G['uid']}' AND stand<>'0' ORDER BY dateline LIMIT 1");
}
Example #18
0
    $extra = !empty($_G['gp_extra']) ? rawurlencode($_G['gp_extra']) : '';
    $seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
    $secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
    include template('forum/comment');
} elseif ($_G['gp_action'] == 'commentmore') {
    if (!$_G['setting']['commentnumber'] || !$_G['inajax']) {
        showmessage('undefined_action', NULL);
    }
    require_once libfile('function/discuzcode');
    $commentlimit = intval($_G['setting']['commentnumber']);
    $page = max(1, $_G['page']);
    $start_limit = ($page - 1) * $commentlimit;
    $comments = array();
    $query = DB::query('SELECT * FROM ' . DB::table('forum_postcomment') . " WHERE pid='{$_G['gp_pid']}' AND authorid>'0' ORDER BY dateline DESC LIMIT {$start_limit}, {$commentlimit}");
    while ($comment = DB::fetch($query)) {
        $comment['avatar'] = discuz_uc_avatar($comment['authorid'], 'small');
        $comment['dateline'] = dgmdate($comment['dateline'], 'u');
        $comments[] = str_replace(array('[b]', '[/b]', '[/color]'), array('<b>', '</b>', '</font>'), preg_replace("/\\[color=([#\\w]+?)\\]/i", "<font color=\"\\1\">", $comment));
    }
    $totalcomment = DB::result_first('SELECT comment FROM ' . DB::table('forum_postcomment') . " WHERE pid='{$_G['gp_pid']}' AND authorid='0'");
    $totalcomment = preg_replace('/<i>([\\.\\d]+)<\\/i>/e', "'<i class=\"cmstarv\" style=\"background-position:20px -'.(intval(\\1) * 16).'px\">'.sprintf('%1.1f', \\1).'</i>'.(\$cic++ % 2 ? '<br />' : '');", $totalcomment);
    $count = DB::result_first('SELECT count(*) FROM ' . DB::table('forum_postcomment') . " WHERE pid='{$_G['gp_pid']}' AND authorid>'0'");
    $multi = multi($count, $commentlimit, $page, "forum.php?mod=misc&action=commentmore&tid={$_G['tid']}&pid={$_G['gp_pid']}");
    include template('forum/comment_more');
} else {
    if (empty($_G['forum']['allowview'])) {
        if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) {
            showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
        } elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) {
            showmessage('forum_nopermission', NULL, array($_G['group']['grouptitle']), array('login' => 1));
        }
Example #19
0
     $styleselect .= "<option value=\"{$style['styleid']}\" " . ($style['styleid'] == $member['styleid'] ? 'selected="selected"' : '') . ">{$style['name']}</option>\n";
 }
 $styleselect .= '</select>';
 $tfcheck = array($member['timeformat'] => 'checked');
 $gendercheck = array($member['gender'] => 'checked');
 $pscheck = array($member['pmsound'] => 'checked');
 $member['regdate'] = gmdate('Y-n-j h:i A', $member['regdate'] + $timeoffset * 3600);
 $member['lastvisit'] = gmdate('Y-n-j h:i A', $member['lastvisit'] + $timeoffset * 3600);
 $member['bio'] = html2bbcode($member['bio']);
 $member['signature'] = html2bbcode($member['sightml']);
 shownav('user', 'members_edit');
 showsubmenu("{$lang['members_edit']} - {$member['username']}");
 showformheader("members&operation=edit&uid={$uid}");
 showtableheader();
 showsetting('members_edit_username', '', '', ' ' . $member['username']);
 showsetting('members_edit_avatar', '', '', ' ' . discuz_uc_avatar($uid) . '<br /><br /><input name="clearavatar" class="checkbox" type="checkbox" value="1" /> ' . $lang['members_edit_avatar_clear']);
 showsetting('members_edit_password', 'passwordnew', '', 'text');
 showsetting('members_edit_clearquestion', 'clearquestion', !$member['secques'], 'radio');
 showsetting('members_edit_nickname', 'nicknamenew', $member['nickname'], 'text');
 showsetting('members_edit_gender', '', '', '<input class="radio" type="radio" name="gendernew" value="1" ' . $gendercheck[1] . '> ' . $lang['members_edit_gender_male'] . ' <input class="radio" type="radio" name="gendernew" value="2" ' . $gendercheck[2] . '> ' . $lang['members_edit_gender_female'] . ' <input class="radio" type="radio" name="gendernew" value="0" ' . $gendercheck[0] . '> ' . $lang['members_edit_gender_secret']);
 showsetting('members_edit_email', 'emailnew', $member['email'], 'text');
 showsetting('members_edit_posts', 'postsnew', $member['posts'], 'text');
 showsetting('members_edit_digestposts', 'digestpostsnew', $member['digestposts'], 'text');
 showsetting('members_edit_pageviews', 'pageviewsnew', $member['pageviews'], 'text');
 showsetting('members_edit_online_total', 'totalnew', $member['total'], 'text');
 showsetting('members_edit_online_thismonth', 'thismonthnew', $member['thismonth'], 'text');
 showsetting('members_edit_regip', 'regipnew', $member['regip'], 'text');
 showsetting('members_edit_regdate', 'regdatenew', $member['regdate'], 'text');
 showsetting('members_edit_lastvisit', 'lastvisitnew', $member['lastvisit'], 'text');
 showsetting('members_edit_lastip', 'lastipnew', $member['lastip'], 'text');
 showtitle('members_edit_info');
Example #20
0
function viewthread_procpost($post, $special = 0)
{
    global $_DCACHE, $newpostanchor, $numpost, $thisbg, $postcount, $ratelogpids, $onlineauthors, $lastvisit, $thread, $attachpids, $attachtags, $forum, $dateformat, $timeformat, $timeoffset, $userstatusby, $allowgetattach, $ratelogrecord, $showimages, $forum, $discuz_uid, $showavatars, $pagebydesc, $ppp, $ppp2, $ppp3, $firstpid, $videoopen, $threadpay, $sigviewcond;
    if (!$newpostanchor && $post['dateline'] > $lastvisit) {
        $post['newpostanchor'] = '<a name="newpost"></a>';
        $newpostanchor = 1;
    } else {
        $post['newpostanchor'] = '';
    }
    $post['lastpostanchor'] = $numpost == $thread['replies'] ? '<a name="lastpost"></a>' : '';
    if ($pagebydesc) {
        $post['number'] = $numpost + $ppp2--;
        $post['count'] = $ppp == $ppp3 ? $ppp - $postcount - 1 : $ppp3 - $postcount - 1;
    } else {
        $post['number'] = ++$numpost;
        $post['count'] = $postcount;
    }
    $postcount++;
    $post['dbdateline'] = $post['dateline'];
    $post['dateline'] = dgmdate("{$dateformat} {$timeformat}", $post['dateline'] + $timeoffset * 3600);
    $post['groupid'] = $_DCACHE['usergroups'][$post['groupid']] ? $post['groupid'] : 7;
    if ($post['username']) {
        $onlineauthors[] = $post['authorid'];
        $post['usernameenc'] = rawurlencode($post['username']);
        !$special && ($post['groupid'] = getgroupid($post['authorid'], $_DCACHE['usergroups'][$post['groupid']], $post));
        $post['readaccess'] = $_DCACHE['usergroups'][$post['groupid']]['readaccess'];
        if ($_DCACHE['usergroups'][$post['groupid']]['userstatusby'] == 1) {
            $post['authortitle'] = $_DCACHE['usergroups'][$post['groupid']]['grouptitle'];
            $post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars'];
        } elseif ($_DCACHE['usergroups'][$post['groupid']]['userstatusby'] == 2) {
            foreach ($_DCACHE['ranks'] as $rank) {
                if ($post['posts'] > $rank['postshigher']) {
                    $post['authortitle'] = $rank['ranktitle'];
                    $post['stars'] = $rank['stars'];
                    break;
                }
            }
        }
        $post['taobaoas'] = addslashes($post['taobao']);
        $post['authoras'] = !$post['anonymous'] ? ' ' . addslashes($post['author']) : '';
        $post['regdate'] = gmdate($dateformat, $post['regdate'] + $timeoffset * 3600);
        $post['lastdate'] = gmdate($dateformat, $post['lastactivity'] + $timeoffset * 3600);
        if ($post['medals']) {
            @(include_once DISCUZ_ROOT . './forumdata/cache/cache_medals.php');
            foreach ($post['medals'] = explode("\t", $post['medals']) as $key => $medalid) {
                list($medalid, $medalexpiration) = explode("|", $medalid);
                if (isset($_DCACHE['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > $timestamp)) {
                    $post['medals'][$key] = $_DCACHE['medals'][$medalid];
                } else {
                    unset($post['medals'][$key]);
                }
            }
        }
        if ($showavatars) {
            $post['avatar'] = discuz_uc_avatar($post['authorid']);
            if ($_DCACHE['usergroups'][$post['groupid']]['groupavatar']) {
                $post['avatar'] .= '<br /><img src="' . $_DCACHE['usergroups'][$post['groupid']]['groupavatar'] . '" border="0" alt="" />';
            }
        } else {
            $post['avatar'] = '';
        }
        $post['status'] = sprintf('%b', $post['status']);
        $post['banned'] = substr($post['status'], -1, 1);
        $post['warned'] = substr($post['status'], -2, 1);
        $post['msn'] = explode("\t", $post['msn']);
    } else {
        if (!$post['authorid']) {
            $post['useip'] = substr($post['useip'], 0, strrpos($post['useip'], '.')) . '.x';
        }
    }
    $post['attachments'] = array();
    if ($post['attachment']) {
        if ($allowgetattach && !$threadpay) {
            $attachpids .= ",{$post['pid']}";
            $post['attachment'] = 0;
            if (preg_match_all("/\\[attach\\](\\d+)\\[\\/attach\\]/i", $post['message'], $matchaids)) {
                $attachtags[$post['pid']] = $matchaids[1];
            }
        } else {
            $post['message'] = preg_replace("/\\[attach\\](\\d+)\\[\\/attach\\]/i", '', $post['message']);
        }
    }
    $ratelogpids .= $ratelogrecord && $post['rate'] ? ',' . $post['pid'] : '';
    $forum['allowbbcode'] = $forum['allowbbcode'] ? $_DCACHE['usergroups'][$post['groupid']]['allowcusbbcode'] ? 2 : 1 : 0;
    $post['signature'] = $post['usesig'] ? $sigviewcond ? strlen($post['message']) > $sigviewcond ? $post['signature'] : '' : $post['signature'] : '';
    $post['message'] = discuzcode($post['message'], $post['smileyoff'], $post['bbcodeoff'], $post['htmlon'] & 1, $forum['allowsmilies'], $forum['allowbbcode'], $forum['allowimgcode'] && $showimages ? 1 : 0, $forum['allowhtml'], $forum['jammer'] && $post['authorid'] != $discuz_uid ? 1 : 0, 0, $post['authorid'], $forum['allowmediacode'], $post['pid']);
    $videoopen && ($post['message'] = videocode($post['message'], $post['tid'], $post['pid']));
    $post['first'] && ($firstpid = $post['pid']);
    $firstpid = intval($firstpid);
    return $post;
}
    echo $member['uid'];
    ?>
" target="_blank"><img src="images/rank/buyer/<?php 
    echo $member['buyerrank'];
    ?>
.gif" border="0" class="absmiddle"></a>
</p>
<?php 
}
?>
</div>
</div>
<div class="side">
<div class="profile_side">
<div class="avatar"><?php 
echo discuz_uc_avatar($member['uid']);
?>
</div>
<ul id="profile_act">
<li class="pm"><a href="pm.php?action=new&amp;uid=<?php 
echo $member['uid'];
?>
" onclick="floatwin('open_sendpm', this.href, 600, 410);return false;">发短消息</a></li>
<li class="buddy"><a href="my.php?item=buddylist&amp;newbuddyid=<?php 
echo $member['uid'];
?>
&amp;buddysubmit=yes" id="ajax_buddy" onclick="ajaxmenu(event, this.id, 3000, 0)">加为好友</a></li>
<?php 
if ($discuz_uid && $magicstatus) {
    ?>
<li class="magic"><a href="magic.php?action=index&amp;username=<?php 
Example #22
0
         $todate = date('j');
         $toyear = date('Y');
         if ($homeshow['Five_Date'] == 1) {
             $time = mktime(0, 0, 0, $tomonth, $todate, $toyear);
         } elseif ($homeshow['Five_Date'] == 2) {
             $time = mktime(0, 0, 0, $tomonth, $todate, $toyear) - 604800;
         } elseif ($homeshow['Five_Date'] == 3) {
             $time = mktime(0, 0, 0, $tomonth, 1, $toyear);
         } elseif ($homeshow['Five_Date'] == 4) {
             $time = mktime(0, 0, 0, 1, 1, $toyear);
         } else {
             $time = 0;
         }
         $query = $db->query("select count(pid) as num, authorid, author from {$tablepre}posts where dateline >= {$time} group by authorid order by num desc limit 0, 15");
         while ($result = $db->fetch_array($query)) {
             $result['avatar'] = discuz_uc_avatar($result['authorid'], small);
             $result['autitl'] = $result['author'];
             $result['author'] = cutstr($result['author'], $homeshow['AuNums']);
             $poststar[] = $result;
         }
         $cacheArray .= "\$poststar = " . arrayeval($poststar) . ";\n";
     }
     unset($query, $poststar);
     writetocache('homeshow', '', $cacheArray);
     unset($cacheArray);
 }
 require_once $cacheFile;
 if (@$pic) {
     PHP_VERSION > 4.3 ? shuffle($pic) : '';
     $i = 0;
     foreach ($pic as $key => $val) {