function _exec_sms_send() { $return = ''; $to = ''; $message = ''; if (sms_init($this->Config)) { @extract($this->ScheduleInfo['vars']); $return = sms_send($to, $message); } return $return; }
function pmSendAgain($post) { $message = trim($post['message']); $time = time(); if ($message == '') { return 1; } $pmid = $post['pmid']; $pm = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "pms where pmid = '{$pmid}'"); $pm_list = $pm->GetRow(); $pm_list['message'] = $message; $touid = $pm_list['msgtoid']; $uids = ''; if ($pm_list['msgtoid'] > $pm_list['msgfromid']) { $uids = $pm_list['msgfromid'] . "," . $pm_list['msgtoid']; } else { $uids = $pm_list['msgtoid'] . "," . $pm_list['msgfromid']; } if ($touid < 1) { return 5; } $to_user_list = array(); $sql = "\r\n\t\tSELECT\r\n\t\t\tuid,username,nickname,notice_pm,email,newpm\r\n\t\tFROM\r\n\t\t\t" . TABLE_PREFIX . 'members' . "\r\n\t\tWHERE\r\n\t\t\tuid = '{$touid}'"; $query = $this->DatabaseHandler->Query($sql); while ($row = $query->GetRow()) { $to_user_list[$row['uid']] = $row; } if ($to_user_list == false) { return 3; } $plid = DB::result_first("select plid from " . TABLE_PREFIX . "pms_index where uids = '{$uids}'"); if ($plid == 0) { DB::query("insert into " . TABLE_PREFIX . "pms_index (uids) values('{$uids}')"); $plid = mysql_insert_id(); $pm_list['plid'] = $plid; $lastmessage = addslashes(serialize($pm_list)); DB::query("insert into " . TABLE_PREFIX . "pms_list (plid,uid,pmnum,dateline,lastmessage) values('{$plid}'," . MEMBER_ID . ",1,'{$time}','{$lastmessage}')"); if ($pm_list['msgtoid'] != $pm_list['msgfromid']) { DB::query("insert into " . TABLE_PREFIX . "pms_list (plid,uid,pmnum,dateline,lastmessage) values('{$plid}','{$touid}',1,'{$time}','{$lastmessage}')"); } } else { $lastmessage = addslashes(serialize($pm_list)); DB::query("update " . TABLE_PREFIX . "pms_list set pmnum = pmnum + 1,dateline = '{$time}',lastmessage = '{$lastmessage}' where plid = '{$plid}'"); } DB::query("update " . TABLE_PREFIX . "pms set folder = 'inbox' ,message = '{$message}' ,dateline = '{$time}',plid = '{$plid}' where pmid = '{$pmid}'"); $num = 1; $_tmps = array_keys($to_user_list); $to_user_id_list = array(); foreach ($_tmps as $_tmp) { $_tmp = (int) $_tmp; if ($_tmp > 0) { $to_user_id_list[$_tmp] = $_tmp; } } $this->UpdateNewMsgCount($num, $to_user_id_list); foreach ($to_user_list as $user_notice) { if ($GLOBALS['_J']['config']['sendmailday'] > 0) { jtable('mailqueue')->add($user_notice, 'notice_pm'); } if ($GLOBALS['_J']['config']['imjiqiren_enable'] && imjiqiren_init()) { imjiqiren_send_message($user_notice, 'm', $GLOBALS['_J']['config']); } if ($GLOBALS['_J']['config']['sms_enable'] && sms_init()) { sms_send_message($user_notice, 'm', $GLOBALS['_J']['config']); } } if ($GLOBALS['_J']['config']['extcredits_enable'] && MEMBER_ID > 0) { update_credits_by_action('pm', MEMBER_ID, count($to_user_list)); } return 0; }
function add($p, $delete_if_exists = 0) { $rets = array(); $buddyid = (int) ($p['buddyid'] ? $p['buddyid'] : $p['touid']); $uid = $p['uid'] > 0 ? $p['uid'] : MEMBER_ID; if ($uid < 1 || $buddyid < 1 || $uid == $buddyid) { $rets['error'] = '您不能关注自己'; return $rets; } $query = DB::query("SELECT * FROM `" . TABLE_PREFIX . "members` WHERE `uid` IN ('{$uid}','{$buddyid}')"); $members = array(); while (false != ($row = DB::fetch($query))) { $members[$row['uid']] = $row; } $info = $this->info($buddyid, $uid); if (!$info) { $sys_config = jconf::get(); if (count($members) < 2) { $rets['error'] = '关注失败,TA已经消失不见了'; return $rets; } if ($sys_config['follow_limit'] > 0 && $members[$uid]['follow_count'] >= $sys_config['follow_limit']) { $rets['error'] = '本站限制关注数量为<b>' . $sys_config['follow_limit'] . '</b>人,您不能再关注更多的好友了'; return $rets; } if ($members[$buddyid]['disallow_beiguanzhu']) { $rets['error'] = '关注失败,TA设置了禁止被关注'; return $rets; } if (is_blacklist($uid, $buddyid)) { $rets['error'] = '关注失败,对方已将您拉入了黑名单'; return $rets; } $_tmps = jsg_role_check_allow('follow', $buddyid, $uid); if ($_tmps && $_tmps['error']) { return $_tmps; } jtable('buddy_follow')->add($uid, $buddyid); jtable('buddy_fans')->add($buddyid, $uid); ios_push_msg($buddyid, '你有新消息:1个粉丝'); $this->count($uid); $this->count($buddyid); if ($sys_config['sendmailday'] > 0) { jtable('mailqueue')->add($members[$buddyid], 'notice_fans'); } if ($sys_config['extcredits_enable'] && $uid > 0) { $update_credits = false; if ($members[$buddyid]['nickname']) { $update_credits = update_credits_by_action("_U" . crc32($members[$buddyid]['nickname']), $uid); } if (!$update_credits) { update_credits_by_action('buddy', $uid); } } if ($sys_config['imjiqiren_enable'] && imjiqiren_init($sys_config)) { imjiqiren_send_message($members[$buddyid], 'f'); } if ($sys_config['sms_enable'] && sms_init($sys_config)) { sms_send_message($members[$buddyid], 'f'); } } else { if ($delete_if_exists) { $this->del_info($buddyid, $uid); } } return $info; }
function SmsReset() { if (!sms_init()) { $this->Messager('还没有开启手机短信功能', null); } $sms = jpost('sms', 'txt'); $key = jpost('key', 'txt'); $rets = sms_check_verify($sms, $key); if ($rets['error']) { $this->Messager($rets['result'] . " 请返回重试,或者<a href='index.php?mod=get_password'>点此重新发起验证</a>", "index.php?mod=get_password&code=sms_send&sms={$sms}&key={$key}"); } else { if (jpost('reset_pwd_submit')) { $pwd = jpost('password'); if (empty($pwd) || $pwd != jpost('confirm') || strlen($pwd) < 6) { $this->Messager('两次输入的密码不一致!请设置5位以上的密码!', 'index.php?mod=get_password'); } $info = sms_bind_info($sms); $uid = $info['uid']; if (empty($info) || $uid < 1) { $this->Messager('此手机号未绑定任何帐号', null); } $member = jsg_member_info($uid); if (!$member) { $this->Messager("用户ID【{$uid}】已经不存在了", null); } sms_enter_verify($sms); jsg_member_edit($member['nickname'], '', '', $pwd, '', '', 1); $msg = "【{$member['uid']}】{$member['nickname']},您的新密码已重新设置为 {$pwd} ,请注意保管!"; sms_send($sms, $msg, 0); $this->Messager("新密码设置成功,现在为您转入登录界面.", $this->Config['site_url'] . "/index.php?mod=login"); } else { $act_name = '重设您的新密码'; include template('get_password_sms_reset'); } } }
private function _process_reply($data) { $totid = jfilter($data['totid'], 'int'); if ($totid > 0 && $data['touid'] > 0 && $data['uid'] != $data['touid'] && !jtable('topic_mention')->is_at($data['tid'], $data['touid'])) { if ($data['type'] == 'both' || $data['type'] == 'reply') { jtable('members')->update_count($data['touid'], 'comment_new', '+1'); } if ($GLOBALS['_J']['config']['imjiqiren_enable'] || $GLOBALS['_J']['config']['sms_enable'] || $GLOBALS['_J']['config']['sendmailday'] > 0) { $sql = "select `uid`,`username`,`nickname`,`email`,`lastactivity`,\r\n\t\t\t\t\t`newpm`,`at_new`,`event_new`,`fans_new`,`vote_new`,`dig_new`,`channel_new`,`company_new`,`qun_new`,`comment_new`,\r\n\t\t\t\t\t`email_checked`,`notice_reply`,`user_notice_time`\r\n\t\t\t\tfrom `" . TABLE_PREFIX . "members`\r\n\t\t\t\twhere `uid` = '{$data['touid']}'"; $reply_notice = DB::fetch_first($sql); if ($reply_notice) { if ($GLOBALS['_J']['config']['imjiqiren_enable'] && imjiqiren_init()) { imjiqiren_send_message($reply_notice, 'p', $GLOBALS['_J']['config']); } if ($GLOBALS['_J']['config']['sms_enable'] && sms_init()) { sms_send_message($reply_notice, 'p', $GLOBALS['_J']['config']); } if ($GLOBALS['_J']['config']['sendmailday'] > 0) { jtable('mailqueue')->add($reply_notice, 'notice_reply'); } } } } }
function _sms_register() { if (!isset($this->sms_register)) { $this->sms_register = $this->Config['sms_enable'] && $this->Config['sms_register_verify_enable'] && sms_init($this->Config); } return $this->sms_register; }
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 = '插件文件丢失,无法启动!'; } else { require $xwb_start_file; $profile_bind_message = '<a href="javascript:XWBcontrol.bind()">如果看不到新浪微博绑定设置窗口,请点击这里启动。</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'); } }
function Medal() { $act_list = jlogic('other')->act_list(); $act = $this->Code; $uid = MEMBER_ID; $member = $this->TopicLogic->GetMember(MEMBER_ID); if ($member['medal_id']) { $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']); } $view = $this->Get['view']; $all_medal = array(); if ($view == 'my') { $sql = "select u.medalid as medal_id,u.is_index,u.dateline,\r\n\t\t\t\t\t\t m.medal_img,m.medal_name,m.medal_depict,m.conditions\r\n\t\t\t\t from `" . TABLE_PREFIX . "user_medal` u\r\n\t\t\t\t\tleft join `" . TABLE_PREFIX . "medal` m on m.id = u.medalid\r\n\t\t\t\t\twhere u.uid = '{$uid}'\r\n\t\t\t\t\tand m.is_open = 1\r\n\t\t\t\t\torder by u.dateline desc"; 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); } } else { $sql = "SELECT m.id as medal_id,m.medal_img,m.medal_name,m.medal_depict,m.conditions,u.dateline,y.apply_id\r\n\t\t\t\t\tFROM " . TABLE_PREFIX . "medal m\r\n\t\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "user_medal u ON (u.medalid = m.id AND u.uid = '{$uid}')\r\n\t\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "medal_apply y ON (y.medal_id = m.id AND y.uid = '{$uid}')\r\n\t\t\t\t\tWHERE m.is_open = 1\r\n\t\t\t\t\tORDER BY u.dateline DESC,m.id"; $query = $this->DatabaseHandler->Query($sql); while ($rs = $query->GetRow()) { $rs['conditions'] = unserialize($rs['conditions']); if (in_array($rs['conditions']['type'], array('topic', 'reply', 'tag', 'invite', 'fans', 'sign')) && !$rs['dateline']) { $result = jlogic('other')->autoCheckMedal($rs['medal_id']); } } } $query = $this->DatabaseHandler->Query($sql); while ($rsdb = $query->GetRow()) { $rsdb['conditions'] = unserialize($rsdb['conditions']); if ($rsdb['is_index']) { $rsdb['show'] = 'checked'; } $all_medal[$rsdb['medal_id']] = $rsdb; } $count = count($all_medal); $this->Title = "{$this->Config['site_name']}勋章"; include template('other/topic_medal'); }
function DoModify() { $_update = false; $uid = (int) $this->Post['uid']; if ($uid < 1) { $this->Messager("请指定一个正确的UID"); } $this->ID = $uid; $member_info = jsg_member_info($uid); if (!$member_info) { $this->Messager("您要编辑的用户已经不存在了"); } if (!admin_check_allow($uid)) { $this->Messager("为安全起见,您没有编辑 <b>{$member_info['nickname']}</b> 用户信息的权限,请使用网站创始人的身份登录后再进行编辑操作。", '', 10); } if (($this->Post['role_id'] == 4 || $this->Post['role_id'] == 118) && !trim($this->Post['cause'])) { $this->Messager("请输入封杀理由", -1); } $password = get_param('password'); if ($password == '') { unset($this->Post['password']); } else { $this->Post['password_unhash'] = $password; $this->Post['password'] = jsg_member_password($password, $member_info['salt']); $_update = true; } $rets = array('0' => '【注册失败】有可能是站点关闭了注册功能', '-1' => '不合法', '-2' => '不允许注册', '-3' => '已经存在了', '-4' => 'Email 不合法,请输入正确的Email地址。', '-5' => 'Email 不允许注册,请尝试更换一个。', '-6' => 'Email 已经存在了,请尝试更换一个。'); $nickname = get_param('nickname'); if ($nickname != $member_info['nickname']) { $ret = jsg_member_checkname($nickname, 1, 0, $uid); if ($ret < 1) { $this->Messager("帐户/昵称 " . $rets[$ret]); } unset($this->Post['nickname']); $_update = true; } $username = get_param('username'); if ($username != $member_info['username']) { $ret = jsg_member_checkname($username, 0, 0, $uid); if ($ret < 1) { $this->Messager("个性域名/微博地址 " . $rets[$ret]); } unset($this->Post['username']); $_update = true; } $email_update = false; $email = get_param('email'); if ($email != $member_info['email']) { $ret = jsg_member_checkemail($email); if ($ret < 1) { $this->Messager($rets[$ret]); } unset($this->Post['email']); $_update = true; } $this->Post['role_id'] = (int) $this->Post['role_id']; if ($this->Post['role_id'] > 0) { $role = DB::fetch_first("SELECT * FROM " . DB::table('role') . " WHERE `id`='{$this->Post['role_id']}'"); if ($role) { if (!admin_check_allow($this->Post['role_id'], 1) || true === jsg_member_is_founder($uid) && 'admin' != $role['type']) { unset($this->Post['role_id'], $this->Post['role_type']); } else { $this->Post['role_type'] = $role['type']; } $login_enable = jconf::get('login_enable'); if (!$role['privilege'] || $role['privilege'] == '') { $login_enable[$uid] = $uid; } else { unset($login_enable[$uid]); } jconf::set('login_enable', $login_enable); } else { $this->messager("角色已经不存在"); } } else { unset($this->Post['role_id'], $this->Post['role_type']); } $phone = $this->Post['phone']; if ($phone) { if (!jsg_is_mobile($phone)) { $this->Messager("手机号 {$phone} 格式不对哦,请重新输入正确的号码。"); $phone = ''; unset($this->Post['phone']); } else { if (($member_phone_info = jtable('members')->info(array('phone' => $phone))) && $uid != $member_phone_info['uid']) { $this->Messager("手机号 {$phone} 已经被使用在了 【{$member_phone_info['uid']}】{$member_phone_info['nickname']} 帐户上,请返回重新输入!"); } } } else { $phone = ''; } if (sms_init()) { if ($phone) { sms_bind($uid, $phone); } else { sms_unbind($uid); } } if (@is_file(ROOT_PATH . 'include/logic/cp.logic.php') && $this->Config['company_enable']) { $this->Post['companyid'] = max(0, (int) $this->Post['companyid']); if ($this->Post['companyid'] == $member_info['companyid']) { unset($this->Post['companyid']); } else { if ($member_info['companyid'] == 0 && $this->Post['companyid'] > 0) { $this->CpLogic->update('company', $this->Post['companyid'], 1, $member_info['topic_count']); } elseif ($member_info['companyid'] > 0 && $this->Post['companyid'] == 0) { $this->CpLogic->update('company', $member_info['companyid'], -1, -$member_info['topic_count']); } else { $this->CpLogic->update('company', $member_info['companyid'], -1, -$member_info['topic_count']); $this->CpLogic->update('company', $this->Post['companyid'], 1, $member_info['topic_count']); } $this->Post['company'] = $this->CpLogic->Getone($this->Post['companyid'], 'company', 'name'); } if ($this->Config['department_enable']) { $this->Post['departmentid'] = max(0, (int) $this->Post['departmentid']); if ($this->Post['departmentid'] == $member_info['departmentid']) { unset($this->Post['departmentid']); } else { if ($member_info['departmentid'] == 0 && $this->Post['departmentid'] > 0) { $this->CpLogic->update('department', $this->Post['departmentid'], 1, $member_info['topic_count']); } elseif ($member_info['departmentid'] > 0 && $this->Post['departmentid'] == 0) { $this->CpLogic->update('department', $member_info['departmentid'], -1, -$member_info['topic_count']); } else { $this->CpLogic->update('department', $member_info['departmentid'], -1, -$member_info['topic_count']); $this->CpLogic->update('department', $this->Post['departmentid'], 1, $member_info['topic_count']); } $this->Post['department'] = $this->CpLogic->Getone($this->Post['departmentid'], 'department', 'name'); } } if ($this->Post['jobid'] == $member_info['jobid']) { unset($this->Post['jobid']); } else { $this->Post['job'] = jlogic('job')->id2subject($this->Post['jobid']); } if ($this->Post['companyid']) { $chx_cid = $this->Post['companyid']; $chx_uid = $member_info['uid']; $chx_did = $this->Post['departmentid'] ? $this->Post['departmentid'] : 0; $is_cp_usered = DB::fetch_first("SELECT * FROM " . DB::table('cp_user') . " WHERE uid = '{$chx_uid}' AND companyid = '{$chx_cid}' AND departmentid = '{$chx_did}'"); if ($is_cp_usered) { DB::query("DELETE FROM " . DB::table('cp_user') . " WHERE id = '" . $is_cp_usered['id'] . "'"); } } } $this->Post['province'] = trim(DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '" . (int) $this->Post['province'] . "'")); $this->Post['city'] = trim(DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '" . (int) $this->Post['city'] . "'")); if ($this->Post['area']) { $this->Post['area'] = trim(DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '" . (int) $this->Post['area'] . "'")); } if ($this->Post['street']) { $this->Post['street'] = trim(DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '" . (int) $this->Post['street'] . "'")); } $table1 = jtable('members')->update($this->Post, $uid); $memberfields = array('site' => $this->Post['site'], 'validate_true_name' => $this->Post['validate_true_name'], 'validate_card_type' => $this->Post['validate_card_type'], 'validate_card_id' => $this->Post['validate_card_id'], 'validate_remark' => $this->Post['validate_remark']); $table2 = jtable('memberfields')->update($memberfields, $uid); #附表2信息(members_profile) $arr2 = array(); $profileField = array('constellation', 'zodiac', 'telephone', 'address', 'zipcode', 'nationality', 'education', 'birthcity', 'graduateschool', 'pcompany', 'occupation', 'position', 'revenue', 'affectivestatus', 'lookingfor', 'bloodtype', 'height', 'weight', 'alipay', 'icq', 'yahoo', 'taobao', 'site', 'interest', 'linkaddress', 'field1', 'field2', 'field3', 'field4', 'field5', 'field6', 'field7', 'field8'); foreach ($profileField as $k => $v) { isset($this->Post[$v]) && ($arr2[$v] = trim(strip_tags($this->Post[$v]))); } if ($arr2) { $this->_updateMemberProfile($arr2, $uid); } $email_checked = $this->Post['email_checked'] ? $this->Post['email_checked'] : 0; if ($email_checked != $member_info['email_checked']) { $_update = true; } if ($_update) { $ret = jsg_member_edit($member_info['nickname'], '', $nickname, $this->Post['password_unhash'], $email, $username, 1, 1, $email_checked); $rets = array('0' => '没有做任何修改', '-1' => '帐户/昵称 不合法,含有不允许注册的字符,请尝试更换一个。', '-2' => '帐户/昵称 不允许注册,含有被保留的字符,请尝试更换一个。', '-3' => '帐户/昵称 已经存在了,请尝试更换一个。', '-4' => 'Email 不合法,请输入正确的Email地址。', '-5' => 'Email 不允许注册,请尝试更换一个。', '-6' => 'Email 已经存在了,请尝试更换一个。'); if ($ret < 1 && isset($rets[$ret])) { $this->Messager($rets[$ret]); } } load::logic('topic_manage'); $TopicManageLogic = new TopicManageLogic(); $role_id = get_param('role_id'); $cause = get_param('cause'); if ($role_id == 4 || $role_id == 118) { $TopicManageLogic->doForceOut((array) $nickname, $cause, $role_id); } elseif ($role_id != 4 && $role_id != 118 && ($member_info['role_id'] == 4 || $member_info['role_id'] == 118)) { $TopicManageLogic->doUserFree($uid); } if ($this->Config['extcredits_enable'] && $this->Post['validate'] && $this->Post['uid'] > 0) { update_credits_by_action('vip', $this->Post['uid']); } Load::logic('credits'); $CreditsLogic = new CreditsLogic(); $CreditsLogic->CountCredits($this->Post['uid']); $data = array('uid' => $uid, 'rid' => 0, 'relatedid' => MEMBER_ID, 'dateline' => time()); foreach ($GLOBALS['_J']['config']['credits']['ext'] as $key => $value) { $data[$key] = $_POST[$key] - $member_info[$key]; $remark .= $value['name'] . ' : ' . $_POST[$key . '_remark'] . ' , '; } $data['remark'] = trim($remark, ', '); jtable('credits_log')->insert($data); $this->Messager("编辑成功"); }