本文整理汇总了PHP中profile_show函数的典型用法代码示例。如果您正苦于以下问题:PHP profile_show函数的具体用法?PHP profile_show怎么用?PHP profile_show使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了profile_show函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: profile_change
/** 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: dgmdate
$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: viewthread_baseinfo
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: foreach
$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=" . rawurlencode($member['admin']) . "\" 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: libfile
}
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: getdata
//.........这里部分代码省略.........
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: array_keys
$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: avatar
$value['username'] = '<a href="home.php?mod=space&uid=' . $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> <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} <span id=\"reason_{$value['vid']}\" style=\"display: none;\">{$lang['moderate_reasonpm']} <input type=\"text\" class=\"txt\" name=\"reason[{$value['vid']}]\" style=\"margin: 0px;\"></span> <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: viewthread_custominfo
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: getblockhtml
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>" /> ';
}
}
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>";
//.........这里部分代码省略.........
示例11: _getPersonalDataInfo
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: profile_setting
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>' . ' ' . '<select id="birthmonth" name="birthmonth" onchange="showbirthday();" tabindex="1">' . '<option value="">' . lang('space', 'month') . '</option>' . $birthmonthhtml . '</select>' . ' ' . '<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 .= ' <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'])) {
//.........这里部分代码省略.........
示例13: getdata
//.........这里部分代码省略.........
$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: getdata
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: profile_setting
//.........这里部分代码省略.........
.'</select>'
.' '
.'<select name="birthmonth" id="birthmonth" class="ps" onchange="showbirthday();" tabindex="1">'
.'<option value="">'.lang('space', 'month').'</option>'
.$birthmonthhtml
.'</select>'
.' '
.'<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 .= ' (<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 .= ' (<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 .= ' (<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>';