function Main()
 {
     if ($this->MemberHandler->HasPermission($this->Module, $this->Code) == false) {
         $this->Messager($this->MemberHandler->GetError(), null);
     }
     $act_list = array();
     if ($this->Config['company_enable']) {
         $act_list['company'] = '同单位';
     }
     if (!$this->Config['profile_search_close']) {
         $act_list['search'] = '同城用户';
     }
     if (!$this->Config['profile_maybe_friend_close']) {
         $act_list['maybe_friend'] = '同兴趣';
     }
     if (!$this->Config['profile_usertag_close']) {
         $act_list['usertag'] = '同类人';
     }
     if (!$this->Config['profile_role_close']) {
         $act_list['role'] = '同分组';
     }
     if (false == jconf::get('invite', 'link_display_none')) {
         $act_list['invite'] = '邀请好友';
     }
     $act = $this->Code;
     $member = $this->Member;
     if ($member['medal_id']) {
         $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
     }
     $member_nickname = $member['nickname'];
     if ('invite' == $act) {
         $sql = "delete from `" . TABLE_PREFIX . "invite` where `fuid`<'1' and `dateline`>'0' and `dateline`<'" . (time() - 86400 * 7) . "'";
         $this->DatabaseHandler->Query($sql);
         $sql = "select count(*) as my_invite_count from `" . TABLE_PREFIX . "invite` where `uid`='{$member['uid']}'";
         $query = $this->DatabaseHandler->Query($sql);
         $row = $query->GetRow();
         $my_invite_count = $row['my_invite_count'];
         $can_invite_count = max(0, $this->Config['invite_count_max'] - $my_invite_count);
         if ($my_invite_count > 0) {
             $per_page_num = 5;
             $query_link = "index.php?mod=" . ($_GET['mod_original'] ? get_safe_code($_GET['mod_original']) : $this->Module) . ($this->Code ? "&amp;code={$this->Code}" : "");
             $_config = array('return' => 'array');
             $page_arr = page($my_invite_count, $per_page_num, $query_link, $_config);
             $sql = "select i.*,m.province,m.city,m.topic_count,m.fans_count,m.nickname as fusername from `" . TABLE_PREFIX . "invite` i\r\n\t\t\t\t\t\tleft join `" . TABLE_PREFIX . "members` m on m.uid = i.fuid\r\n\t\t\t\t\t \twhere i.`uid`='{$member['uid']}' order by i.`id` desc {$page_arr['limit']}";
             $query = $this->DatabaseHandler->Query($sql);
             $invite_list = array();
             while (false != ($row = $query->GetRow())) {
                 $row['from_area'] = $row['province'] ? $row['province'] . ' ' . $row['city'] : '无';
                 $row['face'] = face_get($row['fuid']);
                 $invite_list[] = $row;
             }
             $invite_list = buddy_follow_html($invite_list, 'fuid');
         }
         $MEMBER_INVITE_CODE = '';
         if (!$this->Config['invite_count_max'] || $this->Config['invite_count_max'] > $member['invite_count']) {
             $MEMBER_INVITE_CODE = $member['invitecode'];
         }
         if (!$MEMBER_INVITE_CODE) {
             $MEMBER_INVITE_CODE = random(16);
             $sql = "update `" . TABLE_PREFIX . "members` set `invitecode`='{$MEMBER_INVITE_CODE}' where `uid`='" . MEMBER_ID . "'";
             $this->DatabaseHandler->Query($sql);
         }
         $inviteURL = "index.php?mod=member&code=" . urlencode(MEMBER_ID . "_" . $MEMBER_INVITE_CODE);
         $inviteURL = get_invite_url($inviteURL, $this->Config['site_url']);
         $invite = jconf::get('invite');
         $invite_msg = empty($invite) ? '' : jstripslashes($invite['invite_msg']);
         if (!empty($invite_msg)) {
             $replaces = array('nickname' => $member['nickname'], 'inviteurl' => $inviteURL, 'invite_num' => $this->Config['invite_limit'], 'site_name' => $this->Config['site_name']);
             foreach ($replaces as $key => $val) {
                 $invite_msg = str_replace("#" . $key . "#", $val, $invite_msg);
             }
         }
     } elseif ('maybe_friend' == $act) {
         $my_favorite_tags = jlogic('tag_favorite')->my_favorite_tags(MEMBER_ID, 20);
         if ($my_favorite_tags) {
             $uids = jlogic('tag_favorite')->favorite_uids($my_favorite_tags, 30);
             if ($uids) {
                 $p = array('uid' => MEMBER_ID, 'touid' => $uids, 'result_count' => count($uids));
                 $buddyids = get_buddyids($p);
                 $sql = "select `uid`,`ucuid`,`username`,`face_url`,`face`,`province`,`city`,`fans_count`,`topic_count`,`validate`,`nickname` from `" . TABLE_PREFIX . "members` where `uid` in('" . implode("','", $uids) . "')";
                 $query = $this->DatabaseHandler->Query($sql);
                 $member_list = array();
                 while (false != ($row = $query->GetRow())) {
                     $buddy_status = isset($buddyids[$row['uid']]);
                     if (!$buddy_status && MEMBER_ID != $row['uid']) {
                         $row['follow_html'] = follow_html($row['uid'], $buddy_status);
                         $row = jsg_member_make($row);
                         $member_list[$row['uid']] = $row;
                         $tag_favorite_uids[$row['uid']] = $row['uid'];
                     }
                 }
             }
         }
         $user_favorite = array();
         if ($tag_favorite_uids) {
             $user_favorite = jlogic('tag_favorite')->my_favorite($tag_favorite_uids, 100);
         }
     } elseif ('usertag' == $act) {
         $per_page_num = 10;
         $query_link = 'index.php?mod=profile&code=usertag';
         $order = " order by `fans_count` desc ";
         $sql = "select * from `" . TABLE_PREFIX . "user_tag_fields` where `uid` = '" . MEMBER_ID . "'";
         $query = $this->DatabaseHandler->Query($sql);
         $mytag = array();
         $user_tagid = array();
         while (false != ($row = $query->GetRow())) {
             $mytag[] = $row;
             $user_tagid[$row['tag_id']] = $row['tag_id'];
         }
         if ($user_tagid) {
             $sql = "select * from `" . TABLE_PREFIX . "user_tag_fields` where `uid` != '" . MEMBER_ID . "' and `tag_id` in (" . jimplode($user_tagid) . ") ";
             $query = $this->DatabaseHandler->Query($sql);
             $member_uids = array();
             while (false != ($row = $query->GetRow())) {
                 $member_uids[$row['uid']] = $row['uid'];
             }
             $where = $where_list = " where `uid` in (" . jimplode($member_uids) . ")";
         }
         if ($member_uids) {
             $member_list = array();
             $sql = "select count(*) as `total_record` from `" . TABLE_PREFIX . "members` {$where}";
             $total_record = DB::result_first($sql);
             if ($total_record > 0) {
                 $_config = array('return' => 'array');
                 $page_arr = page($total_record, $per_page_num, $query_link, $_config);
                 $member_list = $this->TopicLogic->GetMember("{$where} {$order} {$page_arr['limit']}", "`uid`,`ucuid`,`username`,`nickname`,`face_url`,`face`,`fans_count`,`topic_count`,`province`,`city`,`validate`");
                 $member_list = buddy_follow_html($member_list);
             }
             $sql = "select * from `" . TABLE_PREFIX . "user_tag_fields` {$where}";
             $query = $this->DatabaseHandler->Query($sql);
             $member_tag = array();
             while (false != ($row = $query->GetRow())) {
                 $member_tag[] = $row;
             }
         }
         $mytag = $this->_MyUserTag(MEMBER_ID);
     } else {
         $per_page_num = 10;
         $query_link = 'index.php?mod=profile&code=' . $act;
         $where_list = array();
         if ('search' == $act) {
             $province_name = $member['province'];
             $city_name = $member['city'];
             $area_name = $member['area'];
             $street_name = $member['street'];
             $province = $this->Get['province'];
             $city = $this->Get['city'];
             $area = $this->Get['area'];
             $street = $this->Get['street'];
             if ($province) {
                 $province_name = DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '{$province}'");
                 if ($city) {
                     $city_name = DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '{$city}'");
                     if ($area) {
                         $area_name = DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '{$area}'");
                         if ($street) {
                             $street_name = DB::result_first("select name from " . TABLE_PREFIX . "common_district where id = '{$street}'");
                         } else {
                             $street_name = '';
                         }
                     } else {
                         $area_name = '';
                         $street_name = '';
                     }
                 } else {
                     $city_name = '';
                     $area_name = '';
                     $street_name = '';
                 }
             }
             if (empty($where_list)) {
                 if ($province_name) {
                     $where_list['province'] = "`province`='" . addslashes("{$province_name}") . "'";
                     $query_link .= "&province=" . $province;
                     if ($city_name) {
                         $where_list['city'] = "`city`='" . addslashes("{$city_name}") . "'";
                         $query_link .= "&city=" . $city;
                         if ($area_name) {
                             $where_list['area'] = "`area`='" . addslashes("{$area_name}") . "'";
                             $query_link .= "&area=" . $area;
                             if ($street_name) {
                                 $where_list['street'] = "`street`='" . addslashes("{$street_name}") . "'";
                                 $query_link .= "&street=" . $street;
                             }
                         }
                     }
                 }
             }
             $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "common_district where `upid` = '0' order by list");
             while ($rsdb = $query->GetRow()) {
                 $province_arr[$rsdb['id']]['value'] = $rsdb['id'];
                 $province_arr[$rsdb['id']]['name'] = $rsdb['name'];
                 if ($member['province'] == $rsdb['name']) {
                     $province_id = $rsdb['id'];
                 }
             }
             $province_id = $province ? $province : $province_id;
             $province_list = jform()->Select("province", $province_arr, $province_id, "onchange=\"changeProvince();\"");
             $hid_area = '';
             $hid_city = '';
             $hid_street = '';
             if (!$province && $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}'");
                         }
                     }
                 }
             }
             $hid_city = $city ? $city : $hid_city;
             $hid_area = $area ? $area : $hid_area;
             $hid_street = $street ? $street : $hid_street;
         } elseif ('company' == $act && $this->Config['company_enable'] && @is_file(ROOT_PATH . 'include/logic/cp.logic.php')) {
             global $_J;
             $companyid = jget('companyid', 'int');
             $departmentid = jget('departmentid', 'int');
             $jobid = jget('jobid', 'int');
             if ($companyid < 1 && $departmentid < 1 && $jobid < 1) {
                 $companyid = (int) $_J['member']['companyid'];
                 $departmentid = (int) $_J['member']['departmentid'];
                 $jobid = (int) $_J['member']['jobid'];
             }
             $company_list = jlogic('cp')->get_cp_html($companyid);
             if ($this->Config['department_enable']) {
                 $department_list = jlogic('cp')->get_cp_html($departmentid, 'department', $companyid);
             }
             $job_list = jlogic('job')->get_job_select($jobid);
             if ($companyid > 0) {
                 $where_list['company'] = "`companyid`='" . $companyid . "'";
                 $query_link .= '&companyid=' . $companyid;
             }
             if ($departmentid > 0) {
                 $where_list['department'] = "`departmentid`='" . $departmentid . "'";
                 $query_link .= '&departmentid=' . $departmentid;
             }
             if ($jobid > 0) {
                 $where_list['job'] = "`jobid`='" . $jobid . "'";
                 $query_link .= '&jobid=' . $jobid;
             }
         } else {
             global $_J;
             $roleid = $this->Get['roleid'] ? (int) $this->Get['roleid'] : ($_J['role_id'] ? $_J['role_id'] : 0);
             $roles = jlogic('channel')->get_user_role();
             $role_list = jform()->Select("roleid", $roles, $roleid, "");
             if ($roleid) {
                 $where_list['role'] = "`role_id`='" . $roleid . "'";
                 $query_link .= "&roleid=" . $roleid;
             }
         }
         $member_list = array();
         if ($where_list) {
             $where = empty($where_list) ? null : ' WHERE ' . implode(' AND ', $where_list) . ' ';
             $order = " order by `uid` desc ";
             $sql = "select count(*) as `total_record` from `" . TABLE_PREFIX . "members` {$where} ";
             $total_record = DB::result_first($sql);
             if ($total_record > 0) {
                 $_config = array('return' => 'array');
                 $page_arr = page($total_record, $per_page_num, $query_link, $_config);
                 $uids = array();
                 $member_list = $this->TopicLogic->GetMember("{$where} {$order} {$page_arr['limit']}", "`uid`,`ucuid`,`username`,`nickname`,`face_url`,`face`,`fans_count`,`topic_count`,`province`,`city`,`aboutme`");
                 foreach ($member_list as $_m) {
                     $uids[$_m['uid']] = $_m['uid'];
                 }
                 if ($uids && MEMBER_ID > 0) {
                     $member_list = buddy_follow_html($member_list);
                     $province = isset($_GET['province']) ? $province : $member['province'];
                     $city = isset($_GET['city']) ? $city : $member['city'];
                     $sql = "select * from (select * from `" . TABLE_PREFIX . "topic` where `uid` in (" . jimplode($uids) . ") and `type` != 'reply' order by `dateline` desc) a group by `uid` ";
                     $query = $this->DatabaseHandler->Query($sql);
                     $tids = array();
                     while (false != ($row = $query->GetRow())) {
                         $tids[$row['tid']] = $row['tid'];
                     }
                     $topic_list = $this->TopicLogic->Get($tids);
                 }
             }
         }
         $gender_radio = jform()->Radio('gender', array(0 => array('name' => '不限', 'value' => 0), 1 => array('name' => '男', 'value' => 1), 2 => array('name' => '女', 'value' => 2)), $gender);
     }
     $this->Title = $act_list[$act];
     include template('social/profile_main');
 }
Exemple #2
0
echo $show['page_r']['recd_qun'];
?>
" size="2">个
</div> <div>5、最新同城活动:显示
<input type="text" name="show[page_r][tc_event]" value="<?php 
echo $show['page_r']['tc_event'];
?>
" size="2">个
</div> </td> </tr> </table></td> </tr> <tr class="altbg2"> <td width="15%"><a href="index.php?mod=qun" target="_blank" title="在新窗口中打开查看效果">发现微群页面</a> </td> <td><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="49%" style="border:none;"><div>每个群分类的活跃数:显示
<input name="show[qun][activity]" type="text" id="show[qun][activity]" value="<?php 
echo $show['qun']['activity'];
?>
" size="2">
个,数据缓存时间 
<?php 
echo jform()->Select("cache[qun][activity]", $this->cache_time(3600, 86400), $cache['qun']['activity']);
?>
 </div> </td> </tr> </table></td> </tr> <tr class="altbg1"> <td width="15%"><a href="index.php?mod=topic&code=myhome" target="_blank" title="在新窗口中打开查看效果">我的首页页面</a> </td> <td><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="49%" style="border:none;"><div> <input type="text" name="show[topic][myhome]" value="<?php 
echo $show['topic']['myhome'];
?>
" size="2">
条</div></td> </tr> </table></td> </tr> <tr class="altbg2"> <td width="15%"><a href="index.php?mod=topic&code=myblog" target="_blank" title="在新窗口中打开查看效果">我的微博页面</a> </td> <td><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="49%" style="border:none;"><div> <input type="text" name="show[topic][myblog]" value="<?php 
echo $show['topic']['myblog'];
?>
" size="2">
条</div></td> </tr> </table></td> </tr> <tr class="altbg1"> <td width="15%"><a href="index.php?mod=topic_favorite" target="_blank" title="在新窗口中打开查看效果">我的收藏页面</a> </td> <td><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="49%" style="border:none;"><div> <input type="text" name="show[topic][myfavorite]" value="<?php 
echo $show['topic']['myfavorite'];
?>
" size="2">
条</div></td> </tr> </table></td> </tr> <tr class="altbg2"> <td width="15%"><a href="index.php?mod=topic_favorite&code=me" target="_blank" title="在新窗口中打开查看效果">收藏我的页面</a> </td> <td><table width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="49%" style="border:none;"><div> <input type="text" name="show[topic][favoritemy]" value="<?php 
echo $show['topic']['favoritemy'];
Exemple #3
0
 function eventPost()
 {
     $is_allowed = '';
     if (MEMBER_ID < 1) {
         $is_allowed = "请先登录或者注册一个帐号";
     }
     if (MEMBER_ROLE_TYPE != 'admin' && !$is_allowed) {
         load::logic('event');
         $EventLogic = new EventLogic();
         $is_allowed = $EventLogic->allowedCreate(MEMBER_ID, $this->Member);
     }
     if ($is_allowed) {
         exit($is_allowed);
     }
     $item = $this->Get['item'];
     $item_id = $this->Get['item_id'];
     $top = 'top';
     $free = 'checked';
     $all = 'checked';
     $info = array();
     $info = jconf::get('profileeventinfo');
     $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "event_sort order by id");
     while ($rsdb = $query->GetRow()) {
         $rs[$rsdb[id]]['value'] = $rsdb['id'];
         $rs[$rsdb[id]]['name'] = $rsdb['type'];
     }
     $event_type = jform()->Select("type", $rs);
     if ($this->Member['province']) {
         $province_id = DB::result_first("select id from " . TABLE_PREFIX . "common_district where name = '" . $this->Member['province'] . "' and `upid` = '0'");
     } else {
         $province_id = DB::result_first("select id from " . TABLE_PREFIX . "common_district where `upid` = '0' order by list");
     }
     $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'];
     }
     $hid_province = $province_id;
     $province_list = jform()->Select("province", $province, $province_id, "onchange=\"changeProvince();\"");
     if ($this->Member['city']) {
         $city_id = DB::result_first("select id from " . TABLE_PREFIX . "common_district where name = '" . $this->Member['city'] . "' and upid = '{$province_id}'");
         $where_city = " and upid = '{$city_id}' ";
     }
     $hid_city = $city_id;
     if ($this->Member['area']) {
         $area_id = DB::result_first("select id from " . TABLE_PREFIX . "common_district where name = '" . $this->Member['area'] . "' {$where_city}");
     }
     $hid_area = $area_id;
     $fromt = my_date_format(TIMESTAMP, 'Y-m-d');
     $hour_select_from = mk_time_select('hour', false, 'hour_select_from');
     $min_select_from = mk_time_select('min', false, 'min_select_from');
     $tot = my_date_format(TIMESTAMP + 7 * 24 * 3600, 'Y-m-d');
     $hour_select_to = mk_time_select('hour', false, 'hour_select_to');
     $min_select_to = mk_time_select('min', false, 'min_select_to');
     include template('event/event_options');
 }
Exemple #4
0
 function editEvent()
 {
     $id = (int) $this->Get['id'];
     load::logic('event');
     $EventLogic = new EventLogic();
     $postman = $EventLogic->get_postman($id);
     if ($postman != MEMBER_ID) {
         $this->Messager("你无权修改该活动");
     }
     $free = 'checked';
     $all = 'checked';
     $info = array();
     $info = jconf::get('profileeventinfo');
     $val = array();
     if ($id) {
         $act = "edit";
         $val = $EventLogic->get_event_info($id);
         $item_id = $val['item_id'];
         $title = $val['title'];
         $moneys = $val['money'];
         $content = $val['content'];
         $address = $val['address'];
         if ($val['image']) {
             $image = $val['image'];
         }
         $edit_fromt = date("Y-m-d", $val['fromt']);
         $edit_fromt_h = date("H", $val['fromt']);
         $edit_fromt_i = date("i", $val['fromt']);
         $edit_tot = date("Y-m-d", $val['tot']);
         $edit_tot_h = date("H", $val['tot']);
         $edit_tot_i = date("i", $val['tot']);
         if ($val['money']) {
             $money = 'checked';
             $free = '';
         } else {
             $money = '';
             $free = 'checked';
         }
         $qualification = unserialize($val['qualification']);
         if (count($qualification)) {
             $qua = "checked";
             $all = "";
             if ($qualification['fans_num']) {
                 $fans = "checked";
                 $fans_num = $qualification['fans_num'];
             }
             if ($qualification['same_city']) {
                 $same_city = "checked";
             }
             if ($qualification['inqun']) {
                 $inqun = " checked ";
             }
         }
         $need_app_info = unserialize($val['need_app_info']);
         if (count($need_app_info)) {
             foreach ($need_app_info as $value) {
                 $info[$value]['checked'] = "checked";
             }
         }
     }
     $rs = $EventLogic->get_event_type(TRUE);
     $event_type = jform()->Select("type", $rs, $val['type_id']);
     $province = $EventLogic->get_province();
     $province_id = $val['province_id'];
     $hid_province = $province_id;
     $province_list = jform()->Select("province", $province, $province_id, "onchange=\"changeProvince();\"");
     $city_id = $val['city_id'];
     $hid_city = $city_id;
     $area_id = $val['area_id'];
     $hid_area = $area_id;
     $fromt = $edit_fromt ? $edit_fromt : my_date_format(TIMESTAMP, 'Y-m-d');
     $edit_fromt_h = $edit_fromt_h ? $edit_fromt_h : false;
     $edit_fromt_i = $edit_fromt_i ? $edit_fromt_i : false;
     $hour_select_from = mk_time_select('hour', $edit_fromt_h, 'hour_select_from');
     $min_select_from = mk_time_select('min', $edit_fromt_i, 'min_select_from');
     $tot = $edit_tot ? $edit_tot : my_date_format(TIMESTAMP + 7 * 24 * 3600, 'Y-m-d');
     $edit_tot_h = $edit_tot_h ? $edit_tot_h : false;
     $edit_tot_i = $edit_tot_i ? $edit_tot_i : false;
     $hour_select_to = mk_time_select('hour', $edit_tot_h, 'hour_select_to');
     $min_select_to = mk_time_select('min', $edit_tot_i, 'min_select_to');
     $member = $this->Member;
     $this->Title = "修改活动";
     include template('event/event_create');
 }
Exemple #5
0
 function memberProfile()
 {
     if (MEMBER_ID < 1) {
         $this->Messager(NULL, jurl('index.php?mod=member'));
     }
     if ($this->Post['img_path'] && strpos($this->Post['old_face'], "noavatar.gif")) {
         $pic_file = $this->Post['img_path'];
         if (empty($pic_file) || !is_image($pic_file)) {
             $this->Messager(null, jurl('index.php?mod=member&code=add_face'), 0);
         }
         $p = array('uid' => MEMBER_ID, 'pic_file' => $pic_file, 'x' => $this->Post['x'], 'y' => $this->Post['y'], 'w' => $this->Post['w'], 'h' => $this->Post['h']);
         $rets = jlogic('user')->face($p);
         if ($rets && $rets['error']) {
             $this->Messager($rets['msg']);
         }
     }
     $menuHTML = $this->getRegiterMenu(6);
     if ($this->Config['reg_step7_radio']) {
         $redirect_to = jurl('index.php?mod=member&code=do_first_topic');
     } else {
         $redirect_to = jurl('index.php?mod=topic');
     }
     if (!$this->Config['reg_step6_radio']) {
         $this->Messager(NULL, $redirect_to, 0);
     }
     if ($this->Config['city_status']) {
         $query = $this->DatabaseHandler->Query("select * from " . TABLE_PREFIX . "common_district where `upid` = '0' order by list");
         $province_list = array(array('value' => 0, 'name' => '请选择...'));
         while (false != ($rsdb = $query->GetRow())) {
             $province_list[$rsdb['id']]['value'] = $rsdb['id'];
             $province_list[$rsdb['id']]['name'] = $rsdb['name'];
         }
         $province = jform()->Select("province", $province_list, null, "onchange=\"changeProvince();\"");
     }
     if ($this->Config['company_enable'] && @is_file(ROOT_PATH . 'include/logic/cp.logic.php')) {
         $companyselect = $this->CpLogic->get_cp_html();
         if ($this->Config['department_enable']) {
             $departmentselect = $this->CpLogic->get_cp_html(0, 'department');
         }
         $jobselect = jlogic('job')->get_job_select();
     }
     #增加项目
     $profileRegister = jconf::get('profileregister');
     $b_province_list = jform()->Select("b_province", $province_list, null, "onchange=\"changeProvince('b');\"");
     $this->Title = '补全资料';
     include template('register/register_member_profile');
 }
Exemple #6
0
 function category()
 {
     $cat_id = empty($this->Get['cat_id']) ? 0 : intval(trim($this->Get['cat_id']));
     $cat_ary = $this->QunLogic->get_category();
     if (!empty($cat_ary)) {
         $top_cat_ary = $cat_ary['first'];
         $sub_cat_ary = $cat_ary['second'];
     }
     $member =& $this->my;
     if (!$this->Config['acceleration_mode'] && $member['medal_id']) {
         $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
     }
     $joined_nums = $this->QunLogic->joined_nums(MEMBER_ID);
     $hot_tag_ary = $this->QunLogic->get_hot_tag_list();
     if ($cat_id) {
         $sort = intval(trim($this->Get['sort']));
         if (empty($sort)) {
             $sort = 1;
         }
         $perpage = 20;
         $gets = array('mod' => 'qun', 'code' => 'category', 'cat_id' => $cat_id, 'sort' => $this->Get['sort']);
         $page_url = 'index.php?' . url_implode($gets);
         $parent_id = 0;
         $sub_cat_id = 0;
         if (isset($top_cat_ary[$cat_id])) {
             $parent_id = $cat_id;
         } else {
             if (isset($sub_cat_ary[$cat_id])) {
                 $parent_id = $sub_cat_ary[$cat_id]['parent_id'];
                 $sub_cat_id = $cat_id;
             }
         }
         if ($parent_id > 0) {
             $tcat_name = $top_cat_ary[$parent_id]['cat_name'];
             $this->Title = $top_cat_ary[$parent_id]['cat_name'] . ' - 列表';
             $sub_cat_id_ary = array();
             $cur_sub_cat_ary = array();
             foreach ($sub_cat_ary as $value) {
                 if ($value['parent_id'] == $parent_id) {
                     $cur_sub_cat_ary[] = $value;
                     $sub_cat_id_ary[] = $value['cat_id'];
                 }
             }
             $where_sql = ' 1 ';
             if ($sub_cat_id > 0) {
                 $where_sql .= " AND cat_id='{$sub_cat_id}' ";
             } else {
                 $sub_cat_id_ary[] = $cat_id;
                 $where_sql .= " AND cat_id IN(" . jimplode($sub_cat_id_ary) . ") ";
             }
             $order_sql = ' ';
             if ($sort == 2) {
                 $order_sql = ' thread_num DESC ';
             } else {
                 if ($sort == 3) {
                     $order_sql = ' dateline DESC ';
                 } else {
                     $sort = 1;
                     $order_sql = ' member_num DESC ';
                 }
             }
             $active_sort[$sort] = 'class="on"';
             $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('qun') . " WHERE {$where_sql}");
             jlogic('qun_category')->update_qun_num($cat_id, $count);
             $qun_list = array();
             if ($count) {
                 $_config = array('return' => 'array');
                 $page_arr = page($count, $perpage, $page_url, $_config);
                 $query = DB::query("SELECT *\r\n\t\t\t\t\t\t\t\t\t\tFROM " . DB::table('qun') . "\r\n\t\t\t\t\t\t\t\t\t\tWHERE {$where_sql}\r\n\t\t\t\t\t\t\t\t\t\tORDER BY {$order_sql}\r\n\t\t\t\t\t\t\t\t\t\t{$page_arr['limit']}");
                 while ($value = DB::fetch($query)) {
                     $value['icon'] = $this->QunLogic->qun_avatar($value['qid'], 's');
                     $value['dateline'] = my_date_format($value['dateline'], 'Y-m-d H:i');
                     $qun_list[] = $value;
                 }
                 $this->_get_ql_tag($qun_list);
             }
         } else {
             $this->Messager('当前分类不存在', 'index.php?mod=qun&code=category');
         }
         include_once template('qun/category_list');
     } else {
         $nav_cat_ary = array();
         $recdCid = $this->QunLogic->getRecdQunCid();
         if ($recdCid) {
             $i = 0;
             foreach ($recdCid as $val) {
                 $key = $val;
                 if (isset($sub_cat_ary[$val])) {
                     $key = $sub_cat_ary[$val]['parent_id'];
                     $nav_cat_ary[$key] = $top_cat_ary[$key];
                 }
                 if (isset($top_cat_ary[$val])) {
                     $nav_cat_ary[$key] = $top_cat_ary[$key];
                 }
                 if ($i == 0) {
                     $first_cat_id = $nav_cat_ary[$key]['cat_id'];
                 }
                 ++$i;
             }
         }
         if ($this->Config['qun_setting']['tc_qun']) {
             $query = $this->DatabaseHandler->Query("select id,name 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("tc_province", $province, $province_id, " onchange=\"tcQun(\$('#tc_province').val());\" style=\"width:150px\" ");
         }
         $activity_qun = $this->QunLogic->GetActivityQun($top_cat_ary, $sub_cat_ary);
         $new_qun_list = $this->QunLogic->getNewQun();
         extract($this->QunLogic->GetNum());
         $this->Title = $this->Config[changeword][weiqun] . ' - 发现' . $this->Config[changeword][weiqun];
         include_once template('qun/category_index');
     }
 }
 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');
     }
 }
Exemple #8
0
 function recd()
 {
     Load::logic('topic_recommend');
     $TopicRecommendLogic = new TopicRecommendLogic();
     $tid = intval($this->Get['tid']);
     $tag_id = intval($this->Get['tag_id']);
     $topic = DB::fetch_first("SELECT * FROM " . DB::table("topic") . " WHERE tid='{$tid}'");
     if (empty($topic)) {
         json_error("当前微博不存在或者已经被删除了");
     }
     if ($topic['item'] == 'channel' && $topic['item_id'] > 0) {
         if (!function_exists('item_topic_from')) {
             jfunc('item');
         }
         $topic = item_topic_from($topic);
     }
     if (!($this->MemberHandler->HasPermission('topic', 'do_recd') || $topic['ismanager'])) {
         json_error("您的角色没有推荐微博的权限!");
     }
     $topic_recd = $TopicRecommendLogic->get_info($tid);
     if (!empty($topic_recd)) {
         $topic_recd['expiration'] = empty($topic_recd['expiration']) ? '' : my_date_format($topic_recd['expiration'], 'Y-m-d H:i');
         $recd_html = jform()->Radio('recd[]', array(array("name" => "重点推荐", "value" => "4", "title" => "在我的首页和指定的位置推荐"), array("name" => "普通推荐", "value" => "2", "title" => "仅在指定的页面位置推荐"), array("name" => "取消推荐", "value" => "0", "title" => "恢复为常态微博")), $topic_recd['recd'], 'title');
     } else {
         $recd_html = jform()->Radio('recd[]', array(array("name" => "重点推荐", "value" => "4", "title" => "在我的首页和指定的位置推荐"), array("name" => "普通推荐", "value" => "2", "title" => "仅在指定的页面位置推荐")), 2, 'title');
     }
     $channels = array();
     if ($this->Config['channel_enable']) {
         $channels = $TopicRecommendLogic->recd_channels();
     }
     if ($topic['item'] == 'qun' && $topic['item_id'] > 0) {
         Load::logic('qun');
         $QunLogic = new QunLogic();
         $tmp_perm = $QunLogic->chk_perm($topic['item_id'], MEMBER_ID);
         if (!('admin' == MEMBER_ROLE_TYPE || in_array($tmp_perm, array(1, 2)))) {
             json_error("你没有权限推荐群内微博");
         }
     }
     include template("topic_recd");
 }
Exemple #9
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');
 }
Exemple #10
0
 public function new_tc()
 {
     if (!$this->Config['same_city']) {
         $this->Messager('管理员已关闭同城微博的功能。', 'index.php?mod=plaza');
     }
     $this->Title = '最新同城微博';
     $province_id = jget('province', 'int');
     $city_id = jget('city', 'int');
     $area_id = jget('area', 'int');
     $p = array('cache_time' => (int) jconf::get('cache', 'topic_new', 'topic'), 'perpage' => (int) jconf::get('show', 'topic_new', 'topic'), 'page_url' => 'index.php?mod=plaza&code=new_tc&province=' . $province_id . '&city=' . $city_id . '&area=' . $area_id, 'province_id' => $province_id, 'city_id' => $city_id, 'area_id' => $area_id);
     $rets = jlogic('plaza')->new_tc($p);
     $province = $rets['province'];
     $city = $rets['city'];
     $area = $rets['area'];
     $province_id = $rets['province_id'];
     $city_id = $rets['city_id'];
     $area_id = $rets['area_id'];
     $province_list = jlogic('common_district')->get_province_list(true);
     $province_list_select = jform()->Select("tc_province", $province_list, $province_id, " onchange=\"changeProvince();\" style=\"width:150px\" ");
     $ajax_load = $this->_ajax_load($rets);
     include template();
 }
Exemple #11
0
 function Main()
 {
     if (!$this->Config['ldap_enable']) {
         $member = jsg_member_info(MEMBER_ID);
         $act_list = array();
         $act_list['qqwb'] = '腾讯微博';
         $act_list['sina'] = '新浪微博';
         $act_list['yy'] = 'YY帐号';
         $act_list['renren'] = '人人帐号';
         $act_list['kaixin'] = '开心帐号';
         if ($this->Config['fjau_enable']) {
             $act_list['fjau'] = 'FJAU帐号';
         }
         $act = isset($act_list[$this->Code]) ? $this->Code : 'qqwb';
         $this->Code = $act;
         if ('qqwb' == $act) {
             $qqwb_init = qqwb_init($this->Config);
             if ($qqwb_init) {
                 $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']);
                     }
                     if ($qqwb['is_synctopic_tojishigou']) {
                         $sync_weibo_to_jishigou_radio = jform()->YesNoRadio('sync_weibo_to_jishigou', (int) $qqwb_bind_info['sync_weibo_to_jishigou']);
                     }
                     if ($qqwb['is_syncreply_tojishigou']) {
                         $sync_reply_to_jishigou_radio = jform()->YesNoRadio('sync_reply_to_jishigou', (int) $qqwb_bind_info['sync_reply_to_jishigou']);
                     }
                 }
             }
         } elseif ('sina' == $act) {
             $profile_bind_message = '新浪微博帐号绑定功能未启用,请联系管理员';
             $sina_init = sina_init($this->Config);
             if ($sina_init) {
                 $sina = jconf::get('sina');
                 if ($sina['oauth2_enable']) {
                     $sina_bind_info = sina_weibo_bind_info(MEMBER_ID);
                     if ($sina_bind_info) {
                         $profiles = $sina_bind_info['profiles'];
                         if ($sina['is_synctopic_toweibo']) {
                             $synctoweibo_radio = jform()->YesNoRadio('bind_setting', (int) sina_weibo_bind_setting(MEMBER_ID));
                         }
                         if ($sina['is_synctopic_tojishigou']) {
                             $synctopic_tojishigou_radio = jform()->YesNoRadio('synctopic_tojishigou', (int) $profiles['synctopic_tojishigou']);
                         }
                         if ($sina['is_syncreply_tojishigou']) {
                             $syncreply_tojishigou_radio = jform()->YesNoRadio('syncreply_tojishigou', (int) $profiles['syncreply_tojishigou']);
                         }
                         $expires_in_time = my_date_format($sina_bind_info['dateline'] + $sina_bind_info['expires_in'], 'Y-m-d H:i');
                     }
                 } else {
                     $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 ('yy' == $act) {
             $yy_init = yy_init($this->Config);
             if ($yy_init) {
                 $yy_bind_info = yy_bind_info(MEMBER_ID);
             }
         } elseif ('renren' == $act) {
             $renren_init = renren_init($this->Config);
             if ($renren_init) {
                 $renren_bind_info = renren_bind_info(MEMBER_ID);
             }
         } elseif ('kaixin' == $act) {
             $kaixin_init = kaixin_init($this->Config);
             if ($kaixin_init) {
                 $kaixin_bind_info = kaixin_bind_info(MEMBER_ID);
             }
         } elseif ('fjau' == $act) {
             $fjau_init = fjau_init($this->Config);
             if ($fjau_init) {
                 $fjau_bind_info = fjau_bind_info(MEMBER_ID);
             }
         } else {
         }
         $this->Title = $act_list[$act];
     }
     include template('setting/account_main');
 }