Ejemplo n.º 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');
 }
Ejemplo n.º 2
0
 function add($tag, $uid = MEMBER_ID)
 {
     $tag = jfilter($tag, 'txt');
     $uid = jfilter($uid, 'int');
     $info = $this->info($tag, $uid);
     if ($info) {
         return $info;
     }
     if ($uid < 1) {
         return jerror('请指定一个正确的UID');
     }
     $uinfo = jsg_member_info($uid);
     if (!$uinfo) {
         return jerror('指定的UID已经不存在了');
     }
     if (!$tag) {
         return jerror('请指定一个正确的话题');
     }
     $tinfo = jtable('tag')->info(array('name' => $tag));
     if (!$tinfo) {
         return jerror('指定的话题已经不存在了');
     }
     $data = array('tag' => $tag, 'uid' => $uid, 'dateline' => TIMESTAMP);
     $id = $this->db->insert($data, 1, 1, 1);
     if ($id > 0) {
         $this->_rm_my_cache($uid);
         jtable('members')->update_count($uid, 'tag_favorite_count', '+1');
         jtable('tag')->update_count(array('name' => $tag), 'tag_count', '+1');
         $info = $this->info($tag, $uid);
     }
     return $info;
 }
Ejemplo n.º 3
0
 function Main()
 {
     $uid = MEMBER_ID;
     if ($uid < 1) {
         $this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=login');
     }
     $member = jsg_member_info($uid);
     $sql = "select * from `" . TABLE_PREFIX . "blacklist` where `uid` = '" . MEMBER_ID . "' ";
     $query = $this->DatabaseHandler->Query($sql);
     $uids = array();
     while (false != ($row = $query->GetRow())) {
         $uids[$row['touid']] = $row['touid'];
     }
     if ($uids) {
         $where = "where `uid` in (" . jimplode($uids) . ")";
         $member_list = $this->_MemberList($where);
         if ($uids && MEMBER_ID > 0) {
             $sql = "select `uid`,`tid`,`content`,`dateline` from `" . TABLE_PREFIX . "topic` where `uid` in (" . jimplode($uids) . ") group by `uid` order by `dateline` desc";
             $query = $this->DatabaseHandler->Query($sql);
             $topic_list = array();
             while (false != ($row = $query->GetRow())) {
                 $row['content'] = cut_str($row['content'], 100);
                 $row['dateline'] = my_date_format2($row['dateline']);
                 $topic_list[] = $row;
             }
         }
     }
     $group_list = jlogic('buddy_follow_group')->get_my_group(MEMBER_ID);
     $this->Title = '黑名单';
     include template('social/blacklist');
 }
Ejemplo n.º 4
0
 function Modify()
 {
     $member = jsg_member_info(MEMBER_ID);
     $theme_id = $this->Member['theme_id'];
     $theme_bg_image = $this->Member['theme_bg_image'];
     $theme_bg_color = $this->Member['theme_bg_color'];
     $theme_text_color = $this->Member['theme_text_color'];
     $theme_link_color = $this->Member['theme_link_color'];
     $theme_bg_image_type = $this->Member['theme_bg_image_type'];
     $theme_bg_repeat = $this->Member['theme_bg_repeat'];
     $theme_bg_fixed = $this->Member['theme_bg_fixed'];
     $open_theme_list = jconf::get('theme');
     $themelist = $open_theme_list['theme_list'];
     $count = 0;
     foreach ($themelist as $k => $v) {
         $v['element'] = "{$v[theme_bg_color]},{$v[theme_text_color]},{$v[theme_link_color]},{$v[theme_id]},{$v[theme_bg_image_type]}";
         $themelist[$k] = $v;
         $count = $count + 1;
     }
     $prepage = 8;
     $page_count = ceil($count / $prepage);
     $page = 1;
     if ($count > $perpage) {
         $multi .= '<a href=\'javascript:;\' onclick=\'pre("pre");\'>上一页</a>';
         $multi .= '&nbsp;&nbsp;<a href=\'javascript:;\' onclick=\'pre("next");\'>下一页</a>';
     }
     $my_bg_image = RELATIVE_ROOT_PATH . 'images/theme/' . face_path(MEMBER_ID) . MEMBER_ID . '_o.jpg';
     if (is_file($my_bg_image)) {
         $my_bg_image = $this->Config['site_url'] . "/" . $my_bg_image;
     } else {
         $my_bg_image = '';
     }
     $this->Title = "个人模板设置";
     include template('topic_theme');
 }
Ejemplo n.º 5
0
 function ModuleObject($config)
 {
     $this->MasterObject($config);
     $qun_setting = $this->Config['qun_setting'];
     if (MEMBER_ROLE_TYPE != 'admin') {
         if (!$qun_setting['qun_open']) {
             $this->Messager('站点暂时不开放' . $this->Config[changeword][weiqun] . '功能', 'index.php');
         }
     }
     $this->TopicLogic = jlogic('topic');
     $this->my = array();
     if (MEMBER_ID < 1 && $this->Code) {
         $this->Messager("请先<a href='index.php?mod=login'>点此登录</a>或者<a href='index.php?mod=member'>点此注册</a>一个帐号", 'index.php?mod=login');
     }
     $this->my = jsg_member_info(MEMBER_ID);
     $this->ShowConfig = jconf::get('show');
     Load::logic('qun');
     $this->QunLogic = new QunLogic();
     ob_start();
     $code = $this->Code;
     if (!empty($this->Get['qid']) && empty($code)) {
         $code = 'view';
         $this->Code = $code;
     }
     if (method_exists('ModuleObject', $code)) {
         $this->{$code}();
     } else {
         $this->Code = 'index';
         $this->index();
     }
     $body = ob_get_clean();
     $this->ShowBody($body);
 }
Ejemplo n.º 6
0
 public function get_at_my_topic($p)
 {
     $rets = array();
     $uid = isset($p['uid']) ? (int) $p['uid'] : MEMBER_ID;
     $member = jsg_member_info($uid);
     if ($member) {
         if ($member['at_new'] > 0) {
             jlogic('member')->clean_new_remind('at_new', $member['uid']);
         }
         $rets = $this->get_at_my_tid($p, 1);
         if ($rets && is_array($rets)) {
             if (!$rets['error']) {
                 $rets['member'] = $member;
                 $rets['list'] = $rets['count'] > 0 && $rets['ids'] ? jlogic('topic')->Get($rets['ids']) : array();
                 if ($rets['list']) {
                     if ($GLOBALS['_J']['config']['is_topic_user_follow'] && !$GLOBALS['_J']['disable_user_follow']) {
                         if (true === IN_JISHIGOU_WAP) {
                             $rets['list'] = buddy_follow_html($rets['list'], 'uid', 'wap_follow_html');
                         } else {
                             $rets['list'] = jlogic('buddy')->follow_html2($rets['list']);
                         }
                     }
                     $rets['parent_list'] = jlogic('topic')->get_parent_list($rets['list']);
                 }
                 if (true === IN_JISHIGOU_WAP) {
                     $rets = wap_iconv($rets);
                 }
             }
         }
     } else {
         return jerror('您无权查看该信息,请先登录', -1);
     }
     return $rets;
 }
Ejemplo n.º 7
0
 function reminded()
 {
     $my = jsg_member_info(MEMBER_ID);
     if (!$my) {
         Mobile::error("No User", 300);
     }
     $ret = array('at_count' => $my['at_new'], 'comment_count' => $my['comment_new'], 'pm_count' => $my['newpm'], 'total' => (string) ($my['at_new'] + $my['comment_new'] + $my['newpm']));
     Mobile::output($ret);
 }
Ejemplo n.º 8
0
 public function new_tc($p)
 {
     $member = jsg_member_info(MEMBER_ID);
     $province_id = max(0, (int) $p['province_id']);
     $city_id = max(0, (int) $p['city_id']);
     $area_id = max(0, (int) $p['area_id']);
     if ($province_id < 1) {
         if ($province = $member['province']) {
             $province_id = jlogic('common_district')->get_id_by_name($province);
             if ($province_id > 0 && ($city = $member['city'])) {
                 $city_id = jlogic('common_district')->get_id_by_name($city);
                 if ($city_id > 0) {
                     $area = $member['area'];
                 }
             }
         }
     } else {
         $province = jlogic('common_district')->get_name_by_id($province_id);
         if ($province && $city_id > 0) {
             $city = jlogic('common_district')->get_name_by_id($city_id);
             if ($city && $area_id > 0) {
                 $area = jlogic('common_district')->get_name_by_id($area_id);
             }
         }
     }
     $ps = array('cache_time' => max(0, (int) $p['cache_time']), 'cache_key' => 'topic-new_tc-' . "{$province}-{$city}-{$area}", 'page_url' => $p['page_url'], 'province' => $province, 'city' => $city, 'area' => $area, 'type' => get_topic_type(), 'vip' => $GLOBALS['_J']['config']['only_show_vip_topic']);
     if (isset($p['perpage'])) {
         $ps['perpage'] = (int) $p['perpage'];
         if ($ps['perpage'] < 1) {
             $ps['perpage'] = 20;
         }
     }
     $rets = jlogic('topic_list')->get_tc_data($ps);
     if (is_array($rets)) {
         $rets['province'] = $province;
         $rets['city'] = $city;
         $rets['area'] = $area;
         $rets['province_id'] = $province_id;
         $rets['city_id'] = $city_id;
         $rets['area_id'] = $area_id;
         if ($member) {
             $rets['member'] = $member;
         }
         if ($rets['list']) {
             $rets['parent_list'] = jlogic('topic')->get_parent_list($rets['list']);
             $rets['relate_list'] = jlogic('topic')->get_relate_list($rets['list']);
             if ($GLOBALS['_J']['plugins']['func']['printtopic']) {
                 foreach ($rets['list'] as $row) {
                     jlogic('plugin')->hookscript('printtopic', 'funcs', $row, 'printtopic');
                 }
             }
         }
     }
     return $rets;
 }
Ejemplo n.º 9
0
 function get($p = array())
 {
     $uid = (int) $p['uid'];
     $uid = $uid > 0 ? $uid : MEMBER_ID;
     if ($uid < 1) {
         return jerror('获取用户粉丝列表数据时,UID不能为空或您没有登录系统', -1);
     }
     $member = jsg_member_info($uid);
     if (empty($member)) {
         return jerror('您要查看的用户已经不存在了,UID错误', -2);
     }
     $count = (int) $member['fans_count'];
     if ($count < 1) {
         return array();
     }
     $page_num = 10;
     if (isset($p['page_num'])) {
         $page_num = (int) $p['page_num'];
         if ($page_num < 1 || $page_num > 100) {
             return jerror('请设置每页显示的数量在 1 ~ 100 之间', -3);
         }
     }
     $ps = array('result_count' => $count, 'page_num' => $page_num, 'page_url' => $p['page_url'], 'sql_field' => ' M.* ', 'sql_table' => ' `' . DB::table($this->db->table_name($uid)) . '` AS BF LEFT JOIN `' . DB::table('members') . '` AS M ON M.`uid`=BF.`touid` ', 'sql_where' => " BF.`uid`='{$uid}' AND M.`uid` IS NOT NULL ", 'sql_order' => ' BF.`dateline` DESC ', 'result_list_row_make_func' => 'jsg_member_make', 'result_list_make_func' => 'buddy_follow_html');
     if (true === IN_JISHIGOU_WAP) {
         unset($ps['result_list_make_func']);
     }
     if (jallow($uid)) {
         if ($member['fans_new'] > 0) {
             jlogic('member')->clean_new_remind('fans_new', $uid);
         }
         if ($p['nickname']) {
             $nickname = jfilter($p['nickname'], 'txt');
             if (strlen($nickname) < 3 || strlen($nickname) > 15) {
                 return jerror('搜索用户昵称时,字数请控制在 3 ~ 15 个字符之间', -4);
             }
             unset($ps['result_count']);
             $ps['cache_time'] = 600;
             $ps['sql_where'] .= ' AND ' . build_like_query(' M.`nickname` ', $nickname);
         }
         if ($p['order'] && in_array($p['order'], array('lastpost', 'fans_count'))) {
             $p['sql_order'] = ' M.`' . $p['order'] . '` DESC ';
         }
     }
     $rets = $this->db->get($ps);
     if (is_array($rets)) {
         $rets['member'] = $member;
     }
     if (true === IN_JISHIGOU_WAP) {
         if ($rets['list']) {
             $rets['list'] = buddy_follow_html($rets['list'], 'uid', 'wap_follow_html');
         }
         $rets = wap_iconv($rets);
     }
     return $rets;
 }
Ejemplo n.º 10
0
 public function get_goods_list($exp = '', $order = "`order` desc,id desc", $limit = 12)
 {
     if ('all' == $exp) {
         return jtable("mall_goods")->get(array("sql_where" => 'expire > ' . TIMESTAMP, "sql_order" => $order, "page_num" => $limit));
     } elseif ('exp' == $exp) {
         $member = jsg_member_info(MEMBER_ID);
         $config = jconf::get('mall');
         $sql_where = "expire > " . TIMESTAMP . " AND credit <= " . $member['credits'] . " AND price <= " . $member[$config['credits']];
         return jtable("mall_goods")->get(array("sql_where" => $sql_where, "sql_order" => $order, "page_num" => $limit));
     } else {
         return jtable("mall_goods")->get(array("sql_order" => "id desc", "page_num" => $limit));
     }
 }
Ejemplo n.º 11
0
 function show_user($member = array())
 {
     if (MEMBER_ID < 0) {
         $this->other_login();
         return FALSE;
     }
     if (empty($member)) {
         $uid = MEMBER_ID;
         $member = jsg_member_info($uid);
     }
     include template('login/login_index_other');
     exit;
 }
Ejemplo n.º 12
0
 public function get_my_tag_topic($p)
 {
     $uid = isset($p['uid']) ? (int) $p['uid'] : MEMBER_ID;
     if (jdisallow($uid)) {
         return jerror('您无权查看');
     }
     $member = jsg_member_info($uid);
     if ($member['topic_new']) {
         jlogic('member')->clean_new_remind('topic_new', $uid);
     }
     $rets = $this->get_my_tag_tid($p, 1);
     if (is_array($rets)) {
         $rets['member'] = $member;
     }
     return jlogic('topic')->get_by_ids($rets);
 }
Ejemplo n.º 13
0
 function main()
 {
     $option = array();
     $option['page_url'] = 'admin.php?mod=reward';
     $id = (int) get_param('id');
     if ($id) {
         $option['id'] = $id;
         $option['page_url'] .= "&id={$id}";
     } else {
         unset($id);
     }
     $title = trim(get_param('title'));
     if (isset($title)) {
         $option['title'] = $title;
         $option['page_url'] .= "&title={$title}";
     }
     $timefrom = get_param('timefrom');
     $fromt = strtotime($timefrom);
     if ($fromt) {
         $option['fromt'] = $fromt;
         $option['page_url'] .= "&timefrom={$timefrom}";
     }
     $timeto = get_param('timeto');
     $tot = strtotime($timeto);
     if ($tot) {
         $option['tot'] = $tot;
         $option['page_url'] .= "&timeto={$timeto}";
     }
     $nickname1 = trim(get_param('nickname'));
     $uid = DB::result_first(" select `uid` from `" . TABLE_PREFIX . "members` where `nickname` = '{$nickname1}'");
     if ($uid > 0) {
         $option['uid'] = $uid;
         $option['page_url'] .= "&nickname={$nickname1}";
         $nickname = $nickname1;
     }
     $option['page'] = true;
     $option['per_page_num'] = min(500, max((int) $_GET['per_page_num'], (int) $_GET['pn'], 20));
     $option['_config'] = array('return' => 'array');
     $option['page_set'] = '20 30 40 50 100 200';
     extract(jlogic('reward')->getRewardList($option));
     $count = $count ? $count : 0;
     $member = jsg_member_info(MEMBER_ID);
     $this->Title = '有奖转发';
     include template('admin/reward_mian');
 }
Ejemplo n.º 14
0
 function qun_announcement_index()
 {
     $this->Title = $this->Config['changeword']['weiqun'] . '公告';
     $qid = jget('qid', 'int');
     $id = jget('id', 'int');
     if ($id < 1) {
         $id = jget('ids', 'int');
         if ($id < 1) {
             $id = jget('code', 'int');
         }
     }
     if ($id > 0) {
         $qun_announcement_info = jtable('qun_announcement')->info($id);
         $author_member = jsg_member_info($qun_announcement_info['author_id']);
         $this->Title .= ' - ' . cutstr(trim(strip_tags($qun_announcement_info['message'])), 30);
     }
     include template('qun/qun_announcement_index');
 }
Ejemplo n.º 15
0
 function goodsinfo()
 {
     $id = jget('id');
     $info = jlogic('mall')->get_info($id);
     if ($info) {
         $config = jconf::get('mall');
         $member = jsg_member_info(MEMBER_ID);
         if ($info['expire'] < TIMESTAMP) {
             $info['exp'] = '商品已过期';
         } elseif ($info['price'] > $member[$config['credits']]) {
             $info['exp'] = '您的' . $config['credits_name'] . '不够';
         } elseif ($info['credit'] > $member['credits']) {
             $info['exp'] = '您的总积分不够';
         } else {
             $info['exp'] = '';
         }
         $info['expire'] = my_date_format($info['expire']);
         $info['desc'] = nl2br($info['desc']);
         $this->Title = '商品详情 —— ' . $info['name'];
         $this->MetaKeywords = '积分兑换,商品详情';
         $this->MetaDescription = $info['name'];
         $top_credit_members = jlogic('mall')->get_top_member_credits();
         $feeds = jlogic('feed')->get_feed(5, "`action`='兑换了'");
         $css['mall'] = ' class="current"';
         $this->item = 'mall';
         $this->item_id = $id;
         $h_key = 'mall';
         $gets = array('mod' => 'mall', 'code' => 'goodsinfo', 'id' => $id);
         $page_url = 'index.php?' . url_implode($gets);
         $tids = jlogic('mall')->get_topic_by_goodsid($id);
         $options = array('tid' => $tids, 'perpage' => 5, 'page_url' => $page_url);
         $topic_info = jlogic('topic_list')->get_data($options);
         $topic_list = array();
         if (!empty($topic_info)) {
             $topic_list = $topic_info['list'];
             $page_arr['html'] = $topic_info['page']['html'];
         }
         $albums = jlogic('image')->getalbum();
         include template('mall_info');
     } else {
         header('Location: ' . jurl('index.php?mod=mall'));
     }
 }
Ejemplo n.º 16
0
 public function outbox($p)
 {
     $uid = isset($p['uid']) ? (int) $p['uid'] : MEMBER_ID;
     if (jdisallow($uid)) {
         return jerror('您没有权限进行此操作', -1);
     }
     $member = jsg_member_info($uid);
     $pn = (int) $p['page_num'];
     if ($pn < 1) {
         $pn = 10;
     }
     $ps = array('type' => array('both', 'reply'), 'page_num' => $pn);
     if (isset($p['page_url'])) {
         $ps['page_url'] = $p['page_url'];
     }
     $rets = jtable('member_topic')->get_tids($uid, $ps, 1);
     if (is_array($rets)) {
         $rets['member'] = $member;
     }
     return jlogic('topic')->get_by_ids($rets);
 }
Ejemplo n.º 17
0
 function Main()
 {
     $this->Title = "我的标签";
     $this->Code = 'user_tag';
     $uids = (int) MEMBER_ID;
     $member = jsg_member_info($uids);
     if ($member['validate'] && $member['validate_extra']) {
         $act_list['validate_extra'] = '专题设置';
     }
     $sql = "Select * From `" . TABLE_PREFIX . "user_tag` Where id >= (Select floor(RAND() * (Select MAX(id) From `" . TABLE_PREFIX . "user_tag`)))  Order By id Limit 20;";
     $query = $this->DatabaseHandler->Query($sql);
     $user_tag = array();
     while (false != ($row = $query->GetRow())) {
         $user_tag[] = $row;
     }
     $sql = "select * from `" . TABLE_PREFIX . "user_tag_fields` where `uid` = '" . MEMBER_ID . "'";
     $query = $this->DatabaseHandler->Query($sql);
     $user_tag_fields = array();
     while (false != ($row = $query->GetRow())) {
         $user_tag_fields[] = $row;
     }
     include template('topic_user_tag');
 }
Ejemplo n.º 18
0
function admin_check_allow($uid, $is_role_id = 0)
{
    global $_J;
    if (MEMBER_ID < 1) {
        return false;
    }
    if (true === JISHIGOU_FOUNDER) {
        return true;
    }
    $uid = is_numeric($uid) ? $uid : 0;
    if ($uid > 0) {
        if (!$is_role_id) {
            if ($uid == MEMBER_ID) {
                return true;
            }
            if (true === jsg_member_is_founder($uid)) {
                return false;
            }
            $info = jsg_member_info($uid);
            $role_id = $info['role_id'];
        } else {
            $role_id = $uid;
        }
        if ('normal' == $_J['member']['role_type']) {
            return false;
        }
        if ($role_id == $_J['member']['role_id']) {
            return false;
        }
        $role_info = jsg_role_info($role_id);
        if ('admin' == $role_info['type']) {
            return false;
        }
    }
    return true;
}
Ejemplo n.º 19
0
 function Send()
 {
     $member = jsg_member_info(MEMBER_ID);
     $TopicLogic = jlogic('topic');
     if ($member['medal_id']) {
         $medal_list = $TopicLogic->GetMedal($member['medal_id'], $member['uid']);
     }
     $topic_selected = 'pm';
     $this->Title = '发送新消息';
     $action = "index.php?mod=pm&code=dosend";
     $to_user = jget('to_user', 'txt');
     if (empty($to_user)) {
         $to_user = jget('nickname', 'txt');
         if (empty($to_user)) {
             $to_user = jget('to', 'txt');
         }
     }
     $message = jget('message');
     $subject = $this->Get['subject'] ? $this->Get['subject'] : $this->Post['subject'];
     $to_admin = jget('to_admin', 'int');
     $to_admin_id = jget('to_admin_id', 'int');
     if ($this->ID != 1) {
         $sql = "select msgtoid,msgfrom,subject,message from " . TABLE_PREFIX . 'pms' . " where pmid = '{$this->ID}'";
         $query = $this->DatabaseHandler->Query($sql);
         $pm = $query->GetRow();
         if ($pm != false) {
             $to_user = $pm['msgfrom'];
             $subject = "回复:" . $pm['subject'];
             $pm['message'] = $pm['message'];
         }
     }
     $left_menu = $this->LeftMenu();
     $my_grouplist = jlogic('buddy_follow_group')->get_my_group(MEMBER_ID);
     include template('pm/pm_write');
 }
Ejemplo n.º 20
0
 function check_new_topic($uid = MEMBER_ID, $update_lastactivity = 0, $return_tids = 0, $all_topic_notice = 0)
 {
     $uid = (int) ($uid ? $uid : MEMBER_ID);
     if ($uid < 1) {
         return 0;
     }
     $info = jsg_member_info($uid);
     if (!$info) {
         return 0;
     }
     $t = $info['lastactivity'];
     $count = 0;
     $tids = array();
     if ($t > 0 && $t + 29 < TIMESTAMP) {
         if ($all_topic_notice) {
             $sql = TABLE_PREFIX . "topic` WHERE `type`!='reply' AND `dateline`>'{$t}'";
             $count = DB::result_first("SELECT COUNT(1) AS `count` FROM `" . $sql);
             if ($return_tids) {
                 $query = DB::query("SELECT tid FROM `" . $sql);
                 while (false != ($row = DB::fetch($query))) {
                     $tids[] = $row['tid'];
                 }
             }
         } else {
             $p = array('uid' => $uid, 'count' => 100, 'buddy_lastuptime' => $t);
             $buddy_uids = $this->get_buddyids($p);
             if ($buddy_uids) {
                 $sql = TABLE_PREFIX . "topic` WHERE `uid` IN ('" . implode("','", $buddy_uids) . "') AND `type`!='reply' AND `dateline`>'{$t}'";
                 $count = DB::result_first("SELECT COUNT(1) AS `count` FROM `" . $sql);
                 if ($return_tids) {
                     $query = DB::query("SELECT tid FROM `" . $sql);
                     while (false != ($row = DB::fetch($query))) {
                         $tids[] = $row['tid'];
                     }
                 }
             }
         }
     }
     if ($update_lastactivity) {
         jtable('members')->update_count($uid, 'lastactivity', TIMESTAMP);
     }
     if ($return_tids) {
         return array('count' => $count, 'tids' => $tids);
     } else {
         return $count;
     }
 }
Ejemplo n.º 21
0
 function UpdateRole($uid)
 {
     $ret = 0;
     $member_info = jsg_member_info($uid);
     if (!$member_info) {
         return 0;
     }
     $credits = (int) $member_info['credits'];
     $role_id = max(0, (int) $member_info['role_id']);
     if ('normal' == $member_info['role_type']) {
         $role_c = DB::fetch_first("select * from " . DB::table('role') . " where `id`='{$role_id}'");
     } else {
         $role_c = DB::fetch_first("select * from " . DB::table('role') . " where `rank`='{$member_info['level']}' and `type`='normal' order by `creditshigher` desc, `creditslower` desc, `rank` desc limit 1");
     }
     $role_c_max = $role_c['creditshigher'];
     $role_c_min = $role_c['creditslower'];
     $role_level = $role_c['rank'];
     $role_n = array();
     if ($role_c_max && $credits < $role_c_max) {
         $role_n = DB::fetch_first("select * from " . DB::table('role') . " where `creditshigher`<'{$role_c_max}' and `type`='normal' order by `creditshigher` desc, `creditslower` desc, `rank` desc limit 1");
     } elseif ($role_c_min && $credits > $role_c_min) {
         $role_n = DB::fetch_first("select * from " . DB::table('role') . " where `creditshigher`>='{$role_c_min}' and `type`='normal' order by `creditshigher` asc, `creditslower` asc, `rank` asc limit 1");
     }
     $role_n_id = $role_n['id'];
     if ($role_n && $role_n_id > 0) {
         $role_level = $role_n['rank'];
         if ('normal' == $member_info['role_type'] && $role_n_id != $member_info['role_id']) {
             $ret = DB::query("update " . DB::table('members') . " set `role_id`='{$role_n_id}' where `uid`='{$uid}'");
         }
     }
     if ($role_level != $member_info['level']) {
         $ret = DB::query("update " . DB::table('members') . " set `level`='{$role_level}' where `uid`='{$uid}'");
     }
     return $ret;
 }
Ejemplo n.º 22
0
 function listcompany()
 {
     $gid = jget('gid');
     $info = jlogic('mall')->get_info($gid);
     $member = jsg_member_info(MEMBER_ID);
     $config = jconf::get('mall');
     if (MEMBER_ID == 0) {
         echo '<center><br><br><font color=red onclick="ShowLoginDialog(); return false;" style="font-weight:600;cursor: pointer;font-size:14px;">请先登录!</font><br><br><br><br></center>';
     } elseif (TIMESTAMP > $info['expire']) {
         echo '<center><br><br><font color=red>您要兑换的商品已过期下架,无法兑换!</font><br><br><br><br></center>';
     } elseif ($info['credit'] > $member['credits']) {
         echo '<center><br><br><font color=red>您的总积分没有达到兑换该商品的总积分要求!</font><br><br><br><br></center>';
     } elseif ($info['price'] > $member[$config['credits']]) {
         echo '<center><br><br><font color=red>您的' . $config['credits_name'] . '不足,没有达到兑换该商品所需要的' . $config['credits_name'] . '!</font><br><br><br><br></center>';
     } elseif ($num > $info['total']) {
         echo '<center><br><br><font color=red>您要兑换的商品库存不足!</font><br><br><br><br></center>';
     } else {
         $company_enable = $GLOBALS['_J']['config']['company_enable'];
         if ($company_enable && @is_file(ROOT_PATH . 'include/logic/cp.logic.php')) {
             $companyid = $GLOBALS['_J']['member']['companyid'];
             $companyselect = jlogic('cp')->get_cp_html($companyid);
         }
         include template('mall_ajax_bak');
     }
 }
Ejemplo n.º 23
0
 function QunSearch()
 {
     $qun_setting = $this->Config['qun_setting'];
     if (!$qun_setting['qun_open']) {
         $this->Messager("当前站点没有开放" . $this->Config[changeword][weiqun] . "功能");
     }
     $perpage = 10;
     $q = trim($this->Get['q']);
     $q = get_safe_code($q);
     $gets = array('mod' => 'search', 'code' => 'qun', 'q' => $this->Get['q']);
     $page_url = 'index.php?' . url_implode($gets);
     $count = 0;
     if (!empty($q)) {
         $q = $this->_filterKeyword($q);
         $search_keyword = $q;
         $QunLogic = jlogic('qun');
         $where = ' gview_perm=0 AND ' . build_like_query('name', $q) . ' ';
         $order = " ORDER BY dateline DESC ";
         $cache_time = 3600;
         if ($cache_time > 0) {
             $cache_key = "qun-search-{$q}";
             if (false === ($qids = cache_db('mget', $cache_key))) {
                 $query = DB::query("SELECT `qid` FROM " . DB::table('qun') . " WHERE {$where} {$order} LIMIT {$this->cache_ids_limit} ");
                 $qids = array();
                 while (false != ($row = DB::fetch($query))) {
                     $qids[$row['qid']] = $row['qid'];
                 }
                 cache_db('mset', $cache_key, $qids, $cache_time);
             }
             $where = $qids ? " `gview_perm`='0' AND `qid` IN ('" . implode("','", $qids) . "') " : "";
         }
         $qun_list = array();
         if ($where) {
             $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('qun') . " WHERE {$where}");
             if ($count > 0) {
                 $page_arr = page($count, $perpage, $page_url, array('return' => 'array'));
                 $query = DB::query("SELECT * FROM " . DB::table('qun') . " WHERE {$where} {$order} {$page_arr['limit']}");
                 while ($value = DB::fetch($query)) {
                     if (empty($value['icon'])) {
                         $value['icon'] = $QunLogic->qun_avatar($value['qid'], 's');
                     }
                     $value['dateline'] = my_date_format2($value['dateline']);
                     $qun_list[] = $value;
                 }
             }
         }
     }
     $member = jsg_member_info(MEMBER_ID);
     if ($member['medal_id']) {
         $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']);
     }
     $this->Title = $this->Config[changeword][weiqun] . '搜索';
     include template('social/search_list');
 }
Ejemplo n.º 24
0
 function _member()
 {
     $member = jsg_member_info(MEMBER_ID);
     return $member;
 }
Ejemplo n.º 25
0
 function join()
 {
     $qid = empty($this->Post['qid']) ? 0 : intval(trim($this->Post['qid']));
     if ($qid == 0) {
         json_error('错误的操作');
     }
     $qun_info = $this->QunLogic->get_qun_info($qid);
     if (empty($qun_info)) {
         json_error('当前' . $this->Config[changeword][weiqun] . '不存在或已经被删除');
     }
     $r = $this->QunLogic->is_qun_member($qid, MEMBER_ID);
     if ($r) {
         json_error('你已经是当前' . $this->Config[changeword][weiqun] . '成员了');
     }
     $join_type = $qun_info['join_type'];
     $tmp = $GLOBALS['_J']['member'];
     if (2 == $join_type) {
         json_error('当前' . $this->Config[changeword][weiqun] . '已禁止任何人再加入');
     }
     $message = '';
     if ($join_type == 1) {
         $message = trim($this->Post['message']);
         if (empty($message)) {
             $message = '什么都没有写';
         }
         $message = getstr($message, 280, 1, 1);
     }
     $member = array('uid' => MEMBER_ID, 'username' => $tmp['username'], 'message' => $message);
     unset($tmp);
     $level = $this->QunLogic->qun_level($qid);
     if ($level['member_num'] <= $qun_info['member_num']) {
         json_error('已经达到人数上限无法再加入');
     }
     $this->QunLogic->join_qun($qid, $member, $join_type);
     if ($join_type == 0) {
         $nickname = DB::result_first("SELECT nickname\r\n\t\t\t\t\t\t\t\t\t\t  FROM " . DB::table('members') . "\r\n\t\t\t\t\t\t\t\t\t\t  WHERE uid='{$qun_info['founderuid']}'");
         $data = array('qid' => $qid, 'nickname' => $nickname, 'qun_name' => $qun_info['name']);
         $txt_content = $this->_recd_msg('join_success', $data);
         $recd = true;
         $value = $txt_content;
         include template('qun/response_join');
     } else {
         if ($join_type == 1) {
             $sendMessage = "我申请加入" . $qun_info['name'] . "。申请理由:" . $message . ",请点击审核!" . jurl("index.php?mod=qun&code=manage&op=check_member&qid=" . $qun_info['qid']);
             $founderinfo = jsg_member_info($qun_info['founderuid']);
             $sendR = jlogic("pm")->pmSend(array('to_user' => $founderinfo['nickname'], 'message' => $sendMessage));
             json_result('申请加入成功,正在等待审核');
         }
     }
     exit;
 }
Ejemplo n.º 26
0
 function getRewardList($param)
 {
     $where = '';
     if ($fromt = $param['fromt']) {
         $where_arr['fromt'] = " `fromt` > '{$fromt}' ";
     }
     if ($tot = $param['tot']) {
         $where_arr['tot'] = " `tot` < '{$tot}' ";
     }
     if ($param['id']) {
         if (is_array($param['id'])) {
             $where_arr['id'] = " `id` in('" . implode("','", $param['id']) . "') ";
         } else {
             $where_arr['id'] = " `id` = '{$param[id]}' ";
         }
     }
     if ($param['uid']) {
         if (is_array($param['uid'])) {
             $where_arr['uid'] = " `uid` in('" . implode("','", $param['uid']) . "') ";
         } else {
             $where_arr['uid'] = " `uid` = '{$param['uid']}' ";
         }
     }
     if ($param['recd']) {
         $where_arr['recd'] = " `recd` = '{$param['recd']}' ";
     }
     if ($param['where']) {
         $where_arr['where'] = $param['where'];
     }
     if (isset($param['verify'])) {
         $where_arr['verify'] = " `verify` = '{$param[verify]}' ";
     } else {
         $where_arr['verify'] = ' `verify` = 1 ';
     }
     if ($where_arr) {
         $where = ' where ' . implode(' and ', $where_arr);
     }
     if ($param['page']) {
         $count = DB::result_first(" select count(*) from `" . TABLE_PREFIX . "reward` {$where} ");
         if ($count) {
             $page_arr = page($count, $param['per_page_num'], $param['page_url'], $param['_config'], $param['page_set']);
         }
         $limit = $page_arr['limit'];
     } else {
         if ($param['limit']) {
             $limit = ' limit ' . $param['limit'];
         } else {
             return array();
         }
     }
     $order = ' order by ' . ($param['order'] ? $param['order'] : ' `id` desc ');
     $sql = " select * from `" . TABLE_PREFIX . "reward` {$where} {$order} {$limit} ";
     $query = DB::query($sql);
     $reward_list = array();
     while ($rs = DB::fetch($query)) {
         $reward_list[$rs['id']] = $rs;
         $reward_list[$rs['id']]['from_time'] = date('Y-m-d H:i:s', $rs['fromt']);
         $reward_list[$rs['id']]['to_time'] = date('Y-m-d H:i:s', $rs['tot']);
         $reward_list[$rs['id']]['post_time'] = date('Y-m-d H:i:s', $rs['posttime']);
         $reward_list[$rs['id']]['postip'] = long2ip($rs['postip']);
         if ($image_id = $rs['image']) {
             $reward_list[$rs['id']]['image'] = DB::result_first(" select `image` from `" . TABLE_PREFIX . "reward_image` where `id` = '{$image_id}'");
         }
         if ($eventImageID = $rs['event_image']) {
             $reward_list[$rs['id']]['event_image_path'] = DB::result_first(" select `image` from `" . TABLE_PREFIX . "reward_image` where `id` = '{$eventImageID}'");
         }
         #默认图片
         $reward_list[$rs['id']]['image'] = $reward_list[$rs['id']]['image'] ? $reward_list[$rs['id']]['image'] : './images/reward_noPic.gif';
         $reward_list[$rs['id']]['event_image_path'] || ($reward_list[$rs['id']]['event_image_path'] = $reward_list[$rs['id']]['image']);
         $reward_list[$rs['id']]['content_cut'] = cut_str(strip_tags($rs['content']), 20);
         $member = jsg_member_info($rs['uid']);
         $reward_list[$rs['id']]['username'] = $member['username'];
         $reward_list[$rs['id']]['nickname'] = $member['nickname'];
         $reward_list[$rs['id']]['face'] = face_get($rs['uid']);
         $reward_list[$rs['id']]['validate_html'] = $member['validate_html'];
         if ($rs['recd']) {
             $reward_list[$rs['id']]['recd_checked'] = 'checked';
         }
     }
     return array('reward_list' => $reward_list, 'page_arr' => $page_arr, 'count' => $count ? $count : $limit);
 }
Ejemplo n.º 27
0
    ?>
 <script type="text/javascript">
$(document).ready(function(){
$(".t_setting").mouseover(function(){$(".t_member_box").show();$(".t_setting").addClass("on");});
$(".t_setting").mouseout(function(){$(".t_member_box").hide();$(".t_setting").removeClass("on");});
$(".t_news").mouseover(function(){$(".t_news_box").show();$(".t_news").addClass("onn");});
$(".t_news").mouseout(function(){$(".t_news_box").hide();$(".t_news").removeClass("onn");});
});
</script> <?php 
    if ($member['uid'] == MEMBER_ID) {
        $_mymember = $member;
    }
    ?>
 <?php 
    if ($member['uid'] != MEMBER_ID) {
        $_mymember = jsg_member_info(MEMBER_ID);
    }
    ?>
 <li class="t_member" onclick="location='index.php?mod=<?php 
    echo MEMBER_NAME;
    ?>
'" title="我是<?php 
    echo MEMBER_NICKNAME;
    ?>
,点此访问个人主页" style="cursor:pointer;"> <!--<b class="member_name"><?php 
    echo MEMBER_NICKNAME;
    ?>
</b>--> <img class="member" src="<?php 
    echo $_mymember['face_original'];
    ?>
" onerror="javascript:faceError(this);"/> </li> <li class="t_write t_sub" style="cursor:pointer;" onclick="showMainPublishBox('<?php 
Ejemplo n.º 28
0
 public function jsg_get_wechat_openid($openid)
 {
     $openid = trim($openid);
     if ($openid) {
         if (empty($openid)) {
             return FALSE;
         }
         $r = DB::query("select * from `" . TABLE_PREFIX . "wechat` where wechat_id = '" . $openid . "'");
         $r = DB::fetch($r);
         if ($r) {
             $member = jsg_member_info($r['jsg_id']);
             return array($member['uid'], $member['password']);
         } else {
             return FALSE;
         }
     } else {
         return FALSE;
     }
 }
Ejemplo n.º 29
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');
         }
     }
 }
Ejemplo n.º 30
0
 function HasPermission($mod, $code, $is_admin = 0, $uid = 0)
 {
     $MemberFields = array();
     if ($uid) {
         if (is_array($uid)) {
             $MemberFields = $uid;
         } elseif (($uid = max(0, (int) $uid)) > 0 && $uid != $this->MemberFields['uid']) {
             $MemberFields = jsg_member_info($uid);
         }
         if ($MemberFields && ($_role_info = jtable('role')->row($MemberFields['role_id']))) {
             $MemberFields = array_merge($MemberFields, $_role_info);
         }
     }
     if (!$MemberFields || $MemberFields['uid'] < 1) {
         $MemberFields = $this->MemberFields;
     }
     $mod = trim($mod);
     $action = trim($code);
     $role_id = (int) $MemberFields['role_id'];
     $role_name = $MemberFields['role_name'];
     $role_privilege = $MemberFields['role_privilege'];
     if ($role_id < 1 && true !== JISHIGOU_FOUNDER) {
         $this->_SetError("角色编号不能为空,或者该编号在服务器上已经删除");
         return false;
     }
     $is_admin = $is_admin ? 1 : 0;
     if (!isset($this->ActionList[$mod])) {
         $this->ActionList[$mod] = jtable('role_action')->get_list($mod, $is_admin);
     }
     $current_action = array();
     if (($current_action_id = $this->ActionList[$mod]['index'][$action]) !== null || ($current_action_id = $this->ActionList[$mod]['index']["*"]) !== null) {
         $current_action = $this->ActionList[$mod]['info'][$current_action_id];
         $current_action['id'] = $current_action_id;
         $current_action['mod'] = $mod;
         $this->_SetCurrentAction($current_action);
         if (true === JISHIGOU_FOUNDER) {
             return true;
         }
         if ($current_action['allow_all'] == 1) {
             return true;
         }
         if ($current_action['allow_all'] == '-1') {
             $this->_SetError("系统已经禁止<B>{$current_action['name']}</B>的任何操作");
             return false;
         }
         if ($MemberFields['role_privilege'] == "*") {
             return true;
         }
         if (false === jsg_find($role_privilege, $current_action_id, ',')) {
             if ($ActionList[$current_action_id]['message']) {
                 $message = $ActionList[$current_action_id]['message'];
             } else {
                 $message = "您的角色({$role_name})没有{$current_action['name']}权限";
                 if (5 == $role_id) {
                     $message .= ";<br />请先通过<a href='index.php?mod=settings#modify_email_area'>邮件验证</a>或者<a href='index.php?mod=other&code=contact'>联系我们</a>";
                 }
             }
             $this->_SetError($message);
             return false;
         }
     } else {
         $this->_SetCurrentAction($current_action);
         if (!$GLOBALS['_J']['config']['safe_mode']) {
             return true;
         }
         if (!$is_admin) {
             return true;
         }
         if ('POST' != $_SERVER['REQUEST_METHOD']) {
             return true;
         }
         if (!$GLOBALS['_J']['config']['jishigou_founder']) {
             return true;
         }
         $error = "操作模块:{$mod}<br>操作指令:{$action}<br><br>";
         $error .= "由于此操作在系统中没有权限控制,您暂时无法执行该操作,请联系网站的超级管理员。";
         $this->_SetError($error);
         return false;
     }
     return true;
 }