Пример #1
0
/** This function gets the players data out of the game and login
 *  database.
 */
function profile_change($db_login)
{
    global $params;
    // proccess form data
    $message = profile_update($db_login);
    // update player's data
    page_refreshUserData();
    // show new data
    return profile_show($db_login, $message);
}
Пример #2
0
 $activity['expiration'] = $activity['expiration'] ? dgmdate($activity['expiration'], 'dt') : 0;
 $activity['message'] = trim(preg_replace('/\\[.+?\\]/', '', $activity['message']));
 $applynumbers = C::t('forum_activityapply')->fetch_count_for_thread($_G['tid']);
 $applylist = array();
 $query = C::t('forum_activityapply')->fetch_all_for_thread($_G['tid'], 0, 2000, 0, 1);
 foreach ($query as $apply) {
     $apply = str_replace(',', '£¬', $apply);
     $apply['dateline'] = dgmdate($apply['dateline'], 'dt');
     $apply['ufielddata'] = !empty($apply['ufielddata']) ? dunserialize($apply['ufielddata']) : '';
     $ufielddata = '';
     if ($apply['ufielddata'] && $activity['ufield']) {
         if ($apply['ufielddata']['userfield'] && $activity['ufield']['userfield']) {
             require_once libfile('function/profile');
             loadcache('profilesetting');
             foreach ($activity['ufield']['userfield'] as $fieldid) {
                 $data = profile_show($fieldid, $apply['ufielddata']['userfield']);
                 if (strlen($data) > 11 && is_numeric($data)) {
                     $data = '[' . $data . ']';
                 }
                 $ufielddata .= ',' . strip_tags(str_replace(' ', ' ', $data));
             }
         }
         if ($activity['ufield']['extfield']) {
             foreach ($activity['ufield']['extfield'] as $extname) {
                 if (strlen($apply['ufielddata']['extfield'][$extname]) > 11 && is_numeric($apply['ufielddata']['extfield'][$extname])) {
                     $apply['ufielddata']['extfield'][$extname] = '[' . $apply['ufielddata']['extfield'][$extname] . ']';
                 }
                 $ufielddata .= ',' . strip_tags(str_replace(' ', ' ', $apply['ufielddata']['extfield'][$extname]));
             }
         }
     }
Пример #3
0
function viewthread_baseinfo($post, $extra)
{
    global $_G;
    list($key, $type) = $extra;
    $v = '';
    if (substr($key, 0, 10) == 'extcredits') {
        $i = substr($key, 10);
        $extcredit = $_G['setting']['extcredits'][$i];
        if ($extcredit) {
            $v = $type ? ($extcredit['img'] ? $extcredit['img'] . ' ' : '') . $extcredit['title'] : $post['extcredits' . $i] . ' ' . $extcredit['unit'];
        }
    } elseif (substr($key, 0, 6) == 'field_') {
        $field = substr($key, 6);
        if (!empty($post['privacy']['profile'][$field])) {
            return '';
        }
        require_once libfile('function/profile');
        if ($field != 'qq') {
            $v = profile_show($field, $post);
        } elseif (!empty($post['qq'])) {
            $v = '<a href="http://wpa.qq.com/msgrd?V=3&Uin=' . $post['qq'] . '&Site=' . $_G['setting']['bbname'] . '&Menu=yes&from=discuz" target="_blank" title="' . lang('spacecp', 'qq_dialog') . '"><img src="' . STATICURL . '/image/common/qq_big.gif" alt="QQ" style="margin:0px;"/></a>';
        }
        if ($v) {
            if (!isset($_G['cache']['profilesetting'])) {
                loadcache('profilesetting');
            }
            $v = $type ? $_G['cache']['profilesetting'][$field]['title'] : $v;
        }
    } elseif ($key == 'eccredit_seller') {
        $v = $type ? lang('space', 'viewthread_userinfo_sellercredit') : '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=trade&view=eccredit#buyercredit" target="_blank" class="vm"><img src="' . STATICURL . 'image/traderank/seller/' . countlevel($post['buyercredit']) . '.gif" /></a>';
    } elseif ($key == 'eccredit_buyer') {
        $v = $type ? lang('space', 'viewthread_userinfo_buyercredit') : '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=trade&view=eccredit#sellercredit" target="_blank" class="vm"><img src="' . STATICURL . 'image/traderank/seller/' . countlevel($post['sellercredit']) . '.gif" /></a>';
    } else {
        $v = getLinkByKey($key, $post);
        if ($v !== '') {
            $v = $type ? lang('space', 'viewthread_userinfo_' . $key) : $v;
        }
    }
    return $v;
}
Пример #4
0
     $allmemberprofile = C::t('common_member_profile')->fetch_all($uids, false, 0);
     foreach ($allvalidate as $uid => $member) {
         $member = array_merge((array) $member, (array) $allmember[$uid], (array) $allmemberstatus[$uid], (array) $allmemberprofile[$uid]);
         if ($member['groupid'] != 8) {
             $vuids[$uid] = $uid;
             continue;
         }
         $fields = !empty($member['field']) ? dunserialize($member['field']) : array();
         $str = '';
         foreach ($_G['cache']['fields_register'] as $field) {
             if (!$field['available'] || in_array($field['fieldid'], array('uid', 'constellation', 'zodiac', 'birthmonth', 'birthyear', 'birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
                 continue;
             }
             $member[$field['fieldid']] = !empty($member[$field['fieldid']]) ? $member[$field['fieldid']] : $fields[$field['fieldid']];
             if ($member[$field['fieldid']]) {
                 $fieldstr = profile_show($field['fieldid'], $member);
                 $str .= $field['title'] . ':' . $fieldstr . "<br/>";
             }
         }
         $str = !empty($str) ? '<br/>' . $str : '';
         $member['regdate'] = dgmdate($member['regdate']);
         $member['submitdate'] = dgmdate($member['submitdate']);
         $member['moddate'] = $member['moddate'] ? dgmdate($member['moddate']) : $lang['none'];
         $member['admin'] = $member['admin'] ? "<a href=\"home.php?mod=space&username="******"\" target=\"_blank\">{$member['admin']}</a>" : $lang['none'];
         $members .= "<tr class=\"hover\" id=\"mod_uid_{$member[uid]}\"><td class=\"rowform\" style=\"width:80px;\"><ul class=\"nofloat\"><li><input id=\"mod_uid_{$member[uid]}_1\" class=\"radio\" type=\"radio\" name=\"modtype[{$member['uid']}]\" value=\"invalidate\" onclick=\"set_bg('invalidate', {$member['uid']});\"><label for=\"mod_uid_{$member[uid]}_1\">{$lang['invalidate']}</label></li><li><input id=\"mod_uid_{$member[uid]}_2\" class=\"radio\" type=\"radio\" name=\"modtype[{$member['uid']}]\" value=\"validate\" onclick=\"set_bg('validate', {$member['uid']});\"><label for=\"mod_uid_{$member[uid]}_2\">{$lang['validate']}</label></li>\n" . "<li><input id=\"mod_uid_{$member[uid]}_3\" class=\"radio\" type=\"radio\" name=\"modtype[{$member['uid']}]\" value=\"delete\" onclick=\"set_bg('delete', {$member['uid']});\"><label for=\"mod_uid_{$member[uid]}_3\">{$lang['delete']}</label></li><li><input id=\"mod_uid_{$member[uid]}_4\" class=\"radio\" type=\"radio\" name=\"modtype[{$member['uid']}]\" value=\"ignore\" onclick=\"set_bg('ignore', {$member['uid']});\"><label for=\"mod_uid_{$member[uid]}_4\">{$lang['ignore']}</label></li></ul></td><td><b><a href=\"home.php?mod=space&uid={$member['uid']}\" target=\"_blank\">{$member['username']}</a></b>\n" . "<br />{$lang['members_edit_regdate']} {$member['regdate']}<br />{$lang['members_edit_regip']} {$member['regip']} " . convertip($member['regip']) . "<br />Email: {$member['email']}{$str}</td>\n" . "<td align=\"center\"><textarea rows=\"4\" name=\"userremark[{$member['uid']}]\" style=\"width: 95%; word-break: break-all\">{$member['message']}</textarea></td>\n" . "<td>{$lang['moderate_members_submit_times']}: {$member['submittimes']}<br />{$lang['moderate_members_submit_time']}: {$member['submitdate']}<br />{$lang['moderate_members_admin']}: {$member['admin']}<br />\n" . "{$lang['moderate_members_mod_time']}: {$member['moddate']}</td><td><textarea rows=\"4\" id=\"remark[{$member['uid']}]\" name=\"remark[{$member['uid']}]\" style=\"width: 95%; word-break: break-all\">{$member['remark']}</textarea></td></tr>\n";
     }
     if ($vuids) {
         C::t('common_member_validate')->delete($vuids);
     }
 }
 shownav('user', 'nav_modmembers');
Пример #5
0
}
require_once libfile('function/friend');
$isfriend = friend_check($space['uid'], 1);
loadcache('profilesetting');
include_once libfile('function/profile');
$profiles = array();
$privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
if ($_G['setting']['verify']['enabled']) {
    space_merge($space, 'verify');
}
foreach ($_G['cache']['profilesetting'] as $fieldid => $field) {
    if (!$field['available'] || in_array($fieldid, array('birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
        continue;
    }
    if ($field['available'] && strlen($space[$fieldid]) > 0 && ($field['showinthread'] || $field['showincard'] || ($space['self'] || empty($privacy[$fieldid]) || $isfriend && $privacy[$fieldid] == 1)) && (!$_G['inajax'] && $field['invisible'] != '1' || $_G['inajax'] && $field['showincard'])) {
        $val = profile_show($fieldid, $space);
        if ($val !== false) {
            if ($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) {
                continue;
            }
            if ($field['formtype'] == 'file' && $val) {
                $imgurl = getglobal('setting/attachurl') . './profile/' . $val;
                $val = '<span><a href="' . $imgurl . '" target="_blank"><img src="' . $imgurl . '"  style="max-width: 500px;" /></a></span>';
            }
            if ($val == '') {
                $val = '-';
            }
            $profiles[$fieldid] = array('title' => $field['title'], 'value' => $val);
        }
    }
}
Пример #6
0
 function getdata($style, $parameter)
 {
     global $_G;
     $parameter = $this->cookparameter($parameter);
     $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array();
     $groupid = !empty($parameter['groupid']) && !in_array(0, $parameter['groupid']) ? $parameter['groupid'] : array();
     $startrow = !empty($parameter['startrow']) ? intval($parameter['startrow']) : 0;
     $items = !empty($parameter['items']) ? intval($parameter['items']) : 10;
     $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'], array('credits', 'extcredits', 'threads', 'posts', 'digestposts', 'regdate', 'show', 'blogs', 'albums', 'doings', 'sharings', 'special', 'todayposts')) ? $parameter['orderby'] : '';
     $special = isset($parameter['special']) && strlen($parameter['special']) ? intval($parameter['special']) : null;
     $lastpost = !empty($parameter['lastpost']) ? intval($parameter['lastpost']) : '';
     $avatarstatus = !empty($parameter['avatarstatus']) ? 1 : 0;
     $emailstatus = !empty($parameter['emailstatus']) ? 1 : 0;
     $verifystatus = !empty($parameter['verifystatus']) ? $parameter['verifystatus'] : array();
     $profiles = array();
     $profiles['gender'] = !empty($parameter['gender']) ? intval($parameter['gender']) : 0;
     $profiles['resideprovince'] = !empty($parameter['xresideprovince']) ? $parameter['xresideprovince'] : '';
     $profiles['residecity'] = !empty($parameter['xresidecity']) ? $parameter['xresidecity'] : '';
     $profiles['residedist'] = !empty($parameter['xresidedist']) ? $parameter['xresidedist'] : '';
     $profiles['residecommunity'] = !empty($parameter['xresidecommunity']) ? $parameter['xresidecommunity'] : '';
     $profiles['birthprovince'] = !empty($parameter['xbirthprovince']) ? $parameter['xbirthprovince'] : '';
     $profiles['birthcity'] = !empty($parameter['xbirthcity']) ? $parameter['xbirthcity'] : '';
     $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
     $list = $todayuids = $todayposts = array();
     $tables = $wheres = array();
     $sqlorderby = '';
     $olditems = $items;
     $tables[] = DB::table('common_member') . ' m';
     if ($groupid) {
         $wheres[] = 'm.groupid IN (' . dimplode($groupid) . ')';
     }
     if ($bannedids) {
         $wheres[] = 'm.uid NOT IN (' . dimplode($bannedids) . ')';
     }
     if ($avatarstatus) {
         $wheres[] = "m.avatarstatus='1'";
     }
     if ($emailstatus) {
         $wheres[] = "m.emailstatus='1'";
     }
     if (!empty($verifystatus)) {
         $flag = false;
         foreach ($verifystatus as $value) {
             if (isset($_G['setting']['verify'][$value])) {
                 $flag = true;
                 $wheres[] = "cmv.verify{$value}='1'";
             }
         }
         if ($flag) {
             $tables[] = DB::table('common_member_verify') . ' cmv';
             $wheres[] = 'cmv.uid=m.uid';
         }
     }
     $tables[] = DB::table('common_member_count') . ' mc';
     $wheres[] = 'mc.uid=m.uid';
     foreach ($profiles as $key => $value) {
         if ($value) {
             $tables[] = DB::table('common_member_profile') . ' mp';
             $wheres[] = 'mp.uid=m.uid';
             $wheres[] = "mp.{$key}='{$value}'";
         }
     }
     $reason = $show = '';
     if ($special !== null) {
         $special = in_array($special, array(-1, 0, 1)) ? $special : -1;
         $tables[] = DB::table('home_specialuser') . ' su';
         if ($special != -1) {
             $wheres[] = "su.status='{$special}'";
         }
         $wheres[] = 'su.uid=m.uid';
         $reason = ', su.reason';
     }
     if ($lastpost && $orderby != 'todayposts') {
         $time = TIMESTAMP - $lastpost;
         $tables[] = DB::table('common_member_status') . " ms";
         $wheres[] = "ms.uid=m.uid";
         $wheres[] = "ms.lastpost>'{$time}'";
     }
     switch ($orderby) {
         case 'credits':
         case 'regdate':
             $sqlorderby = " ORDER BY m.{$orderby} DESC";
             break;
         case 'extcredits':
             $extcredits = 'extcredits' . (in_array($parameter['extcredit'], range(1, 8)) ? $parameter['extcredit'] : '1');
             $sqlorderby = " ORDER BY mc.{$extcredits} DESC";
             break;
         case 'threads':
         case 'posts':
         case 'blogs':
         case 'albums':
         case 'doings':
         case 'sharings':
         case 'digestposts':
             $sqlorderby = " ORDER BY mc.{$orderby} DESC";
             break;
         case 'show':
             $show = ', s.unitprice, s.credit as showcredit, s.note as shownote';
             $tables[] = DB::table('home_show') . " s";
             $wheres[] = 's.uid=m.uid';
             $sqlorderby = ' ORDER BY s.unitprice DESC, s.credit DESC';
             break;
         case 'special':
             $sqlorderby = $special !== null ? ' ORDER BY su.displayorder, dateline DESC' : '';
             break;
         case 'todayposts':
             $todaytime = strtotime(dgmdate(TIMESTAMP, 'Ymd'));
             $inuids = $uids ? ' AND uid IN (' . dimplode($uids) . ')' : '';
             $items = $items * 5;
             $query = DB::query('SELECT uid, count(*) as sum FROM ' . DB::table('common_member_action_log') . "\r\n\t\t\t\t\t\tWHERE dateline>={$todaytime} AND action='" . getuseraction('pid') . "'{$inuids} GROUP BY uid ORDER BY sum DESC LIMIT {$items}");
             while ($value = DB::fetch($query)) {
                 $todayposts[$value['uid']] = $value['sum'];
                 $todayuids[] = $value['uid'];
             }
             if (empty($todayuids)) {
                 $todayuids = array(0);
             }
             $uids = $todayuids;
             break;
     }
     if ($uids) {
         $wheres[] = 'm.uid IN (' . dimplode($uids) . ')';
     }
     $wheres[] = '(m.groupid < 4 OR m.groupid > 8)';
     $tables = array_unique($tables);
     $wheres = array_unique($wheres);
     $tablesql = implode(',', $tables);
     $wheresql = implode(' AND ', $wheres);
     $query = DB::query("SELECT m.*, mc.*{$reason}{$show} FROM {$tablesql} WHERE {$wheresql} {$sqlorderby} LIMIT {$startrow},{$items}");
     $resultuids = array();
     while ($data = DB::fetch($query)) {
         $resultuids[] = intval($data['uid']);
         $list[] = array('id' => $data['uid'], 'idtype' => 'uid', 'title' => $data['username'], 'url' => 'home.php?mod=space&uid=' . $data['uid'], 'pic' => '', 'picflag' => 0, 'summary' => '', 'fields' => array('avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']), 'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']), 'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']), 'credits' => $data['credits'], 'extcredits1' => $data['extcredits1'], 'extcredits2' => $data['extcredits2'], 'extcredits3' => $data['extcredits3'], 'extcredits4' => $data['extcredits4'], 'extcredits5' => $data['extcredits5'], 'extcredits6' => $data['extcredits6'], 'extcredits7' => $data['extcredits7'], 'extcredits8' => $data['extcredits8'], 'regdate' => $data['regdate'], 'posts' => empty($todayposts[$data['uid']]) ? $data['posts'] : $todayposts[$data['uid']], 'threads' => $data['threads'], 'digestposts' => $data['digestposts'], 'reason' => isset($data['reason']) ? $data['reason'] : '', 'unitprice' => isset($data['unitprice']) ? $data['unitprice'] : '', 'showcredit' => isset($data['showcredit']) ? $data['showcredit'] : '', 'shownote' => isset($data['shownote']) ? $data['shownote'] : ''));
     }
     if ($resultuids) {
         include_once libfile('function/profile');
         $profiles = array();
         $query = DB::query('SELECT * FROM ' . DB::table('common_member_profile') . " WHERE uid IN (" . dimplode($resultuids) . ")");
         while ($data = DB::fetch($query)) {
             $profile = array();
             foreach ($data as $fieldid => $fieldvalue) {
                 $fieldvalue = profile_show($fieldid, $data);
                 if (false !== $fieldvalue) {
                     $profile[$fieldid] = $fieldvalue;
                 }
             }
             $profiles[$data['uid']] = $profile;
         }
         for ($i = 0, $L = count($list); $i < $L; $i++) {
             $uid = $list[$i]['id'];
             if ($profiles[$uid]) {
                 $list[$i]['fields'] = array_merge($list[$i]['fields'], $profiles[$uid]);
             }
         }
         if (!empty($todayuids)) {
             $datalist = array();
             foreach ($todayuids as $uid) {
                 foreach ($list as $user) {
                     if ($user['id'] == $uid) {
                         $datalist[] = $user;
                         break;
                     }
                 }
                 if (count($datalist) >= $olditems) {
                     break;
                 }
             }
             $list = $datalist;
         }
     }
     return array('html' => '', 'data' => $list);
 }
Пример #7
0
 $verifyusers = C::t('common_member_verify')->fetch_all_by_vid($vid, 1, $uids);
 $verifyuids = array_keys($verifyusers);
 $members = C::t('common_member')->fetch_all($verifyuids, false, 0);
 $profiles = C::t('common_member_profile')->fetch_all($verifyuids, false, 0);
 foreach ($verifyusers as $uid => $value) {
     $value = array_merge($value, $members[$uid], $profiles[$uid]);
     $str = $common = '';
     foreach ($fields as $key => $field) {
         if (in_array($key, array('constellation', 'zodiac', 'birthyear', 'birthmonth', 'birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
             continue;
         }
         if ($showtitle) {
             $title .= $common . ($key == 'username' ? $lang['username'] : $_G['cache']['profilesetting'][$key]['title']);
         }
         if (in_array($key, array('gender', 'birthday', 'birthcity', 'residecity'))) {
             $value[$field] = profile_show($key, $value);
         }
         $str .= $common . $value[$field];
         $common = "\t";
     }
     $verifylist .= $str . "\n";
     $showtitle = false;
 }
 $verifylist = $title . "\n" . $verifylist;
 $filename = date('Ymd', TIMESTAMP) . '.xls';
 define('FOOTERDISABLED', true);
 ob_end_clean();
 header("Content-type:application/vnd.ms-excel");
 header('Content-Encoding: none');
 header('Content-Disposition: attachment; filename=' . $filename);
 header('Pragma: no-cache');
Пример #8
0
 $value['username'] = '******' . $value['uid'] . '&do=profile" target="_blank">' . avatar($value['uid'], "small") . '<br/>' . $value['username'] . '</a>';
 if ($anchor != 'pass') {
     $fields = $anchor != 'pass' ? unserialize($value['field']) : $_G['setting']['verify'][$vid]['field'];
     $verifytype = $value['verifytype'] ? $_G['setting']['verify'][$value['verifytype']]['title'] : $lang['members_verify_profile'];
     $fieldstr = '<table width="96%">';
     $i = 0;
     $fieldstr .= '<tr>' . ($anchor == 'authstr' ? '<td width="26">' . $lang[members_verify_refusal] . '</td>' : '') . '<td width="100">' . $lang['members_verify_fieldid'] . '</td><td>' . $lang['members_verify_newvalue'] . '</td></tr><tbody id="verifyitem_' . $value[vid] . '">';
     $i++;
     foreach ($fields as $key => $field) {
         if (in_array($key, array('constellation', 'zodiac', 'birthyear', 'birthmonth', 'resideprovince', 'birthprovince', 'residedist', 'residecommunity'))) {
             continue;
         }
         if ($_G['cache']['profilesetting'][$key]['formtype'] == 'file') {
             $field = '<a href="' . (getglobal('setting/attachurl') . './profile/' . $field) . '" target="_blank">' . $field . '</a>';
         } elseif (in_array($key, array('gender', 'birthday', 'birthcity', 'residecity'))) {
             $field = profile_show($key, $fields);
         }
         $fieldstr .= '<tr>' . ($anchor == 'authstr' ? '<td><input type="checkbox" name="refusal[' . $value['vid'] . '][' . $key . ']" value="' . $key . '" onclick="$(\'refusal' . $value['vid'] . '\').click();" /></td>' : '') . '<td>' . $_G['cache']['profilesetting'][$key]['title'] . ':</td><td>' . $field . '</td></tr>';
         $i++;
     }
     $opstr = "";
     if ($anchor == 'authstr') {
         $opstr .= "<label><input class=\"radio\" type=\"radio\" name=\"verify[{$value['vid']}]\" value=\"validate\" onclick=\"mod_setbg({$value['vid']}, 'validate');showreason({$value['vid']}, 0);\">{$lang['validate']}</label>&nbsp;<label><input class=\"radio\" type=\"radio\" name=\"verify[{$value['vid']}]\" value=\"refusal\" id=\"refusal{$value['vid']}\" onclick=\"mod_setbg({$value['vid']}, 'refusal');showreason({$value['vid']}, 1);\">{$lang['members_verify_refusal']}</label>";
     } elseif ($anchor == 'refusal') {
         $opstr .= "<label><input class=\"radio\" type=\"radio\" name=\"verify[{$value['vid']}]\" value=\"validate\" onclick=\"mod_setbg({$value['vid']}, 'validate');\">{$lang['validate']}</label>";
     }
     $fieldstr .= "</tbody><tr><td colspan=\"5\">{$opstr} &nbsp;<span id=\"reason_{$value['vid']}\" style=\"display: none;\">{$lang['moderate_reasonpm']}&nbsp; <input type=\"text\" class=\"txt\" name=\"reason[{$value['vid']}]\" style=\"margin: 0px;\"></span>&nbsp;<input type=\"button\" value=\"{$lang['moderate']}\" name=\"singleverifysubmit\" class=\"btn\" onclick=\"singleverify({$value['vid']});\"></td></tr></table>";
     $valuearr = array($value['username'], $verifytype, dgmdate($value['dateline'], 'dt'), $fieldstr);
     showtablerow("id=\"mod_{$value['vid']}_row\" verifyid=\"{$value['vid']}\"", $cssarr, $valuearr);
 } else {
     $fields = $_G['setting']['verify'][$vid]['field'];
Пример #9
0
function viewthread_custominfo($post)
{
    global $_G;
    $types = array('left', 'menu');
    foreach ($types as $type) {
        if (!is_array($_G['cache']['custominfo']['setting'][$type])) {
            continue;
        }
        $data = '';
        foreach ($_G['cache']['custominfo']['setting'][$type] as $key => $order) {
            $v = '';
            if (substr($key, 0, 10) == 'extcredits') {
                $i = substr($key, 10);
                $extcredit = $_G['setting']['extcredits'][$i];
                $v = '<dt>' . ($extcredit['img'] ? $extcredit['img'] . ' ' : '') . $extcredit['title'] . '</dt><dd>' . $post['extcredits' . $i] . ' ' . $extcredit['unit'] . '</dd>';
            } elseif (substr($key, 0, 6) == 'field_') {
                $field = substr($key, 6);
                if (!empty($post['privacy']['profile'][$field])) {
                    continue;
                }
                require_once libfile('function/profile');
                $v = profile_show($field, $post);
                if ($v) {
                    $v = '<dt>' . $_G['cache']['custominfo']['profile'][$key][0] . '</dt><dd title="' . htmlspecialchars(strip_tags($v)) . '">' . $v . '</dd>';
                }
            } else {
                switch ($key) {
                    case 'uid':
                        $v = $post['uid'];
                        break;
                    case 'posts':
                        $v = '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=thread&type=reply&view=me&from=space" target="_blank" class="xi2">' . $post['posts'] . '</a>';
                        break;
                    case 'threads':
                        $v = '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=thread&type=thread&view=me&from=space" target="_blank" class="xi2">' . $post['threads'] . '</a>';
                        break;
                    case 'doings':
                        $v = '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=doing&view=me&from=space" target="_blank" class="xi2">' . $post['doings'] . '</a>';
                        break;
                    case 'blogs':
                        $v = '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=blog&view=me&from=space" target="_blank" class="xi2">' . $post['blogs'] . '</a>';
                        break;
                    case 'albums':
                        $v = '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=album&view=me&from=space" target="_blank" class="xi2">' . $post['albums'] . '</a>';
                        break;
                    case 'sharings':
                        $v = '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=share&view=me&from=space" target="_blank" class="xi2">' . $post['sharings'] . '</a>';
                        break;
                    case 'friends':
                        $v = '<a href="home.php?mod=space&uid=' . $post['uid'] . '&do=friend&view=me&from=space" target="_blank" class="xi2">' . $post['friends'] . '</a>';
                        break;
                    case 'digest':
                        $v = $post['digestposts'];
                        break;
                    case 'credits':
                        $v = $post['credits'];
                        break;
                    case 'readperm':
                        $v = $post['readaccess'];
                        break;
                    case 'regtime':
                        $v = $post['regdate'];
                        break;
                    case 'lastdate':
                        $v = $post['lastdate'];
                        break;
                    case 'oltime':
                        $v = $post['oltime'] . ' ' . lang('space', 'viewthread_userinfo_hour');
                        break;
                }
                if ($v !== '') {
                    $v = '<dt>' . lang('space', 'viewthread_userinfo_' . $key) . '</dt><dd>' . $v . '</dd>';
                }
            }
            $data .= $v;
        }
        $return[$type] = $data;
    }
    return $return;
}
Пример #10
0
function getblockhtml($blockname, $parameters = array())
{
    global $_G, $space;
    $parameters = empty($parameters) ? array() : $parameters;
    $list = array();
    $sql = $title = $html = $wheresql = $ordersql = $titlemore = $do = $contentclassname = '';
    $view = $from = false;
    $contenttagname = 'div';
    $shownum = 6;
    $uid = intval($space['uid']);
    $shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
    switch ($blockname) {
        case 'personalinfo':
            $do = 'profile';
            space_merge($space, 'profile');
            require_once libfile('function/friend');
            $isfriend = friend_check($space['uid']);
            require_once libfile('function/spacecp');
            loadcache('profilesetting');
            include_once libfile('function/profile');
            $profiles = array();
            $privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
            foreach ($_G['cache']['profilesetting'] as $fieldid => $field) {
                if (!$field['available'] || in_array($fieldid, array('birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
                    continue;
                }
                if ($field['available'] && $field['invisible'] != '1' && strlen($space[$fieldid]) > 0 && ($field['showinthread'] || $field['showincard'] || ($space['self'] || empty($privacy[$fieldid]) || $isfriend && $privacy[$fieldid] == 1))) {
                    $val = profile_show($fieldid, $space);
                    if ($val !== false) {
                        if ($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) {
                            continue;
                        }
                        if ($field['formtype'] == 'file' && $val) {
                            $imgurl = getglobal('setting/attachurl') . './profile/' . $val;
                            $val = '<span><a href="' . $imgurl . '" target="_blank"><img src="' . $imgurl . '"  style="max-width: 300px;" /></a></span>';
                        }
                        if ($val == '') {
                            $val = '';
                        }
                        $html .= '<li><em>' . $field['title'] . '</em>' . $val . '</li>';
                    }
                }
            }
            $html = $html ? $html : '<li>' . lang('space', 'block_view_profileinfo_noperm') . '</li>';
            $html = '<ul id="pprl" class="mbm pbm bbda cl">' . $html . $more . '</ul>';
            $more = lang('space', 'block_profile_all', array('uid' => $uid));
            $html = $html . $more;
            $titlemore = $space['self'] ? lang('space', 'block_profile_edit') : '';
            break;
        case 'profile':
            $do = $blockname;
            $managehtml = '';
            $avatar = empty($parameters['banavatar']) ? 'middle' : $parameters['banavatar'];
            $html .= "<div class=\"hm\"><p><a href=\"home.php?mod=space&uid={$uid}\" target=\"_blank\">" . avatar($uid, $avatar) . '</a></p>';
            $space['medals'] = DB::result_first("SELECT medals FROM " . DB::table('common_member_field_forum') . " WHERE uid='{$space['uid']}'");
            $usermedals = $medal_detial = '';
            if ($space['medals']) {
                loadcache('medals');
                foreach ($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) {
                    list($medalid, $medalexpiration) = explode("|", $medalid);
                    if (isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
                        $usermedals .= '<img src="' . STATICURL . 'image/common/' . $_G['cache']['medals'][$medalid]['image'] . '" id="md_' . $medalid . '" alt="' . $_G['cache']['medals'][$medalid]['name'] . '\'" onmouseover="showTip(this)" tip="<h4>' . $_G['cache']['medals'][$medalid]['name'] . '</h4><p>' . $_G['cache']['medals'][$medalid]['description'] . '</p>" />&nbsp;';
                    }
                }
                if ($usermedals) {
                    $usermedals = '<p class="md_ctrl"><a href="home.php?mod=medal">' . $usermedals . '</a></p>';
                }
            }
            $html .= "<h2 class=\"mbn\"><a href=\"home.php?mod=space&uid={$uid}\" target=\"_blank\">" . $space['username'] . "</a></h2>{$usermedals}";
            $html .= '</div><ul class="xl xl2 cl ul_list">';
            $magicinfo = $showmagicgift = false;
            if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
                $showmagicgift = true;
                $magicinfo = !empty($space['magicgift']) ? unserialize($space['magicgift']) : array();
            }
            if ($space['self']) {
                $html .= '<li class="ul_diy"><a href="home.php?mod=space&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
                $html .= '<li class="ul_msg"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
                $html .= '<li class="ul_avt"><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
                $html .= '<li class="ul_profile"><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
                if ($showmagicgift) {
                    $html .= '<li class="ul_magicgift"><div style="' . 'background: url(' . STATICURL . 'image/magic/gift.small.gif) no-repeat 0 50%;' . '">';
                    if ($magicinfo) {
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=retiregift">' . lang('magic/gift', 'gift_gc') . '</a>';
                    } else {
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=magic&mid=gift">' . lang('magic/gift', 'gift_use') . '</a>';
                    }
                    $html .= '</div></li>';
                }
            } else {
                require_once libfile('function/friend');
                $isfriend = friend_check($uid);
                if (!$isfriend) {
                    $html .= "<li class='ul_add'><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
                } else {
                    $html .= "<li class='ul_ignore'><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
                }
                $html .= "<li class='ul_msg'><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
                $html .= "<li class='ul_poke'><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
                $html .= "<li class='ul_pm'><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
            }
            $html .= '</ul>';
            $encodeusername = rawurlencode($space['username']);
            if (checkperm('allowbanuser')) {
                $managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
            } elseif (checkperm('allowedituser')) {
                $managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
            }
            if ($_G['adminid'] == 1) {
                $managehtml .= "<li><a href=\"forum.php?mod=modcp&action=thread&op=post&do=search&searchsubmit=1&users={$encodeusername}\" id=\"umanageli\" onmouseover=\"showMenu(this.id)\" class=\"showmenu\">" . lang('home/template', 'content_manage') . "</a></li>";
            }
            if (!empty($managehtml)) {
                /*vot*/
                $html .= '<hr class="da mtn m0" /><ul class="ptn xl xl2 cl">' . $managehtml . '</ul><ul id="usermanageli_menu" class="p_pop" style="display:none;">';
                if (checkperm('allowbanuser')) {
                    $html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_ban') . '</a></li>';
                }
                if (checkperm('allowedituser')) {
                    $html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_edit') . '</a></li>';
                }
                $html .= '</ul>';
                if ($_G['adminid'] == 1) {
                    /*vot*/
                    $html .= '<ul id="umanageli_menu" class="p_pop" style="display:none;">';
                    $html .= '<li><a href="forum.php?mod=modcp&action=thread&op=post&searchsubmit=1&do=search&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_post') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=doing&searchsubmit=1&search=true&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_doing') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=blog&searchsubmit=1&search=true&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_blog') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=feed&searchsubmit=1&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_feed') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=album&searchsubmit=1&search=true&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_album') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=pic&searchsubmit=1&detail=1&search=true&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_pic') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=comment&searchsubmit=1&fromumanage=1&authorid=' . $uid . '" target="_blank">' . lang('space', 'manage_comment') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=share&searchsubmit=1&search=true&fromumanage=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_share') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=threads&operation=group&searchsubmit=1&detail=1&search=true&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_threads') . '</a></li>';
                    $html .= '<li><a href="admin.php?action=prune&searchsubmit=1&detail=1&operation=group&fromumanage=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_prune') . '</a></li>';
                    $html .= '</ul>';
                }
            }
            if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
                $info = !empty($space['magicgift']) ? unserialize($space['magicgift']) : array();
                if ($space['self']) {
                } elseif ($info) {
                    if ($info['left'] && !in_array($_G['uid'], (array) $info['receiver'])) {
                        $percredit = min($info['percredit'], $info['left']);
                        if ($info['credittype'] == 'credits') {
                            $credittype = lang('core', 'title_credit');
                        } else {
                            $extcredits = str_replace('extcredits', '', $info['credittype']);
                            $credittype = $_G['setting']['extcredits'][$extcredits]['title'];
                        }
                        $html .= '<div id="magicreceivegift">';
                        $html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=receivegift&uid=' . $uid . '" title="' . lang('magic/gift', 'gift_receive_gift', array('percredit' => $percredit, 'credittype' => $credittype)) . '">';
                        $html .= '<img src="' . STATICURL . 'image/magic/gift.gif" alt="gift" />';
                        $html .= '</a>';
                        $html .= '</div>';
                    }
                }
            }
            $html = '<div>' . $html . '</div>';
            break;
        case 'statistic':
            space_merge($space, 'count');
            $html .= '<p class="mbm xw1">';
            if (empty($parameters['banviews'])) {
                $html .= lang('space', 'space_views', array('views' => $space['views'] ? $space['views'] : '--'));
            }
            $html .= '</p><ul class="xl xl2 cl">';
            if (empty($parameters['bancredits'])) {
                $html .= "<li>" . lang('space', 'credits') . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['credits'] ? $space['credits'] : '--') . "</a></li>";
                foreach ($_G['setting']['extcredits'] as $extcreditid => $extcredit) {
                    $html .= "<li>" . ($extcredit['img'] ? $extcredit['img'] . ' ' : '') . $extcredit['title'] . ': <a href="home.php?mod=spacecp&ac=credit">' . ($space['extcredits' . $extcreditid] ? $space['extcredits' . $extcreditid] : '--') . '</a>';
                }
            }
            if (empty($parameters['banfriends'])) {
                $html .= "<li>" . lang('space', 'friends') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=friend&view=me&from=space">' . ($space['friends'] ? $space['friends'] : '--') . "</a></li>";
            }
            if (empty($parameters['banthreads']) && $_G['setting']['allowviewuserthread'] !== false || $_G['adminid'] == 1) {
                $html .= "<li>" . lang('space', 'threads') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=thread&view=me&from=space">' . ($space['threads'] ? $space['threads'] : '--') . "</a></li>";
            }
            if (empty($parameters['banblogs'])) {
                $html .= "<li>" . lang('space', 'blogs') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . ($space['blogs'] ? $space['blogs'] : '--') . "</a></li>";
            }
            if (empty($parameters['banalbums'])) {
                $html .= "<li>" . lang('space', 'albums') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=album&view=me&from=space">' . ($space['albums'] ? $space['albums'] : '--') . "</a></li>";
            }
            if (empty($parameters['bansharings'])) {
                $html .= "<li>" . lang('space', 'sharings') . ': <a href="home.php?mod=space&uid=' . $uid . '&do=share&view=me&from=space">' . ($space['sharings'] ? $space['sharings'] : '--') . "</a></li>";
            }
            $html .= '</ul>';
            $html = '<div>' . $html . '</div>';
            break;
        case 'doing':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (ckprivacy('doing', 'view')) {
                $dolist = array();
                $sql = "SELECT * FROM " . DB::table('home_doing') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}";
                $query = DB::query($sql);
                while ($value = DB::fetch($query)) {
                    if ($value['status'] == 0 || $value['uid'] == $_G['uid']) {
                        $dolist[] = $value;
                    }
                }
                if ($dolist) {
                    foreach ($dolist as $dv) {
                        $doid = $dv['doid'];
                        $_G[gp_key] = $key = random(8);
                        $html .= "<li class=\"pbn bbda\">";
                        $html .= $dv['message'];
                        $html .= "&nbsp;<a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
                        $html .= "</li>";
                    }
                } else {
                    $html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . ($space['self'] ? lang('space', 'block_doing_no_content_publish', $space) : '') . "</p>";
                }
            } else {
                $html .= "<p class=\"emp\">" . lang('space', 'block_view_noperm') . "</p>";
            }
            $html = '<ul class="xl">' . $html . '</ul>';
            break;
        case 'stickblog':
            space_merge($space, 'profile');
            $stickblogs = explode(',', $space['stickblogs']);
            if (!empty($stickblogs)) {
                $bids = array_slice($stickblogs, 0, $shownum);
                $bids = dimplode($bids);
                if (!empty($bids)) {
                    if (!isset($parameters['showmessage'])) {
                        $parameters['showmessage'] = 150;
                    }
                    $sql = $parameters['showmessage'] > 0 ? "SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\r\n\t\t\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\t\t\tWHERE b.blogid IN ({$bids})" : "SELECT * FROM " . DB::table('home_blog') . "WHERE blogid IN ({$bids})";
                    $query = DB::query($sql);
                    while ($value = DB::fetch($query)) {
                        if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                            if ($value['pic']) {
                                $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                            }
                            $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $parameters['showmessage'], 0, 0, 0, -1);
                            $html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
                            if (!empty($parameters['showmessage'])) {
                                if ($value['pic']) {
                                    $html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
                                }
                                $html .= "<dd>{$value['message']}</dd>";
                            }
                            $html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
                            $html .= "</dl>";
                        } else {
                            $html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
                        }
                    }
                }
            }
            $more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
            $contentclassname = ' xld';
            $html = $html . $more;
            break;
        case 'blog':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (!isset($parameters['showmessage'])) {
                $parameters['showmessage'] = 150;
            }
            $query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\r\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\r\n\t\t\t\tWHERE b.uid='{$uid}'\r\n\t\t\t\tORDER BY b.dateline DESC LIMIT 0,{$shownum}");
            while ($value = DB::fetch($query)) {
                if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                    if ($value['pic']) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                    }
                    $value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], $parameters['showmessage'], 0, 0, 0, -1);
                    $html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
                    if (!empty($parameters['showmessage'])) {
                        if ($value['pic']) {
                            $html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
                        }
                        $html .= "<dd>{$value['message']}</dd>";
                    }
                    $html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
                    $html .= "</dl>";
                } else {
                    $html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
                }
            }
            if ($html) {
                $more = '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $uid . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>';
            } else {
                $html = '<p class="emp">' . lang('space', 'block_blog_no_content') . ($space['self'] ? lang('space', 'block_blog_no_content_publish', $space) : '') . '</p>';
                $more = '';
            }
            $contentclassname = ' xld';
            $html = $html . $more;
            break;
        case 'album':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (ckprivacy('album', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE uid='{$uid}' ORDER BY updatetime DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
                        $html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
                    }
                }
                if (!$html) {
                    $html = '<p class="emp">' . lang('space', 'block_album_no_content') . ($space['self'] ? lang('space', 'block_album_no_content_publish', $space) : '') . '</p>';
                }
            } else {
                $html .= '<li>' . lang('space', 'block_view_noperm') . '</li>';
            }
            $html = '<ul class="ml cl">' . $html . '</ul>';
            break;
        case 'feed':
            $do = 'home';
            $view = 'me';
            $from = 'space';
            if (!IS_ROBOT && ckprivacy('feed', 'view')) {
                require_once libfile('function/feed');
                $query = DB::query("SELECT * FROM " . DB::table('home_feed') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
                        $html .= mkfeedhtml(mkfeed($value));
                    }
                }
            }
            $contenttagname = 'ul';
            $contentclassname = ' el';
            $html = !$html ? '<p class="emp">' . lang('space', 'block_feed_no_content') . '</p>' : $html;
            break;
        case 'thread':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if ($_G['setting']['allowviewuserthread'] !== false) {
                $fidsql = empty($_G['setting']['allowviewuserthread']) ? '' : " AND fid IN({$_G[setting][allowviewuserthread]}) ";
                $query = DB::query("SELECT * FROM " . DB::table('forum_thread') . " WHERE authorid='{$uid}' {$fidsql} AND displayorder>='0' ORDER BY tid DESC LIMIT 0,{$shownum}");
                while ($thread = DB::fetch($query)) {
                    if ($thread['author']) {
                        $html .= "<li><a href=\"forum.php?mod=viewthread&tid={$thread['tid']}\" target=\"_blank\">{$thread['subject']}</a></li>";
                    }
                }
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_thread_no_content') . ($space['self'] ? lang('space', 'block_thread_no_content_publish', $space) : '') . '</p>' : '<ul class="xl">' . $html . '</ul>';
            break;
        case 'friend':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            require_once libfile('function/friend');
            $friendlist = array();
            $friendlist = friend_list($uid, $shownum);
            $fuids = array_keys($friendlist);
            getonlinemember($fuids);
            foreach ($friendlist as $key => $value) {
                $classname = $_G['ols'][$value['fuid']] ? 'gol' : '';
                $html .= '<li><a href="home.php?mod=space&uid=' . $value['fuid'] . '" target="_blank" class="avt"><em class="' . $classname . '"></em>' . avatar($value['fuid'], 'small') . '</a><p><a href="home.php?mod=space&uid=' . $value[fuid] . '" target="_blank">' . $value['fusername'] . '</a></p></li>';
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_friend_no_content') . ($space['self'] ? lang('space', 'block_friend_no_content_publish', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'visitor':
            if ($space['self']) {
                $do = 'friend';
                $view = 'visitor';
            }
            $query = DB::query("SELECT * FROM " . DB::table('home_visitor') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
            $list = $fuids = array();
            while ($value = DB::fetch($query)) {
                $list[] = $value;
                $fuids[] = $value['vuid'];
            }
            getonlinemember($fuids);
            foreach ($list as $value) {
                $html .= "<li>";
                if ($value['vusername'] == '') {
                    $html .= lang('space', 'visitor_anonymity');
                } else {
                    $html .= lang('space', 'visitor_list', array('uid' => $value['vuid'], 'username' => $value['vusername'], 'class' => $_G['ols'][$value['vuid']] ? 'gol' : '', 'avatar' => avatar($value['vuid'], 'small')));
                }
                $html .= "<span class=\"xg2\">" . dgmdate($value['dateline'], 'u', '9999', 'Y-m-d') . "</span>";
                $html .= "</li>";
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_visitor_no_content') . ($space['self'] ? lang('space', 'block_visitor_no_content_publish', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'share':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (!IS_ROBOT && ckprivacy('share', 'view')) {
                require_once libfile('function/share');
                $query = DB::query("SELECT * FROM " . DB::table('home_share') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value = mkshare($value);
                    $html .= '<li><em><a href="home.php?mod=space&uid=' . $value['uid'] . '&do=share&id=' . $value['sid'] . '">' . $value['title_template'] . '</a>(' . dgmdate($value['dateline'], 'u') . ')</em><div class="ec cl">';
                    if ($value['image']) {
                        $html .= '<a href="' . $value['image_link'] . '" target="_blank"><img src="' . $value['image'] . '" class="tn" alt="" /></a>';
                    }
                    $html .= '<div class="d">' . $value['body_template'] . '</div>';
                    if ($value['type'] == 'video') {
                        if (!empty($value['body_data']['imgurl'])) {
                            $html .= '<table class="mtm" title="' . lang('space', 'click_play') . '" onclick="javascript:showFlash(\'' . $value['body_data']['host'] . '\', \'' . $value['body_data']['flashvar'] . '\', this, \'' . $value['sid'] . '\');"><tr><td class="vdtn hm" style="background: url(' . $value['body_data']['imgurl'] . ') no-repeat"><img src="' . STATICURL . '/image/common/vds.png" alt="' . lang('space', 'click_play') . '" /></td></tr></table>';
                        } else {
                            $html .= "<img src=\"" . STATICURL . "/image/common/vd.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('{$value['body_data']['host']}', '{$value['body_data']['flashvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                        }
                    } elseif ($value['type'] == 'music') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/music.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('music', '{$value['body_data']['musicvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    } elseif ($value['type'] == 'flash') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/flash.gif\" alt=\"" . lang('space', 'click_view') . "\" onclick=\"javascript:showFlash('flash', '{$value['body_data']['flashaddr']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    }
                    if ($value['body_general']) {
                        $html .= '<div class="quote' . ($value['image'] ? 'z' : '') . "\"><blockquote>{$value['body_general']}</blockquote></div>";
                    }
                    $html .= '</div></li>';
                }
                $html = !$html ? '<p class="emp">' . lang('space', 'block_share_no_content') . '</p>' : '<ul class="el">' . $html . '</ul>';
            }
            break;
        case 'wall':
            $do = $blockname;
            $walllist = array();
            if (ckprivacy('wall', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE id='{$uid}' AND idtype='uid' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, -1) . ' ...' : $value['message'];
                    if ($value['status'] == 0 || $value['authorid'] == $_G['uid']) {
                        $walllist[] = $value;
                    }
                }
            }
            foreach ($walllist as $key => $value) {
                $op = '';
                if ($value['author']) {
                    $author_avatar = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" target="_blank">' . avatar($value['authorid'], 'small') . '</a>';
                    $author = '<a href="home.php?mod=space&uid=' . $value['authorid'] . '" id="author_' . $value['cid'] . '" target="_blank">' . $value['author'] . '</a>';
                } else {
                    $author_avatar = '<img src="static/image/magic/hidden.gif" alt="hidden" />';
                    $author = $_G['setting']['anonymoustext'];
                }
                if ($value['authorid'] == $_G['uid']) {
                    $op .= lang('space', 'wall_edit', array('cid' => $value['cid']));
                }
                if ($value['authorid'] == $_G['uid'] || $space['self'] || checkperm('managecomment')) {
                    $op .= lang('space', 'wall_del', array('cid' => $value['cid']));
                }
                if ($value['authorid'] != $_G['uid'] && ($value['idtype'] != 'uid' || $space['self'])) {
                    $op .= lang('space', 'wall_reply', array('cid' => $value['cid']));
                }
                $moderate_need = $value['status'] == 1 ? lang('template', 'moderate_need') : '';
                $date = dgmdate($value['dateline'], 'u');
                $replacearr = array('author' => $author, 'author_avatar' => $author_avatar, 'moderated' => $moderate_need, 'cid' => $value['cid'], 'message' => $value['message'], 'date' => $date, 'op' => $op);
                $html .= lang('space', 'wall_li', $replacearr);
            }
            $html = !empty($walllist) ? $html . lang('space', 'wall_more', array('uid' => $uid)) : '<p class="emp">' . lang('space', 'block_wall_no_content') . '</p>';
            $html = '<div class="xld xlda el" id="comment_ul">' . $html . '</div>';
            $html = lang('space', 'wall_form', array('uid' => $uid, 'FORMHASH' => FORMHASH)) . '<hr class="da mtm m0">' . $html;
            $titlemore = '<span class="y xw0"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'all') . '</a></span>';
            break;
        case 'group':
            require_once libfile('function/group');
            $grouplist = mygrouplist($uid, 'lastupdate', array('f.name', 'ff.icon'), $shownum);
            if (empty($grouplist)) {
                $grouplist = array();
            }
            foreach ($grouplist as $groupid => $group) {
                $group['groupid'] = $groupid;
                $html .= lang('space', 'group_li', $group);
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_group_no_content') . ($space['self'] ? lang('space', $_G['group']['allowbuildgroup'] ? 'block_group_no_content_publish' : 'block_group_no_content_join', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'music':
            if (!empty($parameters['mp3list'])) {
                $authcode = substr(md5($_G['authkey'] . $uid), 6, 16);
                $view = $_G['adminid'] == 1 && $_G['setting']['allowquickviewprofile'] ? '&view=admin' : '';
                $querystring = urlencode("home.php?mod=space&uid={$uid}&do=index&op=getmusiclist&hash={$authcode}{$view}&t=" . TIMESTAMP);
                $swfurl = STATICURL . 'image/common/mp3player.swf?config=' . $querystring;
                if (empty($parameters['config']['height']) && $parameters['config']['height'] !== 0) {
                    $parameters['config']['height'] = '200px';
                } else {
                    $parameters['config']['height'] .= 'px';
                }
                $html = "<script language=\"javascript\" type=\"text/javascript\">document.write(AC_FL_RunContent('id', 'mp3player', 'name', 'mp3player', 'devicefont', 'false', 'width', '100%', 'height', '" . $parameters['config']['height'] . "', 'src', '{$swfurl}', 'menu', 'false',  'allowScriptAccess', 'sameDomain', 'swLiveConnect', 'true', 'wmode', 'transparent'));</script>";
            } else {
                $html = lang('space', 'music_no_content');
            }
            $html = '<div class="ml mls cl">' . $html . '</div>';
            break;
        case 'myapp':
            $html = '';
            $listclass = 'ptm ml mls cl';
            $query = DB::query("SELECT ua.appid, ua.appname, my.iconstatus, my.userpanelarea FROM " . DB::table('home_userapp') . " ua LEFT JOIN " . DB::table('common_myapp') . " my USING(appid) WHERE ua.uid='{$uid}' ORDER BY ua.menuorder DESC LIMIT 0,{$shownum}");
            while ($value = DB::fetch($query)) {
                if (!empty($value['appname'])) {
                    $replace = array('appid' => $value['appid'], 'appname' => $value['appname']);
                    $parameters['logotype'] = !empty($parameters['logotype']) && in_array($parameters['logotype'], array('icon', 'logo')) ? $parameters['logotype'] : 'logo';
                    if ($parameters['logotype'] == 'icon') {
                        $listclass = 'xl xl1 cl';
                        $replace['icon'] = getmyappiconpath($value['appid'], $value['iconstatus']);
                    }
                    $html .= lang('space', 'myapp_li_' . $parameters['logotype'], $replace);
                }
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_myapp_no_content') . ($space['self'] ? lang('space', 'block_myapp_no_content_publish', $space) : '') . '</p>' : '<ul class="' . $listclass . '">' . $html . '</ul>';
            break;
        case 'block1':
        case 'block2':
        case 'block3':
        case 'block4':
        case 'block5':
            if ($space['self']) {
                $_G['space_group'] = $_G['group'];
            } elseif (empty($_G['space_group'])) {
                $_G['space_group'] = DB::fetch_first("SELECT * FROM " . DB::table('common_usergroup_field') . " WHERE groupid='{$space['groupid']}'");
            }
            require_once libfile('function/discuzcode');
            if ($_G['space_group']['allowspacediyimgcode']) {
                if (empty($_G['cache']['smilies']['loaded'])) {
                    loadcache(array('smilies', 'smileytypes'));
                    foreach ($_G['cache']['smilies']['replacearray'] as $skey => $smiley) {
                        $_G['cache']['smilies']['replacearray'][$skey] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$skey]]['directory'] . '/' . $smiley . '[/img]';
                    }
                    $_G['cache']['smilies']['loaded'] = 1;
                }
                $parameters['content'] = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], trim($parameters['content']));
            }
            if ($_G['space_group']['allowspacediybbcode'] || $_G['space_group']['allowspacediyimgcode'] || $_G['space_group']['allowspacediyhtml']) {
                $parameters['content'] = discuzcode($parameters['content'], 1, 0, 1, 0, $_G['space_group']['allowspacediybbcode'], $_G['space_group']['allowspacediyimgcode'], $_G['space_group']['allowspacediyhtml']);
            } else {
                $parameters['content'] = dhtmlspecialchars($parameters['content']);
            }
            $parameters['content'] = nl2br($parameters['content']);
            if (empty($parameters['content'])) {
                $parameters['content'] = lang('space', $blockname);
            }
            $html .= $parameters['content'];
            break;
        default:
            return false;
    }
    if (isset($parameters['title'])) {
        if (empty($parameters['title'])) {
            $title = '';
        } else {
            $view = $view === false ? '' : '&view=' . $view;
            $from = $from === false ? '' : '&from=' . $from;
            $bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . $from . '">' . stripslashes($parameters['title']) . '</a>' : stripslashes($parameters['title']);
            $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
        }
    } else {
        $view = $view === false ? '' : '&view=' . $view;
        $from = $from === false ? '' : '&from=' . $from;
        $bnamelink = $do ? '<a href="home.php?mod=space&uid=' . $uid . '&do=' . $do . $view . $from . '">' . getblockdata($blockname) . '</a>' : getblockdata($blockname);
        $title = lang('space', 'block_title', array('bname' => $bnamelink, 'more' => $titlemore));
    }
    $html = $title . '<' . $contenttagname . ' id="' . $blockname . '_content" class="dxb_bc' . $contentclassname . '">' . $html . '</' . $contenttagname . '>';
    return $html;
}
Пример #11
0
 private function _getPersonalDataInfo($puid, $space)
 {
     global $_G;
     $res['body']['PersonalData'] = array();
     require_once libfile('function/spacecp');
     space_merge($space, 'count');
     space_merge($space, 'field_home');
     space_merge($space, 'field_forum');
     space_merge($space, 'profile');
     space_merge($space, 'status');
     $space['buyerrank'] = 0;
     if ($space['buyercredit']) {
         foreach ($_G['setting']['ec_credit']['rank'] as $level => $credit) {
             if ($space['buyercredit'] <= $credit) {
                 $space['buyerrank'] = $level;
                 break;
             }
         }
     }
     $space['sellerrank'] = 0;
     if ($space['sellercredit']) {
         foreach ($_G['setting']['ec_credit']['rank'] as $level => $credit) {
             if ($space['sellercredit'] <= $credit) {
                 $space['sellerrank'] = $level;
                 break;
             }
         }
     }
     require_once libfile('function/friend');
     $isfriend = friend_check($space['uid'], 1);
     loadcache('profilesetting');
     include_once libfile('function/profile');
     $profiles = array();
     $privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
     if ($_G['setting']['verify']['enabled']) {
         space_merge($space, 'verify');
     }
     if ($_G['uid'] == $space['uid'] || $_G['group']['allowviewip']) {
         foreach ($_G['cache']['profilesetting'] as $fieldid => $field) {
             if (!$field['available'] || $field['invisible'] || in_array($fieldid, array('birthmonth', 'birthyear'))) {
                 continue;
             }
             $val = profile_show($fieldid, $space);
             $profiles[] = array('type' => $fieldid, 'title' => $field['title'], 'data' => WebUtils::emptyHtml($val));
         }
     } else {
         foreach ($_G['cache']['profilesetting'] as $fieldid => $field) {
             if (!$field['available'] || in_array($fieldid, array('birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
                 continue;
             }
             if ($field['available'] && (strlen($space[$fieldid]) > 0 || ($fieldid == 'birthcity' && strlen($space['birthprovince']) || $fieldid == 'residecity' && strlen($space['resideprovince']))) && ($space['self'] || empty($privacy[$fieldid]) || $isfriend && $privacy[$fieldid] == 1) && (!$_G['inajax'] && !$field['invisible'] || $_G['inajax'] && $field['showincard'])) {
                 $val = profile_show($fieldid, $space);
                 if ($val !== false) {
                     if ($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) {
                         continue;
                     }
                     if ($field['formtype'] == 'file' && $val) {
                         $imgurl = getglobal('setting/attachurl') . './profile/' . $val;
                         $val = '<span><a href="' . $imgurl . '" target="_blank"><img src="' . $imgurl . '"  style="max-width: 500px;" /></a></span>';
                     }
                     $profiles[] = array('type' => $fieldid, 'title' => $field['title'], 'data' => WebUtils::emptyHtml($val));
                 }
             }
         }
     }
     return $profiles;
 }
Пример #12
0
function profile_setting($fieldid, $space = array(), $showstatus = false, $ignoreunchangable = false)
{
    global $_G;
    if (empty($_G['cache']['profilesetting'])) {
        loadcache('profilesetting');
    }
    $field = $_G['cache']['profilesetting'][$fieldid];
    if (empty($field) || !$field['available'] || in_array($fieldid, array('uid', 'constellation', 'zodiac', 'birthmonth', 'birthyear', 'birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
        return '';
    }
    if ($showstatus) {
        $uid = intval($space['uid']);
        if ($uid && !isset($_G['profile_verifys'][$uid])) {
            $_G['profile_verifys'][$uid] = array();
            $query = DB::query('SELECT field FROM ' . DB::table('common_member_verify_info') . " WHERE uid = '{$uid}' AND verifytype='0'");
            while ($value = DB::fetch($query)) {
                $fields = unserialize($value['field']);
                foreach ($fields as $key => $fvalue) {
                    if ($_G['cache']['profilesetting'][$key]['needverify']) {
                        $_G['profile_verifys'][$uid][$key] = $fvalue;
                    }
                }
            }
        }
        $verifyvalue = NULL;
        if (isset($_G['profile_verifys'][$uid][$fieldid])) {
            if ($fieldid == 'gender') {
                $verifyvalue = lang('space', 'gender_' . intval($_G['profile_verifys'][$uid][$fieldid]));
            } elseif ($fieldid == 'birthday') {
                $verifyvalue = $_G['profile_verifys'][$uid]['birthyear'] . '-' . $_G['profile_verifys'][$uid]['birthmonth'] . '-' . $_G['profile_verifys'][$uid]['birthday'];
            } else {
                $verifyvalue = $_G['profile_verifys'][$uid][$fieldid];
            }
        }
    }
    $html = '';
    $field['unchangeable'] = !$ignoreunchangable && $field['unchangeable'] ? 1 : 0;
    if ($fieldid == 'birthday') {
        if ($field['unchangeable'] && !empty($space[$fieldid])) {
            return '<span>' . $space['birthyear'] . '-' . $space['birthmonth'] . '-' . $space['birthday'] . '</span>';
        }
        $birthyeayhtml = '';
        $nowy = dgmdate($_G['timestamp'], 'Y');
        for ($i = 0; $i < 100; $i++) {
            $they = $nowy - $i;
            $selectstr = $they == $space['birthyear'] ? ' selected' : '';
            $birthyeayhtml .= "<option value=\"{$they}\"{$selectstr}>{$they}</option>";
        }
        $birthmonthhtml = '';
        for ($i = 1; $i < 13; $i++) {
            $selectstr = $i == $space['birthmonth'] ? ' selected' : '';
            $birthmonthhtml .= "<option value=\"{$i}\"{$selectstr}>{$i}</option>";
        }
        $birthdayhtml = '';
        if (empty($space['birthmonth']) || in_array($space['birthmonth'], array(1, 3, 5, 7, 8, 10, 12))) {
            $days = 31;
        } elseif (in_array($space['birthmonth'], array(4, 6, 9, 11))) {
            $days = 30;
        } elseif ($space['birthyear'] && ($space['birthyear'] % 400 == 0 || $space['birthyear'] % 4 == 0 && $space['birthyear'] % 400 != 0)) {
            $days = 29;
        } else {
            $days = 28;
        }
        for ($i = 1; $i <= $days; $i++) {
            $selectstr = $i == $space['birthday'] ? ' selected' : '';
            $birthdayhtml .= "<option value=\"{$i}\"{$selectstr}>{$i}</option>";
        }
        $html = '<select id="birthyear" name="birthyear" onchange="showbirthday();" tabindex="1">' . '<option value="">' . lang('space', 'year') . '</option>' . $birthyeayhtml . '</select>' . '&nbsp;&nbsp;' . '<select id="birthmonth" name="birthmonth" onchange="showbirthday();" tabindex="1">' . '<option value="">' . lang('space', 'month') . '</option>' . $birthmonthhtml . '</select>' . '&nbsp;&nbsp;' . '<select id="birthday" name="birthday" tabindex="1">' . '<option value="">' . lang('space', 'day') . '</option>' . $birthdayhtml . '</select>';
    } elseif ($fieldid == 'gender') {
        if ($field['unchangeable'] && $space[$fieldid] > 0) {
            return '<span>' . lang('space', 'gender_' . intval($space[$fieldid])) . '</span>';
        }
        $selected = array($space[$fieldid] => ' selected="selected"');
        $html = '<select name="gender" id="gender" tabindex="1">';
        if ($field['unchangeable']) {
            $html .= '<option value="">' . lang('space', 'gender') . '</option>';
        } else {
            $html .= '<option value="0"' . ($space[$fieldid] == '0' ? ' selected="selected"' : '') . '>' . lang('space', 'gender_0') . '</option>';
        }
        $html .= '<option value="1"' . ($space[$fieldid] == '1' ? ' selected="selected"' : '') . '>' . lang('space', 'gender_1') . '</option>' . '<option value="2"' . ($space[$fieldid] == '2' ? ' selected="selected"' : '') . '>' . lang('space', 'gender_2') . '</option>' . '</select>';
    } elseif ($fieldid == 'birthcity') {
        if ($field['unchangeable'] && !empty($space[$fieldid])) {
            return '<span>' . $space['birthprovince'] . '-' . $space['birthcity'] . '</span>';
        }
        $values = array(0, 0);
        $elems = array('birthprovince', 'birthcity');
        if (!empty($space['birthprovince'])) {
            $html = profile_show('birthcity', $space);
            $html .= '&nbsp;&nbsp;<a href="javascript:;" onclick="showdistrict(\'birthdistrictbox\', [\'birthprovince\', \'birthcity\'], 2); return false;">' . lang('spacecp', 'profile_edit') . '</a>';
            $html .= '<p id="birthdistrictbox"></p>';
        } else {
            $html = '<p id="birthdistrictbox">' . showdistrict($values, $elems, 'birthdistrictbox') . '</p>';
        }
    } elseif ($fieldid == 'residecity') {
        if ($field['unchangeable'] && !empty($space[$fieldid])) {
            return '<span>' . $space['resideprovince'] . '-' . $space['residecity'] . '</span>';
        }
        $values = array(0, 0, 0, 0);
        $elems = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
        if (!empty($space['resideprovince'])) {
            $html = profile_show('residecity', $space);
            $html .= '&nbsp;&nbsp;<a href="javascript:;" onclick="showdistrict(\'residedistrictbox\', [\'resideprovince\', \'residecity\', \'residedist\', \'residecommunity\'], 4); return false;">' . lang('spacecp', 'profile_edit') . '</a>';
            $html .= '<p id="residedistrictbox"></p>';
        } else {
            $html = '<p id="residedistrictbox">' . showdistrict($values, $elems, 'residedistrictbox') . '</p>';
        }
    } else {
        if ($field['unchangeable'] && $space[$fieldid] != '') {
            if ($field['formtype'] == 'file') {
                $imgurl = getglobal('setting/attachurl') . './profile/' . $space[$fieldid];
                return '<span><a href="' . $imgurl . '" target="_blank"><img src="' . $imgurl . '"  style="max-width: 500px;" /></a></span>';
            } else {
                return '<span>' . nl2br($space[$fieldid]) . '</span>';
            }
        }
        if ($field['formtype'] == 'textarea') {
            $html = "<textarea name=\"{$fieldid}\" id=\"{$fieldid}\" rows=\"3\" cols=\"40\" class=\"pt\" tabindex=\"1\">{$space[$fieldid]}</textarea>";
        } elseif ($field['formtype'] == 'select') {
            $field['choices'] = explode("\n", $field['choices']);
            $html = "<select name=\"{$fieldid}\" tabindex=\"1\">";
            foreach ($field['choices'] as $op) {
                $html .= "<option value=\"{$op}\"" . ($op == $space[$fieldid] ? 'selected="selected"' : '') . ">{$op}</option>";
            }
            $html .= '</select>';
        } elseif ($field['formtype'] == 'list') {
            $field['choices'] = explode("\n", $field['choices']);
            $html = "<select name=\"{$fieldid}[]\" multiple=\"multiplue\" tabindex=\"1\">";
            $space[$fieldid] = explode("\n", $space[$fieldid]);
            foreach ($field['choices'] as $op) {
                $html .= "<option value=\"{$op}\"" . (in_array($op, $space[$fieldid]) ? 'selected="selected"' : '') . ">{$op}</option>";
            }
            $html .= '</select>';
        } elseif ($field['formtype'] == 'checkbox') {
            $field['choices'] = explode("\n", $field['choices']);
            $space[$fieldid] = explode("\n", $space[$fieldid]);
            foreach ($field['choices'] as $op) {
                $html .= '' . "<label><input type=\"checkbox\" name=\"{$fieldid}[]\" tabindex=\"1\" value=\"{$op}\"" . (in_array($op, $space[$fieldid]) ? ' checked="checked"' : '') . " class=\"pc\" />" . "{$op}</label>&nbsp;&nbsp;";
            }
        } elseif ($field['formtype'] == 'radio') {
            $field['choices'] = explode("\n", $field['choices']);
            foreach ($field['choices'] as $op) {
                $html .= '' . "<label><input type=\"radio\" name=\"{$fieldid}\" tabindex=\"1\" value=\"{$op}\"" . ($op == $space[$fieldid] ? ' checked="checked"' : '') . " class=\"pc\" />" . "{$op}</label>&nbsp;&nbsp;";
            }
        } elseif ($field['formtype'] == 'file') {
            $html = "<input type=\"file\" value=\"\" name=\"{$fieldid}\" tabindex=\"1\" class=\"pf\" style=\"height:26px;\" /><input type=\"hidden\" name=\"{$fieldid}\" value=\"{$space[$fieldid]}\" />";
            if (!empty($space[$fieldid])) {
                $url = getglobal('setting/attachurl') . './profile/' . $space[$fieldid];
                $html .= "&nbsp;<label><input type=\"checkbox\" class=\"checkbox\" tabindex=\"1\" name=\"deletefile[{$fieldid}]\" value=\"yes\" />" . lang('spacecp', 'delete') . "</label><br /><a href=\"{$url}\" target=\"_blank\"><img src=\"{$url}\" style=\"max-width: 500px;\" /></a>";
            }
        } else {
            $html = "<input type=\"text\" value=\"{$space[$fieldid]}\" tabindex=\"1\" name=\"{$fieldid}\" class=\"px\" />";
        }
    }
    if ($showstatus) {
        $html .= "<p class=\"d\">{$value['description']}";
        if ($space[$fieldid] == '' && $value['unchangeable']) {
            $html .= '<em>' . lang('spacecp', 'profile_unchangeable') . '</em>';
        }
        if ($verifyvalue !== null) {
            if ($field['formtype'] == 'file') {
                $imgurl = getglobal('setting/attachurl') . './profile/' . $verifyvalue;
                $verifyvalue = "<img src='{$imgurl}' alt='{$imgurl}' style='max-width: 500px;'/>";
            }
            $html .= "<strong>" . lang('spacecp', 'profile_is_verifying') . " (<a href=\"#\" onclick=\"display('newvalue_{$fieldid}');return false;\">" . lang('spacecp', 'profile_mypost') . "</a>)</strong>" . "<p id=\"newvalue_{$fieldid}\" style=\"display:none\">" . $verifyvalue . "</p>";
        } elseif ($field['needverify']) {
            $html .= '<em>' . lang('spacecp', 'profile_need_verifying') . '</em>';
        }
        $html .= '</p>';
    }
    return $html;
}
Пример #13
0
 function getdata($style, $parameter)
 {
     global $_G;
     $parameter = $this->cookparameter($parameter);
     $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array();
     $groupid = !empty($parameter['groupid']) && !in_array(0, $parameter['groupid']) ? $parameter['groupid'] : array();
     $startrow = !empty($parameter['startrow']) ? intval($parameter['startrow']) : 0;
     $items = !empty($parameter['items']) ? intval($parameter['items']) : 10;
     $orderby = isset($parameter['orderby']) && in_array($parameter['orderby'], array('credits', 'extcredits', 'threads', 'posts', 'digestposts', 'regdate', 'show', 'blogs', 'albums', 'doings', 'sharings')) ? $parameter['orderby'] : '';
     $special = isset($parameter['special']) && strlen($parameter['special']) ? intval($parameter['special']) : null;
     $lastpost = !empty($parameter['lastpost']) ? intval($parameter['lastpost']) : '';
     $avatarstatus = !empty($parameter['avatarstatus']) ? 1 : 0;
     $profiles = array();
     $profiles['gender'] = !empty($parameter['gender']) ? intval($parameter['gender']) : 0;
     $profiles['resideprovince'] = !empty($parameter['xresideprovince']) ? $parameter['xresideprovince'] : '';
     $profiles['residecity'] = !empty($parameter['xresidecity']) ? $parameter['xresidecity'] : '';
     $profiles['residedist'] = !empty($parameter['xresidedist']) ? $parameter['xresidedist'] : '';
     $profiles['residecommunity'] = !empty($parameter['xresidecommunity']) ? $parameter['xresidecommunity'] : '';
     $profiles['birthprovince'] = !empty($parameter['xbirthprovince']) ? $parameter['xbirthprovince'] : '';
     $profiles['birthcity'] = !empty($parameter['xbirthcity']) ? $parameter['xbirthcity'] : '';
     $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
     $list = array();
     $tables = $wheres = array();
     $sqlorderby = '';
     $tables[] = DB::table('common_member') . ' m';
     if ($uids) {
         $wheres[] = 'm.uid IN (' . dimplode($uids) . ')';
     }
     if ($groupid) {
         $wheres[] = 'm.groupid IN (' . dimplode($groupid) . ')';
     }
     if ($bannedids) {
         $wheres[] = 'm.uid NOT IN (' . dimplode($bannedids) . ')';
     }
     if ($avatarstatus) {
         $wheres[] = "m.avatarstatus='1'";
     }
     $tables[] = DB::table('common_member_count') . ' mc';
     $wheres[] = 'mc.uid=m.uid';
     foreach ($profiles as $key => $value) {
         if ($value) {
             $tables[] = DB::table('common_member_profile') . ' mp';
             $wheres[] = 'mp.uid=m.uid';
             $wheres[] = "mp.{$key}='{$value}'";
         }
     }
     if ($special !== null) {
         $special = $special ? 1 : 0;
         $tables[] = DB::table('home_specialuser') . ' su';
         $wheres[] = "su.status='{$special}'";
         $wheres[] = 'su.uid=m.uid';
     }
     if ($lastpost) {
         $time = TIMESTAMP - $lastpost;
         $tables[] = DB::table('common_member_status') . " ms";
         $wheres[] = "ms.uid=m.uid";
         $wheres[] = "ms.lastpost>'{$time}'";
     }
     switch ($orderby) {
         case 'credits':
         case 'regdate':
             $sqlorderby = " ORDER BY m.{$orderby} DESC";
             break;
         case 'extcredits':
             $extcredits = 'extcredits' . (in_array($parameter['extcredit'], range(1, 8)) ? $parameter['extcredit'] : '1');
             $sqlorderby = " ORDER BY mc.{$extcredits} DESC";
             break;
         case 'threads':
         case 'posts':
         case 'blogs':
         case 'albums':
         case 'doings':
         case 'sharings':
         case 'digestposts':
             $sqlorderby = " ORDER BY mc.{$orderby} DESC";
             break;
         case 'show':
             $tables[] = DB::table('home_show') . " s";
             $wheres[] = 's.uid=m.uid';
             $sqlorderby = ' ORDER BY s.unitprice DESC, s.credit DESC';
             break;
     }
     $wheres[] = '(m.groupid < 4 OR m.groupid > 8)';
     $tables = array_unique($tables);
     $wheres = array_unique($wheres);
     $tablesql = implode(',', $tables);
     $wheresql = implode(' AND ', $wheres);
     $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE {$wheresql} {$sqlorderby} LIMIT {$startrow},{$items}");
     $uids = array();
     while ($data = DB::fetch($query)) {
         $uids[] = intval($data['uid']);
         $list[] = array('id' => $data['uid'], 'idtype' => 'uid', 'title' => $data['username'], 'url' => 'home.php?mod=space&uid=' . $data['uid'], 'pic' => '', 'picflag' => 0, 'summary' => '', 'fields' => array('avatar' => avatar($data['uid'], 'small', true, false, false, $_G['setting']['ucenterurl']), 'avatar_middle' => avatar($data['uid'], 'middle', true, false, false, $_G['setting']['ucenterurl']), 'avatar_big' => avatar($data['uid'], 'big', true, false, false, $_G['setting']['ucenterurl']), 'credits' => $data['credits'], 'extcredits1' => $data['extcredits1'], 'extcredits2' => $data['extcredits2'], 'extcredits3' => $data['extcredits3'], 'extcredits4' => $data['extcredits4'], 'extcredits5' => $data['extcredits5'], 'extcredits6' => $data['extcredits6'], 'extcredits7' => $data['extcredits7'], 'extcredits8' => $data['extcredits8'], 'regdate' => $data['regdate'], 'posts' => $data['posts'], 'threads' => $data['threads'], 'digestposts' => $data['digestposts']));
     }
     if ($uids) {
         include_once libfile('function/profile');
         $profiles = array();
         $query = DB::query('SELECT * FROM ' . DB::table('common_member_profile') . " WHERE uid IN (" . dimplode($uids) . ")");
         while ($data = DB::fetch($query)) {
             $profile = array();
             foreach ($data as $fieldid => $fieldvalue) {
                 $fieldvalue = profile_show($fieldid, $data);
                 if (false !== $fieldvalue) {
                     $profile[$fieldid] = $fieldvalue;
                 }
             }
             $profiles[$data['uid']] = $profile;
         }
         for ($i = 0, $L = count($list); $i < $L; $i++) {
             $uid = $list[$i]['id'];
             if ($profiles[$uid]) {
                 $list[$i]['fields'] = array_merge($list[$i]['fields'], $profiles[$uid]);
             }
         }
     }
     return array('html' => '', 'data' => $list);
 }
Пример #14
0
 function getdata($style, $parameter)
 {
     global $_G;
     $parameter = $this->cookparameter($parameter);
     $uids = !empty($parameter['uids']) ? explode(',', $parameter['uids']) : array();
     $groupid = !empty($parameter['groupid']) && !in_array(0, $parameter['groupid']) ? $parameter['groupid'] : array();
     $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0;
     $items = isset($parameter['items']) ? intval($parameter['items']) : 10;
     $orderby = isset($parameter['orderby']) ? in_array($parameter['orderby'], array('credits', 'extcredits', 'posts', 'digestposts', 'regdate', 'hourposts', 'todayposts', 'weekposts', 'monthposts', 'show')) ? $parameter['orderby'] : 'credits' : 'credits';
     $special = isset($parameter['special']) && strlen($parameter['special']) ? intval($parameter['special']) : null;
     $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
     $sqlban = !empty($bannedids) ? ' AND m.uid NOT IN (' . dimplode($bannedids) . ')' : '';
     $list = array();
     $tablesql = DB::table('common_member') . " m LEFT JOIN " . DB::table('common_member_count') . " mc ON m.uid = mc.uid";
     $sqlgroupid = !empty($groupid) ? ' AND m.groupid IN (' . dimplode($groupid) . ')' : '';
     if ($uids) {
         $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE m.uid IN (" . dimplode($uids) . ") {$sqlban} LIMIT {$startrow}, {$items}");
     } elseif ($special !== null) {
         $special = $special ? 1 : 0;
         $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} LEFT JOIN " . DB::table('home_specialuser') . " su ON m.uid=su.uid WHERE su.status='{$special}' {$sqlgroupid} {$sqlban} LIMIT {$startrow}, {$items}");
     } else {
         switch ($orderby) {
             case 'credits':
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE 1 {$sqlgroupid} {$sqlban} ORDER BY m.credits DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'regdate':
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE 1 {$sqlgroupid} {$sqlban} ORDER BY m.regdate DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'extcredits':
                 $extcredits = 'extcredits' . (in_array($parameter['extcredit'], range(1, 8)) ? $parameter['extcredit'] : '1');
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE 1 {$sqlgroupid} {$sqlban} ORDER BY mc.{$extcredits} DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'posts':
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE 1 {$sqlgroupid} {$sqlban} ORDER BY mc.posts DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'digestposts':
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE 1 {$sqlgroupid} {$sqlban} ORDER BY mc.digestposts DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'hourposts':
                 $timestamp = TIMESTAMP - 3600;
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} LEFT JOIN " . DB::table('common_member_status') . " ms ON m.uid=ms.uid WHERE ms.lastpost>='{$timestamp}' {$sqlgroupid} {$sqlban} ORDER BY mc.posts DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'todayposts':
                 $timestamp = TIMESTAMP - 86400;
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} LEFT JOIN " . DB::table('common_member_status') . " ms ON m.uid=ms.uid WHERE ms.lastpost>='{$timestamp}' {$sqlgroupid} {$sqlban} ORDER BY mc.posts DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'weekposts':
                 $timestamp = TIMESTAMP - 604800;
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} LEFT JOIN " . DB::table('common_member_status') . " ms ON m.uid=ms.uid WHERE ms.lastpost>='{$timestamp}' {$sqlgroupid} {$sqlban} ORDER BY mc.posts DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'monthposts':
                 $timestamp = TIMESTAMP - 2592000;
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} LEFT JOIN " . DB::table('common_member_status') . " ms ON m.uid=ms.uid WHERE ms.lastpost>='{$timestamp}' {$sqlgroupid} {$sqlban} ORDER BY mc.posts DESC LIMIT {$startrow}, {$items}");
                 break;
             case 'show':
                 $tablesql = DB::table('home_show') . " s LEFT JOIN " . DB::table('common_member') . " m ON s.uid = m.uid LEFT JOIN " . DB::table('common_member_count') . " mc ON m.uid = mc.uid";
                 $query = DB::query("SELECT m.*, mc.* FROM {$tablesql} WHERE 1 {$sqlban} ORDER BY s.credit DESC LIMIT {$startrow}, {$items}");
                 break;
         }
     }
     $uids = array();
     while ($data = DB::fetch($query)) {
         $uids[] = intval($data['uid']);
         $list[] = array('id' => $data['uid'], 'idtype' => 'uid', 'title' => $data['username'], 'url' => 'home.php?mod=space&uid=' . $data['uid'], 'pic' => '', 'picflag' => 0, 'summary' => '', 'fields' => array('avatar' => avatar($data['uid'], 'small', true, false, $_G['setting']['avatarmethod'], $_G['setting']['ucenterurl']), 'avatar_big' => avatar($data['uid'], 'middle', true, false, $_G['setting']['avatarmethod'], $_G['setting']['ucenterurl']), 'credits' => $data['credits'], 'extcredits1' => $data['extcredits1'], 'extcredits2' => $data['extcredits2'], 'extcredits3' => $data['extcredits3'], 'extcredits4' => $data['extcredits4'], 'extcredits5' => $data['extcredits5'], 'extcredits6' => $data['extcredits6'], 'extcredits7' => $data['extcredits7'], 'extcredits8' => $data['extcredits8'], 'regdate' => $data['regdate'], 'posts' => $data['posts'], 'threads' => $data['threads'], 'digestposts' => $data['digestposts']));
     }
     if ($uids) {
         include_once libfile('function/profile');
         $profiles = array();
         $query = DB::query('SELECT * FROM ' . DB::table('common_member_profile') . " WHERE uid IN (" . dimplode($uids) . ")");
         while ($data = DB::fetch($query)) {
             $profile = array();
             foreach ($data as $fieldid => $fieldvalue) {
                 $fieldvalue = profile_show($fieldid, $data);
                 if (false !== $fieldvalue) {
                     $profile[$fieldid] = $fieldvalue;
                 }
             }
             $profiles[$data['uid']] = $profile;
         }
         for ($i = 0, $L = count($list); $i < $L; $i++) {
             $uid = $list[$i]['id'];
             if ($profiles[$uid]) {
                 $list[$i]['fields'] = array_merge($list[$i]['fields'], $profiles[$uid]);
             }
         }
     }
     return array('html' => '', 'data' => $list);
 }
Пример #15
0
function profile_setting($fieldid, $space=array(), $showstatus=false, $ignoreunchangable = false, $ignoreshowerror = false) {
	global $_G;

	if(empty($_G['cache']['profilesetting'])) {
		loadcache('profilesetting');
	}
	$field = $_G['cache']['profilesetting'][$fieldid];
	if(empty($field) || !$field['available'] || in_array($fieldid, array('uid', 'constellation', 'zodiac', 'birthmonth', 'birthyear', 'birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
		return '';
	}

	if($showstatus) {
		$uid = intval($space['uid']);
		if($uid && !isset($_G['profile_verifys'][$uid])) {
			$_G['profile_verifys'][$uid] = array();
			if($value = C::t('common_member_verify_info')->fetch_by_uid_verifytype($uid, 0)) {
				$fields = dunserialize($value['field']);
				foreach($fields as $key => $fvalue) {
					if($_G['cache']['profilesetting'][$key]['needverify']) {
						$_G['profile_verifys'][$uid][$key] = $fvalue;
					}
				}
			}
		}
		$verifyvalue = NULL;
		if(isset($_G['profile_verifys'][$uid][$fieldid])) {
			if($fieldid=='gender') {
				$verifyvalue = lang('space', 'gender_'.intval($_G['profile_verifys'][$uid][$fieldid]));
			} elseif($fieldid=='birthday') {
				$verifyvalue = $_G['profile_verifys'][$uid]['birthyear'].'-'.$_G['profile_verifys'][$uid]['birthmonth'].'-'.$_G['profile_verifys'][$uid]['birthday'];
			} else {
				$verifyvalue = $_G['profile_verifys'][$uid][$fieldid];
			}
		}
	}

	$html = '';
	$field['unchangeable'] = !$ignoreunchangable && $field['unchangeable'] ? 1 : 0;
	if($fieldid == 'birthday') {
		if($field['unchangeable'] && !empty($space[$fieldid])) {
			return '<span>'.$space['birthyear'].'-'.$space['birthmonth'].'-'.$space['birthday'].'</span>';
		}
		$birthyeayhtml = '';
		$nowy = dgmdate($_G['timestamp'], 'Y');
		for ($i=0; $i<100; $i++) {
			$they = $nowy - $i;
			$selectstr = $they == $space['birthyear']?' selected':'';
			$birthyeayhtml .= "<option value=\"$they\"$selectstr>$they</option>";
		}
		$birthmonthhtml = '';
/*vot*/		$monthname = lang('core','month_name');
		for ($i=1; $i<13; $i++) {
			$selectstr = $i == $space['birthmonth']?' selected':'';
/*vot*/			$birthmonthhtml .= "<option value=\"$i\"$selectstr>".$monthname[$i]."</option>";
		}
		$birthdayhtml = '';
		if(empty($space['birthmonth']) || in_array($space['birthmonth'], array(1, 3, 5, 7, 8, 10, 12))) {
			$days = 31;
		} elseif(in_array($space['birthmonth'], array(4, 6, 9, 11))) {
			$days = 30;
		} elseif($space['birthyear'] && (($space['birthyear'] % 400 == 0) || ($space['birthyear'] % 4 == 0 && $space['birthyear'] % 400 != 0))) {
			$days = 29;
		} else {
			$days = 28;
		}
		for ($i=1; $i<=$days; $i++) {
			$selectstr = $i == $space['birthday']?' selected':'';
			$birthdayhtml .= "<option value=\"$i\"$selectstr>$i</option>";
		}
		$html = '<select name="birthyear" id="birthyear" class="ps" onchange="showbirthday();" tabindex="1">'
				.'<option value="">'.lang('space', 'year').'</option>'
				.$birthyeayhtml
				.'</select>'
				.'&nbsp;&nbsp;'
				.'<select name="birthmonth" id="birthmonth" class="ps" onchange="showbirthday();" tabindex="1">'
				.'<option value="">'.lang('space', 'month').'</option>'
				.$birthmonthhtml
				.'</select>'
				.'&nbsp;&nbsp;'
				.'<select name="birthday" id="birthday" class="ps" tabindex="1">'
				.'<option value="">'.lang('space', 'day').'</option>'
				.$birthdayhtml
				.'</select>';

	} elseif($fieldid=='gender') {
		if($field['unchangeable'] && $space[$fieldid] > 0) {
			return '<span>'.lang('space', 'gender_'.intval($space[$fieldid])).'</span>';
		}
		$selected = array($space[$fieldid]=>' selected="selected"');
		$html = '<select name="gender" id="gender" class="ps" tabindex="1">';
		if($field['unchangeable']) {
			$html .= '<option value="">'.lang('space', 'gender').'</option>';
		} else {
			$html .= '<option value="0"'.($space[$fieldid]=='0' ? ' selected="selected"' : '').'>'.lang('space', 'gender_0').'</option>';
		}
		$html .= '<option value="1"'.($space[$fieldid]=='1' ? ' selected="selected"' : '').'>'.lang('space', 'gender_1').'</option>'
			.'<option value="2"'.($space[$fieldid]=='2' ? ' selected="selected"' : '').'>'.lang('space', 'gender_2').'</option>'
			.'</select>';
/*vot*/
/*
	} elseif($fieldid=='birthcountry') {
		if($field['unchangeable'] && !empty($space[$fieldid])) {
			return '<span>'.$space['birtcountry'].'</span>';
		}
		if(!empty($space['birthcountry'])) {
			$html = profile_show('birthcountry', $space);
			$html .= '&nbsp;(<a href="javascript:;" onclick="showcountry(\'birthcountrybox\', [\'birthcountry\'], 4, \'\', \'birth\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
			$html .= '<p id="birthcountrybox"></p>';
		} else {
			$html = '<p id="birthcountrybox">'.showcountry($values, $elems, 'birthcountrybox', 1, 'birth').'</p>';
		}
*/
	} elseif($fieldid=='birthcity') {
		if($field['unchangeable'] && !empty($space[$fieldid])) {
			return '<span>'.$space['birthprovince'].'-'.$space['birthcity'].'</span>';
		}
		$values = array(0,0,0,0);
		$elems = array('birthprovince', 'birthcity', 'birthdist', 'birthcommunity');
		if(!empty($space['birthprovince'])) {
			$html = profile_show('birthcity', $space);
			$html .= '&nbsp;(<a href="javascript:;" onclick="showdistrict(\'birthdistrictbox\', [\'birthprovince\', \'birthcity\', \'birthdist\', \'birthcommunity\'], 4, \'\', \'birth\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
			$html .= '<p id="birthdistrictbox"></p>';
		} else {
			$html = '<p id="birthdistrictbox">'.showdistrict($values, $elems, 'birthdistrictbox', 1, 'birth').'</p>';
		}

/*vot*/
/*
	} elseif($fieldid=='residecountry') {
		if($field['unchangeable'] && !empty($space[$fieldid])) {
			return '<span>'.$space['residecountry'].'</span>';
		}
		if(!empty($space['residecountry'])) {
			$html = profile_show('residecountry', $space);
			$html .= '&nbsp;(<a href="javascript:;" onclick="showcountry(\'residecountrybox\', [\'residecountry\'], 4, \'\', \'reside\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
			$html .= '<p id="residecountrybox"></p>';
		} else {
			$html = '<p id="residecountrybox">'.showcountry($values, $elems, 'residecountrybox', 1, 'reside').'</p>';
		}
*/
	} elseif($fieldid=='residecity') {
		if($field['unchangeable'] && !empty($space[$fieldid])) {
			return '<span>'.$space['resideprovince'].'-'.$space['residecity'].'</span>';
		}
		$values = array(0,0,0,0);
		$elems = array('resideprovince', 'residecity', 'residedist', 'residecommunity');
		if(!empty($space['resideprovince'])) {
			$html = profile_show('residecity', $space);
			$html .= '&nbsp;(<a href="javascript:;" onclick="showdistrict(\'residedistrictbox\', [\'resideprovince\', \'residecity\', \'residedist\', \'residecommunity\'], 4, \'\', \'reside\'); return false;">'.lang('spacecp', 'profile_edit').'</a>)';
			$html .= '<p id="residedistrictbox"></p>';
		} else {
			$html = '<p id="residedistrictbox">'.showdistrict($values, $elems, 'residedistrictbox', 1, 'reside').'</p>';
		}
	} elseif($fieldid=='qq') {
		$html = "<input type=\"text\" name=\"$fieldid\" id=\"$fieldid\" class=\"px\" value=\"$space[$fieldid]\" tabindex=\"1\" /><p><a href=\"\" class=\"xi2\" onclick=\"this.href='http://wp.qq.com/set.html?from=discuz&uin='+$('$fieldid').value\" target=\"_blank\">".lang('spacecp', 'qq_set_status')."</a></p>";
	} else {
		if($field['unchangeable'] && $space[$fieldid]!='') {
			if($field['formtype']=='file') {
				$imgurl = getglobal('setting/attachurl').'./profile/'.$space[$fieldid];
				return '<span><a href="'.$imgurl.'" target="_blank"><img src="'.$imgurl.'"  style="max-width: 500px;" /></a></span>';
			} else {
				return '<span>'.nl2br($space[$fieldid]).'</span>';
			}
		}
		if($field['formtype']=='textarea') {
			$html = "<textarea name=\"$fieldid\" id=\"$fieldid\" class=\"pt\" rows=\"3\" cols=\"40\" tabindex=\"1\">$space[$fieldid]</textarea>";
		} elseif($field['formtype']=='select') {
			$field['choices'] = explode("\n", $field['choices']);
			$html = "<select name=\"$fieldid\" id=\"$fieldid\" class=\"ps\" tabindex=\"1\">";
			foreach($field['choices'] as $op) {
				$html .= "<option value=\"$op\"".($op==$space[$fieldid] ? 'selected="selected"' : '').">$op</option>";
			}
			$html .= '</select>';
		} elseif($field['formtype']=='list') {
			$field['choices'] = explode("\n", $field['choices']);
			$html = "<select name=\"{$fieldid}[]\" id=\"$fieldid\" class=\"ps\" multiple=\"multiplue\" tabindex=\"1\">";
			$space[$fieldid] = explode("\n", $space[$fieldid]);
			foreach($field['choices'] as $op) {
				$html .= "<option value=\"$op\"".(in_array($op, $space[$fieldid]) ? 'selected="selected"' : '').">$op</option>";
			}
			$html .= '</select>';
		} elseif($field['formtype']=='checkbox') {
			$field['choices'] = explode("\n", $field['choices']);
			$space[$fieldid] = explode("\n", $space[$fieldid]);
			foreach($field['choices'] as $op) {
				$html .= ''
					."<label class=\"lb\"><input type=\"checkbox\" name=\"{$fieldid}[]\" id=\"$fieldid\" class=\"pc\" value=\"$op\" tabindex=\"1\"".(in_array($op, $space[$fieldid]) ? ' checked="checked"' : '')." />"
					."$op</label>";
			}
		} elseif($field['formtype']=='radio') {
			$field['choices'] = explode("\n", $field['choices']);
			foreach($field['choices'] as $op) {
				$html .= ''
						."<label class=\"lb\"><input type=\"radio\" name=\"{$fieldid}\" class=\"pr\" value=\"$op\" tabindex=\"1\"".($op == $space[$fieldid] ? ' checked="checked"' : '')." />"
						."$op</label>";
			}
		} elseif($field['formtype']=='file') {
			$html = "<input type=\"file\" value=\"\" name=\"$fieldid\" id=\"$fieldid\" tabindex=\"1\" class=\"pf\" style=\"height:26px;\" /><input type=\"hidden\" name=\"$fieldid\" value=\"$space[$fieldid]\" />";
			if(!empty($space[$fieldid])) {
				$url = getglobal('setting/attachurl').'./profile/'.$space[$fieldid];
				$html .= "&nbsp;<label><input type=\"checkbox\" class=\"checkbox\" tabindex=\"1\" name=\"deletefile[$fieldid]\" id=\"$fieldid\" value=\"yes\" />".lang('spacecp', 'delete')."</label><br /><a href=\"$url\" target=\"_blank\"><img src=\"$url\" width=\"200\" class=\"mtm\" /></a>";
			}
		} else {
			$html = "<input type=\"text\" name=\"$fieldid\" id=\"$fieldid\" class=\"px\" value=\"$space[$fieldid]\" tabindex=\"1\" />";
		}
	}
	$html .= !$ignoreshowerror ? "<div class=\"rq mtn\" id=\"showerror_$fieldid\"></div>" : '';
	if($showstatus) {
		$html .= "<p class=\"d\">$value[description]";
		if($space[$fieldid]=='' && $value['unchangeable']) {
			$html .= lang('spacecp', 'profile_unchangeable');
		}
		if($verifyvalue !== null) {
			if($field['formtype'] == 'file') {
				$imgurl = getglobal('setting/attachurl').'./profile/'.$verifyvalue;
				$verifyvalue = "<img src='$imgurl' alt='$imgurl' style='max-width: 500px;'/>";
			}
			$html .= "<strong>".lang('spacecp', 'profile_is_verifying')." (<a href=\"#\" onclick=\"display('newvalue_$fieldid');return false;\">".lang('spacecp', 'profile_mypost')."</a>)</strong>"
				."<p id=\"newvalue_$fieldid\" style=\"display:none\">".$verifyvalue."</p>";
		} elseif($field['needverify']) {
			$html .= lang('spacecp', 'profile_need_verifying');
		}
		$html .= '</p>';
	}

	return $html;
}