Пример #1
0
 function ShowReminded()
 {
     if ((int) $this->Config['ajax_topic_time'] < 1) {
         exit;
     }
     $uid = max(0, (int) $this->Post['uid']);
     if ($uid < 1) {
         exit;
     }
     $fcode = jpost('fcode');
     $all_topic_notice = 'topicnew' == $fcode;
     $__my = jsg_member_info($uid);
     if (!$__my) {
         exit;
     }
     $time = TIMESTAMP;
     $is_uptime = $this->Post['is_uptime'];
     if ($is_uptime == 1) {
         DB::query("update `" . TABLE_PREFIX . "members` set `lastactivity`='{$time}' where `uid`='{$uid}'");
         cache_db('rm', "{$uid}-topic-%", 1);
         echo '<success></success>';
         echo "<script language='Javascript'>";
         echo "listTopic(0,0);";
         echo "</script>";
         exit;
     }
     $total_record = jlogic('buddy')->check_new_topic($uid, 0, 0, $all_topic_notice);
     jsg_setcookie('topnotice', 'block');
     include template('ajax_reminded');
 }
Пример #2
0
 function send()
 {
     $to_user = jfilter($this->Post['to_user'], 'txt');
     $member = DB::fetch_first("SELECT `nickname` FROM " . DB::table("members") . " WHERE `nickname`='{$to_user}'");
     if (empty($member)) {
         Mobile::error("No User", 300);
     }
     $this->Post['message'] = jpost('message', 'txt');
     $to_user = $member['nickname'];
     $data = array('to_user' => $to_user, 'message' => trim($this->Post['message']));
     $ret = $this->MyPmLogic->pmSend($data);
     if ($ret == 0) {
         Mobile::success("Success");
     } else {
         if ($ret == 1) {
             Mobile::error("Content not emtpy", 420);
         } else {
             if ($ret == 2) {
                 Mobile::error("Content not emtpy", 321);
             } else {
                 if (ret == 3) {
                     Mobile::error("Content not emtpy", 321);
                 }
             }
         }
     }
     Mobile::error("Unkonw error", 250);
 }
Пример #3
0
 function weibo_show()
 {
     $conf = jconf::get('weibo_show');
     $link_display_none_radio = $this->jishigou_form->YesNoRadio('link_display_none', (int) $conf['link_display_none']);
     if (jpost('settingsubmit')) {
         $conf['link_display_none'] = jpost('link_display_none') ? 1 : 0;
         jconf::set('weibo_show', $conf);
         $this->Messager('设置成功了');
     }
     include template();
 }
Пример #4
0
 function DoSend($folder = '')
 {
     if (MEMBER_ID < 1) {
         $this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=login');
     }
     $this->Post['message'] = jpost('message', 'txt');
     load::logic('pm');
     $PmLogic = new PmLogic();
     $return = $PmLogic->pmSend($this->Post);
     switch ($return) {
         case '1':
             $this->Messager("内容不能为空");
             break;
         case '2':
             $this->Messager("收件人不能为空");
             break;
         case '3':
             $this->Messager("收件人不存在");
             break;
         case '4':
             $this->Messager("消息已经保存草稿箱", "index.php?mod=pm&code=list&folder=outbox");
             break;
         case '5':
             $this->Messager("信息不存在或已删除");
         case '6':
             $this->Messager("所在用户组没有发私信的权限");
         case '7':
         default:
             if ($return && is_string($return)) {
                 $this->Messager($return);
             }
             break;
     }
     $folder = $folder ? $folder : 'inbox';
     $this->Messager(NULL, "index.php?mod=pm&code=list&folder={$folder}");
 }
Пример #5
0
 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');
         }
     }
 }
Пример #6
0
 function create()
 {
     if (!$this->MemberHandler->HasPermission($this->Module, $this->Code)) {
         json_error($this->MemberHandler->GetError());
     }
     $post = $this->Post;
     $post['name'] = jpost('name', 'txt');
     if (!$post['name']) {
         json_error("请输入活动标题");
     }
     $f_rets = filter($post['name']);
     if ($f_rets && $f_rets['error']) {
         json_error("活动标题" . $f_rets['msg']);
     }
     if (!$post['content1']) {
         json_error("请输入活动描述");
     }
     $f_rets = filter($post['content1']);
     if ($f_rets && $f_rets['error']) {
         json_error("活动描述" . $f_rets['msg']);
     }
     $post['address'] = jpost('address', 'txt');
     if (!$post['address']) {
         json_error("请输入活动地址");
     }
     $f_rets = filter($post['address']);
     if ($f_rets && $f_rets['error']) {
         json_error("活动地址" . $f_rets['msg']);
     }
     if ($post['money_r'] == 'money' && !$post['money']) {
         json_error("请输入活动人均费用");
     }
     if ($post['money_r'] == 'money' && !is_numeric($post['money'])) {
         json_error("活动人均费用应为数字");
     }
     if ($post['qua'] == 'qua' && $post['fans'] && !is_numeric($post['fans_num'])) {
         json_error("粉丝数应为数字");
     }
     if (!$post['fromt']) {
         json_error("请输入活动开始时间");
     }
     if (!$post['tot']) {
         json_error("请输入活动结束时间");
     }
     if (!$post['hid_pic']) {
         json_error("请上传活动海报");
     }
     $fromt = strtotime($post['fromt'] . " " . $post['hour_select_from'] . ":" . $post['min_select_from']);
     $tot = strtotime($post['tot'] . " " . $post['hour_select_to'] . ":" . $post['min_select_to']);
     if ($fromt >= $tot) {
         json_error("活动结束时间不能早于开始时间");
     }
     $verify = $this->Config['event_verify'] ? 0 : 1;
     load::logic('event');
     $eventLogic = new EventLogic();
     if (MEMBER_ROLE_TYPE != 'admin') {
         $is_allowed = $eventLogic->allowedCreate(MEMBER_ID, $this->Member);
     }
     if ($is_allowed) {
         json_error($is_allowed);
     }
     $item = get_param('item');
     $item_id = (int) get_param('item_id');
     $return = $eventLogic->createEvent($post, $item, $item_id, $verify);
     if (is_array($return)) {
         if ($return) {
             json_result("修改成功", $return);
         } else {
             json_error('修改失败');
         }
     } else {
         $id = $return;
     }
     if (0 == $verify) {
         json_error('发布成功,等待管理员审核');
     }
     $value = '我发布了一个活动【' . $post[name] . '】,地址:' . get_full_url($this->Config['site_url'], "index.php?mod=event&code=detail&id={$id}");
     if ($post['top'] == 'top') {
         $values = array('id' => $id, 'content' => $value, 'from' => '');
         json_result('发布成功', $values);
     }
     $item_id = $id;
     $msg = '发布成功';
     include template('vote/vote_toweibo');
     exit;
 }
Пример #7
0
 function SetSendEmail()
 {
     $uid = MEMBER_ID;
     if ($uid < 1) {
         $this->Messager('请先登录', 'index.php?');
     }
     if (!$this->Config['sendmailday']) {
         $this->Messager('本站点尚未开启邮件提醒功能。', -1);
     }
     $sendmail = jpost('sendmail');
     $acceptemail = array('notice_pm', 'notice_reply', 'notice_at', 'notice_fans', 'notice_event', 'user_notice_time');
     $data = array();
     foreach ($acceptemail as $k) {
         $data[$k] = max(0, (int) $sendmail[$k]);
     }
     if ($sendmail['notice_email']) {
         $data['email_checked'] = 1;
     } else {
         $data['email_checked'] = 2;
     }
     jtable('members')->update($data, $uid);
     $this->Title = '邮件提醒';
     $this->Messager('设置成功', 'index.php?mod=settings&code=sendmail');
 }
Пример #8
0
 function DoModify()
 {
     $role = jtable('role')->info($this->ID);
     if ($role == false) {
         $this->Messager("该角色已经不存在了", null);
     }
     $n = jpost('name', 'txt');
     if (empty($n) || ($_info = jtable('role')->info(array('name' => $n))) && $_info['id'] != $role['id']) {
         $this->Messager('名称不能为空,或已经存在了', -1);
     }
     $query = DB::query("select * from " . DB::table('role_action'));
     $role_action_list = array();
     $sids = array();
     while (false != ($row = DB::fetch($query))) {
         $role_action_list[$row['id']] = $row;
         if (in_array($row['module'], $this->smods)) {
             $sids[$row['id']] = $row['id'];
         }
     }
     $iiddss = array();
     if ($this->Post['privilege']) {
         foreach ((array) $this->Post['privilege'] as $iid) {
             $iid = (int) $iid;
             if ($iid > 0 && isset($role_action_list[$iid])) {
                 $iiddss[$iid] = $iid;
             }
         }
         if (true !== JISHIGOU_FOUNDER) {
             $role_pids = array();
             foreach (explode(',', $role['privilege']) as $oid) {
                 $role_pids[$oid] = $oid;
             }
             foreach ($sids as $sid) {
                 if (isset($role_pids[$sid])) {
                     $iiddss[$sid] = $sid;
                 } else {
                     unset($iiddss[$sid]);
                 }
             }
         }
         sort($iiddss);
     }
     $data = array('id' => $this->ID, 'name' => $n, 'creditshigher' => (int) $this->Post['creditshigher'], 'creditslower' => (int) $this->Post['creditslower'], 'privilege' => implode(',', $iiddss));
     $data = $this->_process_allows($role, $data);
     jtable('role')->update($data);
     if ($result === false) {
         $this->Messager("编辑失败");
     } else {
         jtable('role')->cache_rm($this->ID);
         $this->_experience();
         if (!empty($_FILES['icon']['name'])) {
             $this->upload_pic($this->ID);
         }
         $this->Messager("编辑成功");
     }
 }
Пример #9
0
 function DoRecommend()
 {
     $act = $this->Post['act'] ? $this->Post['act'] : $this->Get['act'];
     $timestamp = time();
     $uid = MEMBER_ID;
     $username = MEMBER_NAME;
     $hot_tag_recommend_config = jconf::get('hot_tag_recommend');
     $messager = "";
     if ('delete' == $act) {
         $hot_tag_recommend = $hot_tag_recommend_config;
         $id = max(0, (int) get_param('id'));
         $info = DB::fetch_first("select * from " . TABLE_PREFIX . "tag_recommend where `id`='{$id}'");
         if (!$info) {
             $this->Messager("你要删除的内容已经不存在了");
         }
         $name = $info['name'];
         DB::query("delete from " . TABLE_PREFIX . "tag_recommend where `id`='{$id}'");
         DB::query("update " . TABLE_PREFIX . "tag set `status`=0 where `name`='{$name}'");
         $messager = "删除成功";
     } else {
         $_arr = $this->Post['hot_tag_recommend'];
         if ($_arr) {
             $name = $_arr['name'] ? $_arr['name'] : "热门话题推荐";
             $num = min(20, max(1, (int) $_arr['num']));
             $hot_tag_recommend = array('enable' => $_arr['enable'] ? 1 : 0, 'name' => $name, 'num' => $num, 'time' => time());
             if ($_arr['list']) {
                 $_list = $this->Post['_list'];
                 foreach ($_arr['list'] as $k => $v) {
                     if ($v != $_list[$k]) {
                         $v['enable'] = $v['enable'] ? 1 : 0;
                         $_sets = array();
                         foreach ($v as $_k => $_v) {
                             if ($_v != $_list[$k][$_k]) {
                                 $_sets[$_k] = "`{$_k}`='{$_v}'";
                             }
                         }
                         if ($_sets) {
                             $_sets['last_update'] = "`last_update`='{$timestamp}'";
                             DB::query("update " . TABLE_PREFIX . "tag_recommend set " . implode(" , ", $_sets) . " where `id`='{$k}'");
                             if ($v['enable'] != $_list[$k]['enable']) {
                                 DB::query("update " . TABLE_PREFIX . "tag set `status`='{$v['enable']}' where `name`='{$v['name']}'");
                             }
                         }
                     }
                 }
             }
         } else {
             $hot_tag_recommend = $hot_tag_recommend_config;
         }
         $_new_arr = $this->Post['hot_tag_recommend_new'];
         foreach ($_new_arr as $k => $v) {
             if ($name = get_safe_code($v['name'])) {
                 if (DB::fetch_first("select * from " . TABLE_PREFIX . "tag_recommend where `name`='{$name}'")) {
                     continue;
                 }
                 if (false == DB::fetch_first("select * from " . TABLE_PREFIX . "tag where `name`='{$name}'")) {
                     jtable('tag')->insert(array('name' => $name, 'user_id' => MEMBER_ID, 'username' => MEMBER_NAME, 'dateline' => TIMESTAMP, 'last_post' => TIMESTAMP));
                 }
                 $_enable = $v['enable'] ? 1 : 0;
                 $desc = $v['desc'];
                 $order = (int) $v['order'];
                 DB::query("insert into " . TABLE_PREFIX . "tag_recommend (`enable`,`name`,`desc`,`order`,`dateline`,`uid`,`username`) values ('{$_enable}','{$name}','{$desc}','{$order}','{$timestamp}','{$uid}','{$username}')");
                 DB::query("update " . TABLE_PREFIX . "tag set `status`='{$_enable}' where `name`='{$name}'");
             }
         }
         $messager = "设置成功";
     }
     if (false == jpost('is_ajax')) {
         if ($hot_tag_recommend) {
             $__list = array();
             if ($hot_tag_recommend['num'] > 0) {
                 $sql = "select tr.*,t.id as tag_id,t.topic_count from " . TABLE_PREFIX . "tag_recommend tr left join " . TABLE_PREFIX . "tag t on t.name=tr.name where tr.enable=1 order by `order` desc , `id` desc limit {$hot_tag_recommend['num']}";
                 $query = $this->DatabaseHandler->Query($sql);
                 while (false != ($row = $query->GetRow())) {
                     $__list[$row['id']] = $row;
                 }
             }
             $hot_tag_recommend['list'] = $__list;
             if ($hot_tag_recommend_config != $hot_tag_recommend) {
                 jconf::set('hot_tag_recommend', $hot_tag_recommend);
                 if ($hot_tag_recommend['enable'] != $this->Config['hot_tag_recommend_enable']) {
                     $config = array();
                     $config['hot_tag_recommend_enable'] = $hot_tag_recommend['enable'];
                     jconf::update($config);
                 }
             }
         }
         $this->Messager($messager);
     } else {
         json_result($messager);
     }
 }
Пример #10
0
 function DoSend()
 {
     if (MEMBER_ID < 1) {
         $this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=login');
     }
     if ($this->MemberHandler->HasPermission($this->Module, $this->Code) == false) {
         $this->Messager($this->MemberHandler->GetError(), null);
     }
     $this->Post['message'] = jpost('message', 'txt');
     $pm_message = array("to_user" => wap_iconv($this->Post['to_user'], 'utf-8', $this->Config['charset'], 1), "message" => wap_iconv($this->Post['message'], 'utf-8', $this->Config['charset'], 1));
     $uid = (int) $this->Post['uid'];
     load::logic('pm');
     $PmLogic = new PmLogic();
     $return = $PmLogic->pmSend($pm_message);
     switch ($return) {
         case '1':
             $this->Messager("内容不能为空");
             break;
         case '2':
             $this->Messager("收件人不能为空");
             break;
         case '3':
             $this->Messager("收件人不存在");
             break;
         case '4':
             $this->Messager("消息已经保存草稿箱", "index.php?mod=pm&code=list&folder=outbox");
             break;
         case '5':
             $this->Messager("信息不存在或已删除");
         case '6':
             $this->Messager("所在用户组没有发私信的权限");
         default:
             if ($return && is_string($return)) {
                 $return = wap_iconv($return);
                 $this->Messager($return);
             }
             break;
     }
     if ($uid > 0) {
         $this->Messager("消息已发送成功", "index.php?mod=pm&code=view&uid={$uid}");
     } else {
         $this->Messager("消息已发送成功", "index.php?mod=pm");
     }
 }
Пример #11
0
 function DoAdd()
 {
     if (MEMBER_ID < 1) {
         exit("请先登录或者注册一个帐号");
     }
     if ($this->Config['seccode_enable'] > 1 && $this->Config['seccode_sms'] && $this->yxm_title && $this->Config['seccode_pub_key'] && $this->Config['seccode_pri_key']) {
         $YinXiangMa_response = jlogic('seccode')->CheckYXM(@$_POST['YinXiangMa_challenge'], @$_POST['YXM_level'][0], @$_POST['YXM_input_result']);
         if ($YinXiangMa_response != "true") {
             exit("验证码输入错误");
         }
     }
     if ($this->MemberHandler->HasPermission($this->Module, $this->Code) == false) {
         exit($this->MemberHandler->GetError());
     }
     load::logic('pm');
     $PmLogic = new PmLogic();
     $pmid = $this->Post['pmid'];
     if ($che = $this->Post['che']) {
         $this->Post['to_user'] = implode(",", $che);
     }
     $this->Post['message'] = jpost('message', 'txt');
     if ($pmid > 0) {
         $return = $PmLogic->pmSendAgain($this->Post);
     } else {
         $return = $PmLogic->pmSend($this->Post);
     }
     switch ($return) {
         case '1':
             exit("内容不能为空");
         case '2':
             exit("收件人不能为空");
         case '3':
             exit("收件人不存在");
         case '4':
             exit("消息已经保存草稿箱");
         case '5':
             exit("信息不存在或已删除");
         case '6':
             exit("所在用户组没有发私信的权限");
         default:
             if ($return && is_string($return)) {
                 exit($return);
             }
             return '';
     }
 }
Пример #12
0
 function DeleteImage()
 {
     $id = jget('id', 'int');
     $tid = jpost('tid', 'int');
     $rets = jlogic('topic_image')->del($tid, $id);
     if (is_array($rets) && $rets['error']) {
         json_error($rets['result']);
     }
     json_result('删除成功');
 }
Пример #13
0
 function doAct()
 {
     $uids = array();
     $ids = get_param('ids');
     $uids = $ids;
     $act = get_param('act');
     $msg = jpost('msg', 'txt');
     $medal_id = get_param('medal_id');
     if ($act == 'sendmsg') {
         if ($msg == '') {
             $this->Messager("请输入私信的内容", -1);
         }
         $admin_nickname = DB::result_first("select `nickname` from `" . TABLE_PREFIX . "members` where uid = 1 ");
         load::logic("pm");
         $PmLogic = new PmLogic();
         if ($uids) {
             $query = $this->DatabaseHandler->Query("select `nickname` from `" . TABLE_PREFIX . "members` where uid in (" . jimplode($uids) . ")");
             $nickname_arr = array();
             while (false != ($rs = $query->GetRow())) {
                 $nickname_arr[] = $rs['nickname'];
             }
         }
         if ($nickname_arr) {
             $post['to_user'] = implode(",", $nickname_arr);
             $post['message'] = $msg;
             $adminInfo = DB::fetch_first("select `username`,`nickname` from `" . TABLE_PREFIX . "members` where `uid` = '1'");
             $PmLogic->pmSend($post);
         }
     } elseif ($act == 'setmedal') {
         if ($medal_id == '') {
             $this->Messager("请选择要发放的勋章", -1);
         }
         load::logic('other');
         $OtherLogic = new OtherLogic();
         foreach ($uids as $val) {
             $sql = " select * from `" . TABLE_PREFIX . "members` Where  `uid` = '" . $val . "' ";
             $query = $this->DatabaseHandler->Query($sql);
             $members = $query->GetRow();
             $OtherLogic->giveUserMedal($medal_id, $members);
         }
     } elseif ($act == 'deluser') {
         $this->DoDelete($uids);
     } else {
         $this->Messager("请选择要执行的操作", -1);
     }
     $this->Messager("操作成功");
 }
Пример #14
0
 function add()
 {
     $GLOBALS['disable_show_msg'] = 1;
     $response = '';
     $follow_button = $this->Post['follow_button'];
     if (MEMBER_ID < 1) {
         js_show_login('登录后才能执行此操作');
     }
     $uid = jpost('uid', 'int');
     if ($follow_button == 'channel' || $follow_button == 'channelnav') {
         $isbuddy = jlogic('channel')->channel_isbuddy($uid);
         $can_buddy = jlogic('channel')->can_view_topic($uid);
         if ($isbuddy) {
             jlogic('channel')->buddy_channel($uid, 0);
             $response = follow_channel($uid, 0);
         } else {
             if ($can_buddy) {
                 jlogic('channel')->buddy_channel($uid, 1);
                 $response = follow_channel($uid, 1);
             } else {
                 $response = '';
             }
         }
     } elseif ($this->Config['department_enable'] && $follow_button == 'department') {
         $isbuddy = DB::result_first("SELECT count(*) FROM " . DB::table('buddy_department') . " WHERE uid = '" . MEMBER_ID . "' AND did = '{$uid}'");
         if ($isbuddy) {
             DB::query("DELETE FROM " . DB::table('buddy_department') . " WHERE uid = '" . MEMBER_ID . "' AND did = '{$uid}'");
             $response = follow_department($uid, 0);
         } else {
             DB::query("INSERT INTO " . DB::table('buddy_department') . " (`uid`,`did`) values ('" . MEMBER_ID . "','{$uid}')");
             $response = follow_department($uid, 1);
         }
     } else {
         $rets = buddy_add($uid, MEMBER_ID, 1);
         if ($rets) {
             if ($rets['error']) {
                 js_alert_output($rets['error']);
             } else {
                 if ($follow_button == 'xiao') {
                     $response = follow_html2($uid, 0, 0, 0);
                 } else {
                     $response = follow_html($uid, 0, 0, 0);
                 }
             }
         } else {
             if ($follow_button == 'xiao') {
                 $response = follow_html2($uid, 1, 0, 0);
             } else {
                 $response = follow_html($uid, 1, 0, 0);
             }
         }
         $response .= '<success></success>';
         $u_nickname = DB::result_first("SELECT `nickname` FROM " . DB::table('members') . " WHERE uid = '{$uid}'");
         $response .= $u_nickname;
     }
     response_text($response);
 }
Пример #15
0
 function _process_content(&$content)
 {
     if ('POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['message'])) {
         $content = jpost('message', 'txt');
     }
     $arr_keys = $arr_values = array();
     if (preg_match_all('~\\<a.*?\\<\\/a>~i', $content, $match)) {
         foreach ($match[0] as $k => $v) {
             $arr['@this_is_replace_ward_' . $k . '@'] = $v;
         }
         $arr_keys = array_keys($arr);
         $arr_values = array_values($arr);
         $content = str_replace($arr_values, $arr_keys, $content);
     }
     if (preg_match_all('~(?:https?\\:\\/\\/|www\\.)(?:[A-Za-z0-9\\_\\-]+\\.)+[A-Za-z0-9]{1,4}(?:\\:\\d{1,6})?(?:\\/[\\w\\d\\/=\\?%\\-\\&\\;_\\~\\`\\:\\+\\#\\.\\@\\[\\]]*(?:[^\\<\\>\'\\"\\n\\r\\t\\s\\x7f-\\xff])*)?~i', $content, $match)) {
         foreach ($match[0] as $url) {
             $replce_url = false !== strpos($url, 'http:/' . '/') ? $url : 'http:/' . '/' . $url;
             $content = str_replace($url, "<a href='{$replce_url}' target='_blank'>{$url}</a>", $content);
         }
     }
     if ($arr_keys && $arr_values) {
         $content = str_replace($arr_keys, $arr_values, $content);
     }
     $content = addslashes($content);
 }
Пример #16
0
 function VipIntro()
 {
     if (MEMBER_ID < 1) {
         $this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=member&code-login', 3);
     }
     $member = jsg_member_info(MEMBER_ID);
     $notUpToStandardVipConditions = $this->CheckVipCpnditions();
     if (!$notUpToStandardVipConditions) {
         Load::logic('validate_category');
         $this->ValidateLogic = new ValidateLogic($this);
         $is_card_pic = $this->Config['card_pic_enable']['is_card_pic'];
         if ($this->Post['postFlag']) {
             $validate_info = $this->Post['validate_remark'];
             $validate_info = trim(strip_tags((string) $validate_info));
             if (empty($validate_info)) {
                 $this->Messager('认证说明不能为空', -1);
             }
             $f_rets = filter($validate_info);
             if ($f_rets && $f_rets['error']) {
                 $this->Messager($f_rets['msg'], -1);
             }
             $category_fid = $this->Post['category_fid'];
             $category_id = $this->Post['category_id'];
             if (empty($category_fid) || empty($category_id)) {
                 $this->Messager('认证类别不能为空', -1);
             }
             $city = (int) $this->Post['city'];
             if ($city < 1) {
                 $this->Messager('请填写所在区域', -1);
             }
             $validate_true_name = strip_tags(jpost('validate_true_name', 'txt'));
             if (empty($validate_true_name)) {
                 $this->Messager('真实姓名不能为空', -1);
             }
             $validate_card_type = jpost('validate_card_type', 'txt');
             if (empty($validate_card_type)) {
                 $this->Messager('证件类型不能为空', -1);
             }
             $validate_card_id = strip_tags(jpost('validate_card_id', 'txt'));
             if (empty($validate_card_id)) {
                 $this->Messager('证件号码不能为空', -1);
             }
             if ($is_card_pic) {
                 $field = 'card_pic';
                 if (empty($_FILES) || !$_FILES[$field]['name']) {
                     $this->Messager("请上传证件图片", -1);
                 }
             }
             $data = array('uid' => MEMBER_ID, 'category_fid' => (int) $this->Post['category_fid'], 'category_id' => (int) $this->Post['category_id'], 'province' => jpost('province', 'txt'), 'city' => jpost('city', 'txt'), 'is_audit' => 0, 'dateline' => TIMESTAMP);
             $return_info = $this->ValidateLogic->Member_Validate_Add($data);
             if ($return_info['ids']) {
                 if ($is_card_pic) {
                     $image_id = $return_info['ids'];
                     if (empty($_FILES) || !$_FILES[$field]['name']) {
                         $this->Messager("请上传证件图片", -1);
                     }
                     $image_path = RELATIVE_ROOT_PATH . 'images/' . $field . '/' . $image_id . '/';
                     $image_name = $image_id . "_o.jpg";
                     $image_file = $image_path . $image_name;
                     $image_file_small = $image_path . $image_id . "_s.jpg";
                     if (!is_dir($image_path)) {
                         jio()->MakeDir($image_path);
                     }
                     jupload()->init($image_path, $field, true);
                     jupload()->setNewName($image_name);
                     $result = jupload()->doUpload();
                     if ($result) {
                         $result = is_image($image_file);
                     }
                     if (!$result) {
                         $this->Messager("上传图片失败", -1);
                     }
                     list($w, $h) = getimagesize($image_file);
                     if ($w > 601) {
                         $tow = 599;
                         $toh = round($tow * ($h / $w));
                         $result = makethumb($image_file, $image_file, $tow, $toh);
                         if (!$result) {
                             jio()->DeleteFile($image_file);
                             js_alert_output('大图片缩略失败');
                         }
                     }
                     $image_file = addslashes($image_file);
                     $validate_card_pic = " `validate_card_pic` = '{$image_file}' ,";
                 }
                 $sql = "update " . TABLE_PREFIX . "memberfields\r\n\t\t\t\t\t\tset {$validate_card_pic}\r\n\t\t\t\t\t\t\t`validate_remark` = '" . jpost('validate_remark', 'txt') . "' ,\r\n\t\t\t\t\t\t\t`validate_true_name`='" . jpost('validate_true_name', 'txt') . "' ,\r\n\t\t\t\t\t\t\t`validate_card_id` = '" . jpost('validate_card_id', 'txt') . "' ,\r\n\t\t\t\t\t\t\t`validate_card_type` = '" . jpost('validate_card_type', 'txt') . "'\r\n\t\t\t\t\t\twhere `uid`='" . MEMBER_ID . "'";
                 $this->DatabaseHandler->Query($sql);
                 if ($notice_to_admin = $this->Config['notice_to_admin']) {
                     $message = "用户" . MEMBER_NICKNAME . "申请了身份认证,<a href='admin.php?mod=vipintro&code=vipintro_manage' target='_blank'>点击</a>进入审核。";
                     $pm_post = array('message' => $message, 'to_user' => str_replace('|', ',', $notice_to_admin));
                     $admin_info = DB::fetch_first('select `uid`,`username`,`nickname` from `' . TABLE_PREFIX . 'members` where `uid` = 1');
                     load::logic('pm');
                     $PmLogic = new PmLogic();
                     $PmLogic->pmSend($pm_post, $admin_info['uid'], $admin_info['username'], $admin_info['nickname']);
                 }
             }
             if ($return_info['msg_info']) {
                 $this->Messager($return_info['msg_info']);
             }
         }
         $sql = "select * from `" . TABLE_PREFIX . "validate_category_fields` where `uid`='" . MEMBER_ID . "' ";
         $query = $this->DatabaseHandler->Query($sql);
         $validate_info = $query->GetRow();
         $sql = "select * from `" . TABLE_PREFIX . "memberfields` where `uid`='" . MEMBER_ID . "'";
         $query = $this->DatabaseHandler->Query($sql);
         $memberfields = $query->GetRow();
         $memberfields['validate_card_type'] = $memberfields['validate_card_type'] ? $memberfields['validate_card_type'] : '未知';
         $dateline = date('Y-m-d', $validate_info['dateline']);
         if (empty($validate_info['uid']) || $validate_info['is_audit'] == -1) {
             if (!$memberfields) {
                 $memberfields = array();
                 $memberfields['uid'] = $member['uid'];
                 $sql = "insert into `" . TABLE_PREFIX . "memberfields` (`uid`) values ('{$member['uid']}')";
                 $this->DatabaseHandler->Query($sql);
             }
             $_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' => '其他'));
             $select_value = $memberfields['validate_card_type'] ? $memberfields['validate_card_type'] : "身份证";
             $validate_card_type_select = jform()->Select('validate_card_type', $_options, $select_value);
             $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'];
                 }
             }
             $province_list = jform()->Select("province", $province, $province_id, "onchange=\"changeProvince();\"");
             $member_city = DB::fetch_first("SELECT * FROM " . DB::table('common_district') . " WHERE `name`='{$member['city']}'");
         }
         $where_list = " `category_id` = '' ";
         $query = DB::query("SELECT *\r\n\t\t\t\t\t\t\tFROM " . DB::table('validate_category') . "\r\n\t\t\t\t\t\t\twhere {$where_list}  ORDER BY id ASC");
         $category_list = array();
         while ($value = DB::fetch($query)) {
             $category_list[] = $value;
         }
         if ($this->Post['category_fid']) {
             $sub_category_list = $this->ValidateLogic->Small_CategoryList($this->Post['category_fid']);
         }
     }
     $this->Title = "{$this->Config['site_name']}身份验证";
     include template('other/topic_vip');
 }
Пример #17
0
 function to_admin_info()
 {
     $pm_to_admin = jconf::get('pm_to_admin');
     $id = jget('id', 'int');
     if (!isset($pm_to_admin['list'][$id])) {
         $this->Messager('请指定一个正确的ID');
     }
     $info = $pm_to_admin['list'][$id];
     $link_to_list_radio = $this->jishigou_form->YesNoRadio('info[link_to_list]', (int) $info['link_to_list']);
     if (jpost('cronssubmit')) {
         $_info = jpost('info');
         $to_admin = $_info['to_admin'];
         if (empty($to_admin)) {
             $this->Messager('接收者昵称不能为空');
         }
         $ns = explode(',', $to_admin);
         $rets = jtable('members')->get(array('sql_field' => 'uid, nickname', 'nickname' => $ns, 'result_count' => count($ns)));
         $to_uids = array();
         $to_admins = array();
         foreach ($rets['list'] as $row) {
             $to_uids[$row['uid']] = $row['uid'];
             $to_admins[$row['nickname']] = $row['nickname'];
         }
         $to_uid = implode(',', $to_uids);
         $name = $_info['name'];
         if (empty($name)) {
             $name = "给 {$to_admin} 的信";
         }
         $_info['enable'] = 1;
         $_info['to_uid'] = $to_uid;
         $_info['to_uids'] = $to_uids;
         $_info['to_admin'] = implode(',', $to_admins);
         $_info['name'] = $name;
         $_info['dateline'] = TIMESTAMP;
         $_info['link_to_list'] = $_info['link_to_list'] && is_numeric($to_uid) && $to_uid > 0;
         $notice_send = $_info['notice_send'];
         if ($notice_send && ($notice_send_info = jsg_member_info($notice_send, 'nickname'))) {
             $_info['send_from'] = $notice_send_info['nickname'];
             $_info['send_from_uid'] = $notice_send_info['uid'];
             $_info['send_from_username'] = $notice_send_info['username'];
         }
         $pm_to_admin['list'][$id] = $_info;
         jconf::set('pm_to_admin', $pm_to_admin);
         $this->Messager('编辑成功');
     }
     include template('admin/pm_to_admin_info');
 }