コード例 #1
0
function task_csc($task = array())
{
    global $discuz_uid;
    include_once DISCUZ_ROOT . './uc_client/client.php';
    if (uc_check_avatar($discuz_uid)) {
        return true;
    }
    return array('csc' => 0, 'remaintime' => 0);
}
コード例 #2
0
<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: spacecp_avatar.php 18515 2010-11-25 07:35:31Z zhengqingpeng $
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if (submitcheck('avatarsubmit')) {
    showmessage('do_success', 'cp.php?ac=avatar&quickforward=1');
}
loaducenter();
$uc_avatarflash = uc_avatar($_G['uid'], 'virtual', 0);
if (empty($space['avatarstatus']) && uc_check_avatar($_G['uid'], 'middle')) {
    DB::update('common_member', array('avatarstatus' => '1'), array('uid' => $_G['uid']));
    updatecreditbyaction('setavatar');
    manyoulog('user', $_G['uid'], 'update');
}
$actives = array('avatar' => ' class="a"');
include template("home/spacecp_avatar");
コード例 #3
0
 case 'space':
     $feed_hash_data = "uid{$id}";
     $tospace = getspace($id);
     if (empty($tospace)) {
         showmessage('space_does_not_exist');
     }
     if (isblacklist($tospace['uid'])) {
         showmessage('is_blacklist');
     }
     $arr['itemid'] = $id;
     $arr['fromuid'] = $id;
     $arr['title_template'] = lang('spacecp', 'share_space');
     $arr['body_template'] = '<b>{username}</b><br>{reside}<br>{spacenote}';
     $arr['body_data'] = array('username' => "<a href=\"home.php?mod=space&uid={$id}\">" . $tospace['username'] . "</a>", 'reside' => $tospace['resideprovince'] . $tospace['residecity'], 'spacenote' => $tospace['spacenote']);
     loaducenter();
     $isavatar = uc_check_avatar($id);
     $arr['image'] = $isavatar ? avatar($id, 'middle', true) : UC_API . '/images/noavatar_middle.gif';
     $arr['image_link'] = "home.php?mod=space&uid={$id}";
     $note_uid = $id;
     $note_message = 'share_space';
     break;
 case 'blog':
     $feed_hash_data = "blogid{$id}";
     $query = DB::query("SELECT b.*,bf.pic,bf.message,bf.hotuser 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.blogid='{$id}'");
     if (!($blog = DB::fetch($query))) {
         showmessage('blog_does_not_exist');
     }
     if (in_array($blog['status'], array(1, 2))) {
         showmessage('moderate_blog_not_share');
     }
     if ($blog['friend']) {
コード例 #4
0
 public function getAvatar($userId, $size = 'middle')
 {
     $this->initDiscuzApi();
     if (uc_check_avatar($userId)) {
         return UC_API . "/avatar.php?uid=" . $userId . "&type=virtual&size=" . $size;
     } else {
         return null;
     }
 }
コード例 #5
0
ファイル: ucenter.php プロジェクト: hotmob/likedome
 function submenu_customize_icon()
 {
     echo '<div class="wrap">';
     echo '<h2>' . __('Customize Icon', 'ucenter') . '</h2>';
     global $current_user;
     wp_get_current_user();
     list($uid, $_, $_) = uc_get_user($current_user->user_login);
     $icons = array('big' => __('Big Icon', 'ucenter'), 'middle' => __('Middle Icon', 'ucenter'), 'small' => __('Small Icon', 'ucenter'));
     echo '<div id="icon_list">';
     foreach ($icons as $size => $name) {
         if (uc_check_avatar($uid, $size) > 0) {
             echo "{$name}<br /><img src='" . UC_API . "/avatar.php?uid={$uid}&size={$size}&random=" . rand() . "' /><br />";
         }
     }
     echo '</div><div id="icon_show">';
     $html = uc_avatar($uid);
     echo $html;
     echo '</div></div>';
 }
コード例 #6
0
 function __construct($kptime = -1, $cache = FALSE)
 {
     global $dsql;
     if ($kptime == -1) {
         $this->M_KeepTime = 3600 * 24 * 7;
     } else {
         $this->M_KeepTime = $kptime;
     }
     $formcache = FALSE;
     $this->M_ID = $this->GetNum(GetCookie("DedeUserID"));
     $this->M_LoginTime = GetCookie("DedeLoginTime");
     $this->fields = array();
     $this->isAdmin = FALSE;
     if (empty($this->M_ID)) {
         $this->ResetUser();
     } else {
         $this->M_ID = intval($this->M_ID);
         if ($cache) {
             $this->fields = GetCache($this->memberCache, $this->M_ID);
             if (empty($this->fields)) {
                 $this->fields = $dsql->GetOne("Select * From `#@__member` where mid='{$this->M_ID}' ");
             } else {
                 $formcache = TRUE;
             }
         } else {
             $this->fields = $dsql->GetOne("Select * From `#@__member` where mid='{$this->M_ID}' ");
         }
         if (is_array($this->fields)) {
             #api{{
             if (defined('UC_API') && @(include_once DEDEROOT . '/uc_client/client.php')) {
                 if ($data = uc_get_user($this->fields['userid'])) {
                     if (uc_check_avatar($data[0]) && !strstr($this->fields['face'], UC_API)) {
                         $this->fields['face'] = UC_API . '/avatar.php?uid=' . $data[0] . '&size=middle';
                         $dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `face`='" . $this->fields['face'] . "' WHERE `mid`='{$this->M_ID}'");
                     }
                 }
             }
             #/aip}}
             //间隔一小时更新一次用户登录时间
             if (time() - $this->M_LoginTime > 3600) {
                 $dsql->ExecuteNoneQuery("update `#@__member` set logintime='" . time() . "',loginip='" . GetIP() . "' where mid='" . $this->fields['mid'] . "';");
                 PutCookie("DedeLoginTime", time(), $this->M_KeepTime);
             }
             $this->M_LoginID = $this->fields['userid'];
             $this->M_MbType = $this->fields['mtype'];
             $this->M_Money = $this->fields['money'];
             $this->M_UserName = FormatUsername($this->fields['uname']);
             $this->M_Scores = $this->fields['scores'];
             $this->M_Face = $this->fields['face'];
             $this->M_Rank = $this->fields['rank'];
             $this->M_Spacesta = $this->fields['spacesta'];
             $sql = "Select titles From #@__scores where integral<={$this->fields['scores']} order by integral desc";
             $scrow = $dsql->GetOne($sql);
             $this->fields['honor'] = $scrow['titles'];
             $this->M_Honor = $this->fields['honor'];
             if ($this->fields['matt'] == 10) {
                 $this->isAdmin = TRUE;
             }
             $this->M_UpTime = $this->fields['uptime'];
             $this->M_ExpTime = $this->fields['exptime'];
             $this->M_JoinTime = MyDate('Y-m-d', $this->fields['jointime']);
             if ($this->M_Rank > 10 && $this->M_UpTime > 0) {
                 $this->M_HasDay = $this->Judgemember();
             }
             if (!$formcache) {
                 SetCache($this->memberCache, $this->M_ID, $this->fields, 1800);
             }
         } else {
             $this->ResetUser();
         }
     }
 }
コード例 #7
0
ファイル: user.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function UpdateAvatar()
 {
     if (MEMBER_ID > 0) {
         $m = jsg_member_info(MEMBER_ID);
         if ($m && !$m['__face__'] && $m['ucuid'] > 0 && true === UCENTER && true === UCENTER_FACE) {
             include_once ROOT_PATH . 'api/uc_client/client.php';
             $r = uc_check_avatar($m['ucuid']);
             if ($r) {
                 DB::query("update " . TABLE_PREFIX . "members set `face`='./images/noavatar.gif' where `uid`='{$m['uid']}'");
             }
         }
     }
     exit;
 }
コード例 #8
0
ファイル: topic.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function _member($uid = 0)
 {
     $member = array();
     if ($uid < 1) {
         $member = jsg_member_info_by_mod();
     }
     $uid = (int) ($uid ? $uid : MEMBER_ID);
     if ($uid > 0 && !$member) {
         $member = $this->TopicLogic->GetMember($uid);
     }
     if (!$member) {
         return false;
     }
     $uid = $member['uid'];
     if (!$member['follow_html'] && $uid != MEMBER_ID && MEMBER_ID > 0) {
         $member['follow_html'] = buddy_follow_html($member, 'uid', 'follow_html', 1);
     }
     if (true === UCENTER_FACE && MEMBER_ID == $uid && MEMBER_UCUID > 0 && !$member['__face__']) {
         include_once ROOT_PATH . './api/uc_client/client.php';
         $uc_check_result = uc_check_avatar(MEMBER_UCUID);
         if ($uc_check_result) {
             $this->DatabaseHandler->Query("update " . TABLE_PREFIX . "members set `face`='./images/noavatar.gif' where `uid`='{$uid}'");
         }
     }
     if ($GLOBALS['_J']['plugins']['func']['printuser']) {
         jlogic('plugin')->hookscript('printuser', 'funcs', $member, 'printuser');
     }
     return $member;
 }
コード例 #9
0
ファイル: cp_profile.php プロジェクト: hongz1125/devil
    } elseif ($ucresult == -5) {
        showmessage('email_not_registered');
    } elseif ($ucresult == -6) {
        showmessage('email_has_been_registered');
    } elseif ($ucresult == -7) {
        showmessage('no_change');
    } elseif ($ucresult == -8) {
        showmessage('protection_of_users');
    }
    sclearcookie();
    showmessage('getpasswd_succeed', geturl('action/login'));
}
$op = trim($_GET['op']);
if ($op == 'avatar') {
    $uc_avatarflash = uc_avatar($_SGLOBAL['supe_uid']);
    include_once S_ROOT . './uc_client/client.php';
    if (uc_check_avatar($_SGLOBAL['supe_uid'])) {
        if (!$_SGLOBAL['member']['avatar']) {
            getreward('setavatar');
            updatetable('members', array('avatar' => 1), array('uid' => $_SGLOBAL['supe_uid']));
        }
    }
} elseif ($op == 'email') {
    if (empty($_SGLOBAL['email'])) {
        $userinfo = uc_get_user($_SGLOBAL['supe_username']);
        $email = $userinfo[2];
    } else {
        $email = $_SGLOBAL['email'];
    }
}
include template('cp_profile');
コード例 #10
0
 function Main()
 {
     $member = jsg_member_info(MEMBER_ID);
     $_act_list = array('imjiqiren' => 1, 'qqrobot' => 1, 'sms' => 1, 'sina' => 1, 'qqwb' => 1);
     if (isset($_act_list[$this->Code])) {
         $this->Messager(null, "index.php?mod=tools&code={$this->Code}");
     }
     if ('email' == $this->Code) {
         $this->Messager(null, 'index.php?mod=settings&code=base#modify_email_area');
     }
     $act_list = array('base' => '我的资料', 'face' => '我的头像', 'secret' => '修改密码', 'user_tag' => array('name' => '我的标签', 'link_mod' => 'user_tag'), 'vip_intro' => array('name' => '申请V认证', 'link_mod' => 'other', 'link_code' => 'vip_intro'));
     if ($member['validate'] && $member['validate_extra']) {
         $act_list['validate_extra'] = '专题设置';
     }
     if ($this->Config['sendmailday'] && $this->Config['sendmailday'] > 0) {
         $act_list['sendmail'] = '邮件提醒';
     }
     if ($this->Config['vest_enable']) {
         $act_list['vest'] = '我的马甲';
     }
     $this->Code = $act = $this->Code ? $this->Code : 'base';
     $member_nickname = $member['nickname'];
     if ('face' == $act) {
         if (true === UCENTER_FACE && true === UCENTER) {
             include_once ROOT_PATH . './api/uc_client/client.php';
             $uc_avatarflash = uc_avatar(MEMBER_UCUID, 'avatar', 'returnhtml');
             $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "members where `uid`='{$member['uid']}'");
             $_member_info = $query->GetRow();
             if ($member['uid'] > 0 && MEMBER_UCUID > 0 && !$_member_info['face']) {
                 $uc_check_result = uc_check_avatar(MEMBER_UCUID);
                 if ($uc_check_result) {
                     $this->DatabaseHandler->Query("update " . TABLE_PREFIX . "members set `face`='./images/noavatar.gif' where `uid`='{$member['uid']}'");
                 }
             }
         } elseif (true === UCENTER_FACE && true === PWUCENTER) {
             $pwuc_avatarflash = true;
             $pwurl_setuserface = UC_API . '/profile.php?action=modify&info_type=face';
         } else {
             $temp_face = '';
             if ($this->Get['temp_face'] && is_image($this->Get['temp_face'])) {
                 $temp_face = $this->Get['temp_face'];
                 $member['face_original'] = $temp_face;
             }
         }
     } elseif ('base' == $act) {
         $op = jget('op');
         $groupProfile = jconf::get('groupprofile');
         $sql = "select * from `" . TABLE_PREFIX . "memberfields` where `uid`='{$member['uid']}'";
         $query = $this->DatabaseHandler->Query($sql);
         $memberfields = $query->GetRow();
         if (!$memberfields) {
             $memberfields = array();
             $memberfields['uid'] = $member['uid'];
             $sql = "insert into `" . TABLE_PREFIX . "memberfields` (`uid`) values ('{$member['uid']}')";
             $this->DatabaseHandler->Query($sql);
         }
         $privacy = array();
         if ($memberfields['profile_set']) {
             $privacy = unserialize($memberfields['profile_set']);
         }
         #附加信息
         $member_profile = DB::fetch_first("select * from `" . TABLE_PREFIX . "members_profile` where `uid` = '{$member['uid']}'");
         if ($member_profile) {
             if ($member_profile['birthcity']) {
                 $birthcity = explode('-', $member_profile['birthcity']);
                 $b_province = $birthcity[0];
                 $b_city = $birthcity[1];
                 $b_area = $birthcity[2];
                 $b_street = $birthcity[3];
             }
             $member = array_merge($member_profile, $member);
         }
         $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "common_district where `upid` = '0' order by list");
         while ($rsdb = $query->GetRow()) {
             $province[$rsdb['id']]['value'] = $rsdb['id'];
             $province[$rsdb['id']]['name'] = $rsdb['name'];
             if ($member['province'] == $rsdb['name']) {
                 $province_id = $rsdb['id'];
             }
         }
         $b_province_list = jform()->Select("b_province", $province, $b_province, "onchange=\"changeProvince('b');\"");
         if (@is_file(ROOT_PATH . 'include/logic/cp.logic.php') && $this->Config['company_enable']) {
             if ($member['companyid']) {
                 $canmod = false;
             } else {
                 $canmod = true;
             }
             $companyselect = $this->CpLogic->get_cp_html($member['companyid'], 'company', 0, $canmod);
             if ($this->Config['department_enable']) {
                 if ($member['departmentid']) {
                     $danmod = false;
                 } else {
                     $danmod = true;
                 }
                 $departmentselect = $this->CpLogic->get_cp_html($member['departmentid'], 'department', $member['companyid'], $danmod);
             }
             if ($member['jobid']) {
                 $janmod = false;
             } else {
                 $janmod = true;
             }
             $jobselect = jlogic('job')->get_job_select($member['jobid'], $janmod);
             $morcompanys = $this->CpLogic->get_cp_users();
         }
         $gender_radio = jform()->Radio('gender', array(1 => array('name' => '男', 'value' => 1), 2 => array('name' => '女', 'value' => 2)), $member['gender']);
         $_options = array('0' => array('name' => '请选择', 'value' => '0'), '身份证' => array('name' => '身份证', 'value' => '身份证'), '学生证' => array('name' => '学生证', 'value' => '学生证'), '军官证' => array('name' => '军官证', 'value' => '军官证'), '护照' => array('name' => '护照', 'value' => '护照'), '营业执照' => array('name' => '营业执照', 'value' => '营业执照'), '官方公函' => array('name' => '官方公函', 'value' => '官方公函'), '驾驶证' => array('name' => '驾驶证', 'value' => '驾驶证'), '其他' => array('name' => '其他', 'value' => '其他'));
         $validate_card_type_select = jform()->Select('validate_card_type', $_options, $memberfields['validate_card_type']);
         $province_list = jform()->Select("province", $province, $province_id, "onchange=\"changeProvince();\"");
         if ($province_id) {
             if ($member['city']) {
                 $hid_city = DB::result_first("select `id` from " . TABLE_PREFIX . "common_district where name = '{$member['city']}' and upid = '{$province_id}'");
             }
             if ($hid_city) {
                 if ($member['area']) {
                     $hid_area = DB::result_first("select `id` from " . TABLE_PREFIX . "common_district where name = '{$member['area']}' and upid = '{$hid_city}'");
                 }
                 if ($hid_area) {
                     if ($member['street']) {
                         $hid_street = DB::result_first("select `id` from " . TABLE_PREFIX . "common_district where name = '{$member['street']}' and upid = '{$hid_area}'");
                     }
                 }
             }
         }
     } elseif ('user_medal' == $act) {
         if ($this->Config[sina_enable] && sina_weibo_init($this->Config)) {
             $sina = sina_weibo_has_bind(MEMBER_ID);
         }
         if ($this->Config[imjiqiren_enable] && imjiqiren_init($this->Config)) {
             $imjiqiren = imjiqiren_has_bind(MEMBER_ID);
         }
         if ($this->Config[sms_enable] && sms_init($this->Config)) {
             $sms = sms_has_bind(MEMBER_ID);
         }
         if ($this->Config[qqwb_enable] && qqwb_init($this->Config)) {
             $qqwb = qqwb_bind_icon(MEMBER_ID);
         }
         $sql = "select  MD.medal_img , MD.medal_name ,  UM.* from `" . TABLE_PREFIX . "user_medal` UM left join `" . TABLE_PREFIX . "medal` MD on UM.medalid=MD.id where UM.uid='" . MEMBER_ID . " ' ";
         $query = $this->DatabaseHandler->Query($sql);
         $medal_list = array();
         $medal_ids = array();
         while (false != ($row = $query->GetRow())) {
             $medal_list[] = $row;
             $medal_ids[$row['medalid']] = $row['medalid'];
         }
         $medal_ids_str = implode(",", $medal_ids);
         $_member = DB::fetch_first("select * from " . TABLE_PREFIX . "members where `uid`='" . MEMBER_ID . "'");
         if ($medal_ids_str != $_member['medal_id']) {
             $this->DatabaseHandler->Query("update " . TABLE_PREFIX . "members set medal_id='{$medal_ids_str}' where `uid`='" . MEMBER_ID . "'");
         }
     } elseif ('exp' == $act) {
         $experience = jconf::get('experience');
         $exp_list = $experience['list'];
         $mylevel = $member['level'];
         $my_credits = $member['credits'];
         foreach ($exp_list as $v) {
             if ($my_credits >= $v['start_credits']) {
                 $my_level = $v['level'];
             }
         }
         if ($mylevel != $my_level) {
             $sql = "update `" . TABLE_PREFIX . "members` set `level`='{$my_level}' where `uid`='" . MEMBER_ID . "'";
             $this->DatabaseHandler->Query($sql);
             $sql = "select `level` from `" . TABLE_PREFIX . "members` where `uid`='" . MEMBER_ID . "' ";
             $query = $this->DatabaseHandler->Query($sql);
             $members = $query->GetRow();
             $member['level'] = $members['level'];
         }
         $my_level_begin_credits = $exp_list[$my_level]['start_credits'];
         $next_level = $my_level + 1;
         $next_level_begin_credits = $exp_list[$next_level]['start_credits'];
         $my_exp = $my_credits - $my_level_begin_credits;
         $nex_exp = $next_level_begin_credits - $my_level_begin_credits;
         $level_width_arr = array('1' => '27', '2' => '31', '3' => '45', '4' => '51', '5' => '62', '6' => '68', '7' => '77', '8' => '82', '9' => '93', '10' => '107');
         $level_width = $my_exp * $level_width_arr[$my_level] / $nex_exp;
         $exp_width_arr = array('1' => '15', '2' => '41', '3' => '72', '4' => '116', '5' => '166', '6' => '229', '7' => '296', '8' => '372', '9' => '451', '10' => '545');
         $exp_width = 100 * (($level_width + $exp_width_arr[$my_level]) / 569);
         $nex_exp_credit = $next_level_begin_credits - $my_credits;
     } elseif ('validate_extra' == $act) {
         $sql = "select `validate_extra` from `" . TABLE_PREFIX . "memberfields` where `uid` = '" . MEMBER_ID . "' ";
         $query = $this->DatabaseHandler->Query($sql);
         $memberfields = $query->GetRow();
         $meb_fields = @unserialize($memberfields['validate_extra']);
         if ($meb_fields['vote']) {
             $sql = "select * from `" . TABLE_PREFIX . "vote` where `uid` = '" . MEMBER_ID . "' order by `vid` desc limit 0,10 ";
             $query = $this->DatabaseHandler->Query($sql);
             $vote_list = array();
             while (false != ($row = $query->GetRow())) {
                 $vote_list[] = $row;
             }
         }
         Load::logic('validate_extra');
         $this->ValidateExtraLogic = new ValidateExtraLogic();
         $uid = MEMBER_ID;
         $extra = $this->ValidateExtraLogic->get_info($uid);
         $id = $extra['id'];
         $data = $extra['data'];
     } elseif ('qqrobot' == $act) {
         if (empty($member['qq'])) {
             $qq_code = $member['uid'] . "j" . md5($member['password'] . $member['username']);
         }
     } elseif ('extcredits' == $act) {
         if (!$this->Config['extcredits_enable']) {
             $this->Messager("积分功能未启用", null);
         }
         $this->Title = '积分管理';
         $this->MetaKeywords = '积分兑换,积分管理,积分规则,积分详情';
         $this->MetaDescription = '积分兑换,积分管理,积分规则,积分详情';
         $top_credit_members = jlogic('mall')->get_top_member_credits();
         $feeds = jlogic('feed')->get_feed(5, "`action`='兑换了'");
         $config = jconf::get('mall');
         $css['rule'] = ' class="current"';
         $credits_config = $this->Config['credits'];
         $_default_credits = array();
         $_enable = false;
         if (is_array($credits_config) && count($credits_config)) {
             foreach ($credits_config['ext'] as $_k => $_v) {
                 if ($_v['enable']) {
                     $_enable = true;
                     if ($_v['default']) {
                         $_default_credits[$_k] = $_v['default'];
                     }
                 }
             }
         }
         if (!$_enable) {
             $this->Messager("积分未设置", null);
         }
         $op = $this->Get['op'];
         $op_lists = array('base' => '我的积分', 'detail' => '积分详情', 'rule' => '积分规则');
         $op = isset($op_lists[$op]) ? $op : 'base';
         if ('base' == $op) {
             $_search = $_replace = array();
             for ($i = 1; $i <= 8; $i++) {
                 $k = 'extcredits' . $i;
                 $_search[$k] = '$member[' . $k . ']';
                 $_replace[$k] = ' 0 ';
                 if (isset($credits_config['ext'][$k]) && $credits_config['ext'][$k]['enable']) {
                     $_replace[$k] = $credits_config['ext'][$k]['name'];
                 }
             }
             $_search['topic_count'] = '$member[topic_count]';
             $_replace['topic_count'] = '发微博数量';
             $credits_config_formula = str_replace($_search, $_replace, $credits_config['formula']);
         } elseif ('log' == $op) {
             $query = $this->DatabaseHandler->Query("select R.rulename,R.action,R.related,RL.* from " . TABLE_PREFIX . "credits_rule_log RL left join " . TABLE_PREFIX . "credits_rule R on R.rid=RL.rid where RL.`uid`='" . MEMBER_ID . "'");
             $log_list = array();
             while ($row = $query->GetRow()) {
                 $log_list[$row['action']] = $row;
             }
             if ($_default_credits) {
                 $log_list['default_credits'] = $_default_credits;
                 $log_list['default_credits']['rulename'] = '注册时的初始积分';
                 $log_list['default_credits']['total'] = $log_list['default_credits']['cyclenum'] = 1;
             }
             $_counts = array();
             foreach ($log_list as $k => $row) {
                 $row['dateline'] = $row['dateline'] ? my_date_format($row['dateline'], 'm-d H:i') : ' - ';
                 foreach ($credits_config['ext'] as $_k => $_v) {
                     if (!in_array($k, array('attach_down', 'down_my_attach', 'convert', 'unconvert'))) {
                         $row[$_k] = $row[$_k] * $row['total'];
                     }
                     $_counts[$_k] += $row[$_k];
                 }
                 if (strpos($row['action'], '_C') !== false || strpos($row['action'], '_D') !== false) {
                     $row['related'] = jlogic('channel')->id2subject($row['related']);
                 }
                 $log_list[$k] = $row;
             }
         } elseif ('detail' == $op) {
             $uid = MEMBER_ID;
             $rule = jconf::get('credits_rule');
             foreach ($rule as $key => $value) {
                 $rule_id[$value['rid']] = $value['rulename'];
             }
             $credits_field = array();
             foreach ($GLOBALS['_J']['config']['credits']['ext'] as $key => $value) {
                 $credits_field[] = $key;
             }
             $list = jtable('credits_log')->get(array('sql_where' => "uid = {$uid}", 'sql_order' => 'id desc', 'page_num' => 20));
             foreach ($list['list'] as $key => $value) {
                 $log_list[$key]['rid'] = $value['rid'];
                 $log_list[$key]['rulename'] = $rule_id[$value['rid']];
                 $log_list[$key]['dateline'] = $value['dateline'] ? my_date_format($value['dateline'], 'm-d H:i') : ' - ';
                 foreach ($credits_field as $k => $v) {
                     $log_list[$key][$v] = $value[$v];
                 }
                 if (strpos($value['remark'], '[a]') && strpos($value['remark'], '发布') === 0) {
                     $t = explode('[a]', $value['remark']);
                     $t1 = $t[1];
                     $t = parse_url($t[1]);
                     $t = $t['query'];
                     parse_str($t, $out);
                     $log_list[$key]['remark'] = "发布微博【微博ID:<a href='{$t1}' target='_blank'>{$out[code]}</a>】";
                     $log_list[$key]['detail_remark'] = "发布微博【微博ID:{$out['code']}】";
                 } else {
                     $log_list[$key]['remark'] = strlen($value['remark']) > 30 ? mb_substr($value['remark'], 0, 30, $GLOBALS['_J']['charset']) . '...' : $value['remark'];
                     $log_list[$key]['detail_remark'] = $value['remark'];
                 }
             }
         } elseif ('rule' == $op) {
             if (!($credits_rule = jconf::get('credits_rule'))) {
                 $sql = "select * from " . TABLE_PREFIX . "credits_rule order by rid";
                 $query = $this->DatabaseHandler->Query($sql);
                 $credits_rule = array();
                 while (false != ($row = $query->GetRow())) {
                     $v = false;
                     foreach ($credits_config['ext'] as $_k => $_v) {
                         if ($row[$_k]) {
                             $v = true;
                             break;
                         }
                     }
                     if ($v) {
                         foreach ($row as $k => $v) {
                             if (!$v) {
                                 unset($row[$k]);
                             }
                         }
                         $credits_rule[$row['action']] = $row;
                     }
                 }
             }
             $_cycletypes = array(0 => '一次性', 1 => '每天', 2 => '整点', 3 => '间隔分钟', 4 => '不限周期');
             if ($_default_credits) {
                 $credits_rule['default_credits'] = $_default_credits;
                 $credits_rule['default_credits']['rulename'] = '注册时的初始积分';
                 $credits_rule['default_credits']['cycletype'] = 0;
                 $credits_rule['default_credits']['rewardnum'] = 1;
             }
             $mall_enable = (int) jconf::get('mall', 'enable');
             foreach ($credits_rule as $k => $v) {
                 if ('unconvert' == $k || 'convert' == $k && empty($mall_enable)) {
                     unset($credits_rule[$k]);
                 } else {
                     $v['cycletype'] = $_cycletypes[(int) $v['cycletype']];
                     if (!$v['rewardnum']) {
                         $v['rewardnum'] = '不限次数';
                     }
                     $credits_rule[$k] = $v;
                 }
             }
         } else {
             $this->Messager("未定义的操作");
         }
     } elseif ('imjiqiren' == $act) {
         define('IN_IMJIQIREN_MOD', true);
         include ROOT_PATH . 'modules/imjiqiren.mod.php';
     } elseif ('sms' == $act) {
         define('IN_SMS_MOD', true);
         include ROOT_PATH . 'modules/sms.mod.php';
     } elseif ('qqwb' == $act) {
         if (!qqwb_init($this->Config)) {
             $this->Messager('腾讯微博功能未启用,请联系管理员', null);
         }
         $qqwb = jconf::get('qqwb');
         $qqwb_bind_info = qqwb_bind_info(MEMBER_ID);
         if ($qqwb_bind_info) {
             if ($qqwb['is_synctopic_toweibo']) {
                 $synctoqq_radio = jform()->YesNoRadio('synctoqq', (int) $qqwb_bind_info['synctoqq']);
             }
         }
     } elseif ('sina' == $act) {
         $profile_bind_message = '';
         $xwb_start_file = ROOT_PATH . 'include/ext/xwb/sina.php';
         if (!is_file($xwb_start_file)) {
             $profile_bind_message = '&#25554;&#20214;&#25991;&#20214;&#20002;&#22833;&#65292;&#26080;&#27861;&#21551;&#21160;&#65281;';
         } else {
             require $xwb_start_file;
             $profile_bind_message = '<a href="javascript:XWBcontrol.bind()">&#22914;&#26524;&#30475;&#19981;&#21040;&#26032;&#28010;&#24494;&#21338;&#32465;&#23450;&#35774;&#32622;&#31383;&#21475;&#65292;&#35831;&#28857;&#20987;&#36825;&#37324;&#21551;&#21160;&#12290;</a>';
             $GLOBALS['xwb_tips_type'] = 'bind';
             $profile_bind_message .= jsg_sina_footer();
         }
     } elseif ('email' == $act) {
     } else {
         if ('sendmail' == $act) {
             if (!$this->Config['sendmailday']) {
                 $this->Messager('本站点尚未开启邮件提醒功能。', -1);
             }
             $member['user_notice_time'] = $member['user_notice_time'] ? $member['user_notice_time'] : 3;
             $sendtime[$member['user_notice_time']] = ' selected ';
         } else {
             if ('vest' == $act) {
                 if (!$this->Config['vest_enable']) {
                     $this->Messager('本站点尚未开启马甲功能。', -1);
                 }
                 if ($this->Config['vest_role'] && false == jsg_find($this->Config['vest_role'], $member['role_id'])) {
                     $this->Messager('你所在的用户组没有添加马甲的权限', -1);
                 }
                 $vest = jlogic('member_vest')->get_member_vest(MEMBER_ID);
             } elseif ('plugin' == $act) {
                 global $_J;
                 $pluginid = jget('id');
                 if (!empty($pluginid)) {
                     list($identifier, $module) = explode(':', $pluginid);
                     $module = $module !== NULL ? $module : $identifier;
                 }
                 $plugin = jlogic('plugin')->pluginmodule($pluginid);
                 if ($plugin[0]) {
                     include $plugin[2];
                     $plugintemplate = $identifier . ':' . $module;
                     $act_list['plugin'] = $plugin[1];
                 } else {
                     $this->Messager($plugin[1]);
                 }
             }
         }
     }
     if (empty($this->Title)) {
         $this->Title = $act_list[$act];
     }
     if ('plugin' == $act) {
         include template('setting/plugin');
     } elseif ('extcredits' == $act) {
         include template('mall_rule');
     } else {
         include template('setting/setting_main');
     }
 }
コード例 #11
0
 private function _updateAvatarStatus()
 {
     global $_G;
     loaducenter();
     $uc_avatarflash = uc_avatar($_G['uid'], 'virtual', 0);
     if (empty($space['avatarstatus']) && uc_check_avatar($_G['uid'], 'middle')) {
         C::t('common_member')->update($_G['uid'], array('avatarstatus' => '1'));
         updatecreditbyaction('setavatar');
         manyoulog('user', $_G['uid'], 'update');
     }
 }
コード例 #12
0
 function Main()
 {
     if ($this->MemberHandler->HasPermission($this->Module, $this->Code) == false) {
         $this->Messager($this->MemberHandler->GetError(), null);
     }
     $act = $this->Code;
     $act_list = array('nick' => '修改昵称', 'face' => '修改头像', 'aboutme' => '个人说明', 'signature' => '个人签名', 'sex' => '选择性别', 'user_tag' => '选择标签');
     $uid = MEMBER_ID;
     $member = $this->_member($uid);
     $member = wap_iconv($member);
     if ($member['validate']) {
         $member['validate_html'] = "<img class='vipImg' title='' src='" . $this->Config['site_url'] . "/images/vip.gif' />";
     }
     if ('face' == $act) {
         if (true === UCENTER_FACE) {
             include_once ROOT_PATH . './api/uc_client/client.php';
             $uc_avatarflash = uc_avatar(MEMBER_UCUID, 'avatar', 'returnhtml');
             $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "members where `uid`='{$member['uid']}'");
             $_member_info = $query->GetRow();
             if ($member['uid'] > 0 && MEMBER_UCUID > 0 && !$_member_info['face']) {
                 $uc_check_result = uc_check_avatar(MEMBER_UCUID);
                 if ($uc_check_result) {
                     $this->DatabaseHandler->Query("update " . TABLE_PREFIX . "members set `face`='./images/noavatar.gif' where `uid`='{$member['uid']}'");
                 }
             }
         } else {
             $temp_face = '';
             if ($this->Get['temp_face'] && is_image($this->Get['temp_face'])) {
                 $temp_face = $this->Get['temp_face'];
                 $member['face_original'] = $temp_face;
             }
         }
     } elseif ('usertag' == $act) {
         $where_list = '';
         $type = $this->Get['type'];
         $user_tag_list = array();
         if ($type == 'all') {
             $sql = "Select * From `" . TABLE_PREFIX . "user_tag` Order By id desc limit 0,20;";
             $query = $this->DatabaseHandler->Query($sql);
             while (false != ($row = $query->GetRow())) {
                 $row['name'] = wap_iconv($row['name']);
                 $user_tag_list[] = $row;
             }
         } elseif ($type == 'myadd') {
             $where_list = " where `uid` = '" . MEMBER_ID . "' ";
         }
         if ($where_list) {
             $sql = "Select * From `" . TABLE_PREFIX . "user_tag_fields` {$where_list} Order By id desc limit 0,20;";
             $query = $this->DatabaseHandler->Query($sql);
             while (false != ($row = $query->GetRow())) {
                 $row['name'] = wap_iconv($row['tag_name']);
                 $row['id'] = wap_iconv($row['tag_id']);
                 $user_tag_list[] = $row;
             }
         }
     } elseif ('base' == $act) {
         $sql = "Select * From `" . TABLE_PREFIX . "user_tag_fields` where `uid` = '{$uid}' Order By id desc limit 0,10;";
         $query = $this->DatabaseHandler->Query($sql);
         $my_user_tag = array();
         while (false != ($row = $query->GetRow())) {
             $row['tag_name'] = wap_iconv($row['tag_name']);
             $my_user_tag[] = $row;
         }
     }
     $setting_hb = 'hb';
     $this->Title = $act_list[$act];
     include template('setting_main');
 }
コード例 #13
0
ファイル: ucenter.php プロジェクト: Gradven/what3.1.7
 function login($_username, $_password)
 {
     if (H::valid_email($_username)) {
         // 使用 E-mail 登录
         list($uc_uid, $username, $password, $email) = uc_user_login($_username, $_password, 2);
     }
     if ($this->ucenter_charset != 'utf-8') {
         $username = convert_encoding($username, $this->ucenter_charset, 'UTF-8');
     }
     if (!$uc_uid) {
         if ($this->ucenter_charset != 'utf-8') {
             list($uc_uid, $username, $password, $email) = uc_user_login(convert_encoding($_username, 'utf-8', $this->ucenter_charset), $_password);
             if ($username) {
                 $username = convert_encoding($username, $this->ucenter_charset, 'UTF-8');
             }
         } else {
             list($uc_uid, $username, $password, $email) = uc_user_login($_username, $_password);
         }
     }
     if ($username) {
         $username = htmlspecialchars($username);
     }
     if ($uc_uid > 0) {
         if ($user_info = $this->get_uc_user_info($uc_uid)) {
             // Update password
             $this->model('account')->update_user_password_ingore_oldpassword($_password, $user_info['uid'], $user_info['salt']);
             // Update username
             if ($user_info['user_name'] != $username) {
                 if (!$this->model('account')->check_username($username)) {
                     $this->model('account')->update_user_name($username, $user_info['uid']);
                     $this->update('users_ucenter', array('username' => htmlspecialchars($username)), 'uc_uid = ' . intval($uc_uid));
                 }
             }
         } else {
             if ($site_user_info = $this->model('account')->get_user_info_by_email($email)) {
                 $this->insert('users_ucenter', array('uid' => $site_user_info['uid'], 'uc_uid' => $uc_uid, 'username' => $username, 'email' => $email));
                 return false;
             }
             if ($new_user_id = $this->model('account')->user_register($username, $_password, $email, TRUE)) {
                 if ($exists_uc_id = $this->is_uc_user($email)) {
                     $this->update('users_ucenter', array('username' => $username, 'uid' => $new_user_id), 'uc_uid = ' . intval($exists_uc_id));
                 } else {
                     $this->insert('users_ucenter', array('uid' => $new_user_id, 'uc_uid' => $uc_uid, 'username' => $username, 'email' => $email));
                 }
                 $user_info = $this->model('account')->get_user_info_by_uid($new_user_id, true, false);
             }
         }
     }
     if (uc_check_avatar($uc_uid, 'big')) {
         if (!$user_info['avatar_file']) {
             $this->model('account')->associate_remote_avatar($user_info['uid'], UC_API . '/avatar.php?uid=' . $uc_uid . '&size=big');
         }
     } else {
         if ($user_info['avatar_file'] and get_setting('ucenter_path')) {
             $avatar = get_setting('upload_dir') . '/avatar/' . $this->model('account')->get_avatar($user_info['uid'], '');
             $uc_avatar_dir = get_setting('ucenter_path') . '/data/avatar/' . $this->model('account')->get_avatar($uc_uid, '', 1);
             if (!file_exists($uc_avatar_dir)) {
                 make_dir($uc_avatar_dir);
             }
             foreach (AWS_APP::config()->get('image')->uc_avatar_thumbnail as $key => $val) {
                 AWS_APP::image()->initialize(array('quality' => 90, 'source_image' => $avatar, 'new_image' => $uc_avatar_dir . $this->model('account')->get_avatar($uc_uid, $key, 2), 'width' => $val['w'], 'height' => $val['h']))->resize();
             }
         }
     }
     return $user_info;
 }
コード例 #14
0
function ckavatar($uid) {
	global $_SC, $_SCONFIG;

	$type = empty($_SCONFIG['avatarreal'])?'virtual':'real';
	if(empty($_SCONFIG['uc_dir'])) {
		include_once(S_ROOT.'./uc_client/client.php');
		$file_exists = uc_check_avatar($uid, 'middle', $type);
		return $file_exists;
	} else {
		$file = $_SCONFIG['uc_dir'].'./data/avatar/'.avatar_file($uid, 'middle');
		return file_exists($file)?1:0;
	}
}
コード例 #15
0
ファイル: ucenter.class.php プロジェクト: meiwenhui/hdwiki
 function doc_user_image(&$editors, $doc)
 {
     if (uc_check_avatar($editors[$doc["author"]][uid])) {
         $editors[$doc["author"]]["image"] = UC_API . "/avatar.php?uid=" . $editors[$doc["author"]][uid] . "&size=small";
     }
     if (uc_check_avatar($editors[$doc["lasteditor"]][uid])) {
         $editors[$doc["lasteditor"]]["image"] = UC_API . "/avatar.php?uid=" . $editors[$doc["lasteditor"]][uid] . "&size=small";
     }
 }
コード例 #16
0
ファイル: ucenter.php プロジェクト: Vizards/HeavenSpree
 function login($_username, $_password)
 {
     if (H::valid_email($_username)) {
         // 使用 E-mail 登录
         list($uc_uid, $username, $password, $email) = uc_user_login($_username, $_password, 2);
     }
     if ($this->ucenter_charset != 'utf-8') {
         $username = convert_encoding($username, $this->ucenter_charset, 'UTF-8');
     }
     if (!$uc_uid) {
         if ($this->ucenter_charset != 'utf-8') {
             list($uc_uid, $username, $password, $email) = uc_user_login(convert_encoding($_username, 'utf-8', $this->ucenter_charset), $_password);
             if ($username) {
                 $username = convert_encoding($username, $this->ucenter_charset, 'UTF-8');
             }
         } else {
             list($uc_uid, $username, $password, $email) = uc_user_login($_username, $_password);
         }
     }
     if ($username) {
         $username = htmlspecialchars($username);
     }
     if ($uc_uid > 0) {
         if (!($user_info = $this->get_uc_user_info($uc_uid))) {
             if ($site_user_info = $this->model('account')->get_user_info_by_email($email)) {
                 $this->insert('users_ucenter', array('uid' => $site_user_info['uid'], 'uc_uid' => $uc_uid, 'username' => $username, 'email' => $email));
                 return false;
             }
             if ($new_user_id = $this->model('account')->user_register($username, $_password, $email, TRUE)) {
                 if ($exists_uc_id = $this->is_uc_user($email)) {
                     $this->update('users_ucenter', array('username' => $username, 'uid' => $new_user_id), 'uc_uid = ' . intval($exists_uc_id));
                 } else {
                     $this->insert('users_ucenter', array('uid' => $new_user_id, 'uc_uid' => $uc_uid, 'username' => $username, 'email' => $email));
                     if (uc_check_avatar($uc_uid, 'big')) {
                         $avatar = @file_get_contents(UC_API . '/avatar.php?uid=' . $uc_uid . '&size=big');
                         if ($avatar) {
                             AWS_APP::upload()->initialize(array('allowed_types' => 'jpg,jpeg,png,gif', 'upload_path' => get_setting('upload_dir') . '/avatar/' . $this->model('account')->get_avatar($new_user_id, '', 1), 'is_image' => TRUE, 'max_size' => get_setting('upload_avatar_size_limit'), 'file_name' => $this->model('account')->get_avatar($new_user_id, '', 2), 'encrypt_name' => FALSE))->do_upload('aws_upload_file', $avatar);
                             if (!AWS_APP::upload()->get_error()) {
                                 $upload_data = AWS_APP::upload()->data();
                                 if ($upload_data) {
                                     if ($upload_data['is_image'] == 1) {
                                         foreach (AWS_APP::config()->get('image')->avatar_thumbnail as $key => $val) {
                                             $thumb_file[$key] = $upload_data['file_path'] . $this->model('account')->get_avatar($new_user_id, $key, 2);
                                             AWS_APP::image()->initialize(array('quality' => 90, 'source_image' => $upload_data['full_path'], 'new_image' => $thumb_file[$key], 'width' => $val['w'], 'height' => $val['h']))->resize();
                                         }
                                     }
                                     $update_data['avatar_file'] = $this->model('account')->get_avatar($new_user_id, null, 1) . basename($thumb_file['min']);
                                     // 更新主表
                                     $this->model('account')->update_users_fields($update_data, $new_user_id);
                                     if (!$this->model('integral')->fetch_log($new_user_id, 'UPLOAD_AVATAR')) {
                                         $this->model('integral')->process($new_user_id, 'UPLOAD_AVATAR', round(get_setting('integral_system_config_profile') * 0.2), '上传头像');
                                     }
                                 }
                             }
                         }
                     }
                 }
                 $user_info = $this->model('account')->get_user_info_by_uid($new_user_id, true, false);
             }
         } else {
             // Update password
             $this->model('account')->update_user_password_ingore_oldpassword($_password, $user_info['uid'], $user_info['salt']);
             // Update username
             if ($user_info['user_name'] != $username) {
                 if (!$this->model('account')->check_username($username)) {
                     $this->model('account')->update_user_name($username, $user_info['uid']);
                     $this->update('users_ucenter', array('username' => htmlspecialchars($username)), 'uc_uid = ' . intval($uc_uid));
                 }
             }
         }
     }
     return $user_info;
 }
コード例 #17
0
        if ($_GET['count']) {
            $max = $_GET['count'];
        } else {
            $max = DB::fetch_first("SELECT uid FROM " . DB::table('common_member') . " ORDER BY uid DESC");
            $max = $max['uid'];
        }
        if ($start >= $max) {
            cpmsg($toolslang['uc_avatar_done'], "action=plugins&pmod=maintain&cp=aboutucenter&operation={$operation}&do={$do}&mod={$mod}", 'succeed');
        }
        $query = DB::query("SELECT uid FROM " . DB::table('common_member') . " WHERE avatarstatus = '0' AND uid > '{$start}' LIMIT {$limit}");
        while ($userinfo = DB::fetch($query)) {
            $userinfos[] = $userinfo['uid'];
        }
        foreach ($userinfos as $value) {
            loaducenter();
            $hasavatar = uc_check_avatar($value);
            DB::query("UPDATE " . DB::table('common_member') . " SET avatarstatus = '{$hasavatar}' WHERE uid='{$value}'");
        }
        $nextstart = $start + $limit;
        cpmsg($toolslang['uc_avatar_jump'], "action=plugins&pmod=maintain&cp=aboutucenter&operation={$operation}&do={$do}&mod={$mod}&start={$nextstart}&max={$max}&avator_submit=yes", 'loading', array('start' => $start, 'limit' => $limit));
    }
} elseif (in_array($mod, array('synusername', 'clrnotice', 'synuid', 'clrfeed', 'avator'))) {
    showformheader("plugins&pmod=maintain&cp=aboutucenter&operation={$operation}&do={$do}&mod=" . $mod);
    showtableheaders();
    showsubmit($mod . '_submit', 'submit');
    showtablefooter();
    showformfooter();
} elseif ($mod == 'pm') {
    loaducenter();
    $uc_version = uc_check_version();
    if ($uc_version[file] >= '1.6') {