function DoExecute() { $id = $this->Post['id'] ? $this->Post['id'] : $this->Get['id']; jfunc('schedule'); if (!($this->ScheduleInfo = schedule_get($id, 1))) { return false; } if ($this->ScheduleInfo['type'] && method_exists($this, $method = "_exec_{$this->ScheduleInfo['type']}")) { $this->_init_uid($this->ScheduleInfo['uid']); $ret = $this->{$method}(); response_text((string) $ret); } }
function mail_send_test() { $k = jget('k', 'int'); $smtp = jconf::get('smtp'); $test_smtp = $smtp['smtp'][$k]; jfunc('mail'); $ret = _send_mail_by_smtp($test_smtp['mail'], $this->Config['site_name'] . '-' . date('Y-m-d H:i:s'), '邮件测试正文---' . date('Y-m-d H:i:s'), $test_smtp); if ($ret) { echo '发送成功。'; } else { echo '发送不成功,请检查配置是否正确。'; } exit; }
function view() { $uid = MEMBER_ID; $qid = intval(trim($this->Get['qid'])); $tag = get_safe_code($this->Get['tag']); $view = trim($this->Get['view']); $qun_info = $this->QunLogic->get_qun_info($qid); if ($qun_info['qun_theme_id']) { $this->Config['qun_theme_id'] = $qun_info['qun_theme_id']; $this->Config['theme_id'] = ''; $this->Config['theme_bg_image'] = ''; $this->Config['theme_bg_color'] = ''; $this->Config['theme_text_color'] = ''; $this->Config['theme_link_color'] = ''; $this->Config['theme_bg_image_type'] = ''; $this->Config['theme_bg_repeat'] = ''; $this->Config['theme_bg_fixed'] = ''; } if (empty($qun_info)) { $this->Messager("当前" . $this->Config[changeword][weiqun] . "不存在或者已经被删除了", 'index.php?mod=qun'); } if (!empty($tag)) { $qun_info['icon'] = $this->QunLogic->qun_avatar($qun_info['qid'], 's'); } else { $qun_info['icon'] = $this->QunLogic->qun_avatar($qun_info['qid'], 'b'); } $active = array(); $topic_list = array(); $get_topic_flg = true; $this->item_id = $qid; $params['code'] = $this->item; $cat_ary = $this->QunLogic->get_category(); $top_cat = array(); $sub_cat = array(); if ($cat_ary['second'][$qun_info['cat_id']]) { $sub_cat = array('cat_name' => $cat_ary['second'][$qun_info['cat_id']]['cat_name'], 'cat_id' => $qun_info['cat_id']); $parent_id = $cat_ary['second'][$qun_info['cat_id']]['parent_id']; $top_cat = array('cat_name' => $cat_ary['first'][$parent_id]['cat_name'], 'cat_id' => $parent_id); } else { $top_cat = array('cat_name' => $cat_ary['first'][$qun_info['cat_id']]['cat_name'], 'cat_id' => $qun_info['cat_id']); } $founder_info = $this->TopicLogic->GetMember($qun_info['founderuid']); $qun_admin_list = $this->QunLogic->get_admin_list($qid); $tag_ary = $this->QunLogic->get_qun_tag($qid); $recd_event_list = $this->QunLogic->getRecdEventList($qid); $recd_vote_list = $this->QunLogic->getRecdVoteList($qid); $followme_nums = $this->QunLogic->followme_nums($qid, MEMBER_ID); $perm = $this->QunLogic->chk_perm($qid, MEMBER_ID); $status = ''; $allow_list_manage = false; if (in_array($perm, array(1, 2, 4)) || MEMBER_ROLE_TYPE == 'admin') { $status = 'isgroupuser'; $allow_list_manage = true; } jfunc('app'); $gets = array('mod' => 'qun', 'type' => $this->Get['type'], 'qid' => $qid, 'tag' => $this->Get['tag'], 'code' => $this->Code); $page_url = 'index.php?' . url_implode($gets); $where = " type!='reply' "; if ($this->Get['type']) { if ('pic' == $this->Get['type']) { $where = " `imageid` > 0 "; } else { if ('video' == $this->Get['type']) { $where = " `videoid` > 0 "; } else { if ('music' == $this->Get['type']) { $where = " `musicid` > 0 "; } else { $this->Get['type'] = ''; } } } } if (!empty($tag)) { $sql = "SELECT * FROM " . DB::table('tag') . " WHERE name='" . addslashes($tag) . "'"; $tag_info = DB::fetch_first($sql); $tag_id = $tag_info['id']; $sql = "SELECT item_id FROM " . DB::table('topic_tag') . " WHERE tag_id='{$tag_id}' "; $query = DB::query($sql); $topic_ids = array(); while ($row = DB::fetch($query)) { $topic_ids[$row['item_id']] = $row['item_id']; } if (!empty($topic_ids)) { $where .= " AND tid IN(" . jimplode($topic_ids) . ") "; } $content = "#{$tag}#"; $view = 'tag'; } else { if ($view == "newreply") { $type_where = ' AND ' . $where; $per_page_num = $this->ShowConfig['qun']['topic_reply'] ? $this->ShowConfig['qun']['topic_reply'] : 10; $count = DB::result_first("SELECT COUNT(*)\r\n\t\t\t\t\t\t\t\t\t\t\tFROM " . DB::table('topic') . "\r\n\t\t\t\t\t\t\t\t\t\t\tWhere `replys` > 0 AND item='qun' AND item_id='{$qid}' {$type_where}"); if ($count > 0) { $page_arr = page($count, $per_page_num, $page_url, array('return' => 'array')); $condition = " WHERE `replys` > 0 AND item='qun' AND item_id='{$qid}' {$type_where} ORDER BY `lastupdate` DESC {$page_arr['limit']}"; $topic_list = $this->TopicLogic->Get($condition); } $get_topic_flg = false; } else { if ($view == 'recd') { Load::logic('topic_list'); $TopicListLogic = new TopicListLogic(); $p = array('where' => " tr.recd <= 2 AND tr.item='qun' AND tr.item_id='{$qid}' ", 'perpage' => $per_page_num, 'filter' => $this->Get['type']); $info = $TopicListLogic->get_recd_list($p); if (!empty($info)) { $count = $info['count']; $topic_list = $info['list']; $page_arr = $info['page']; } $get_topic_flg = false; } elseif ($view == 'event') { $param = array('qid' => $qid, 'where' => " a.item = 'qun' and a.item_id = '{$qid}' ", 'page' => true, 'perpage' => 10, 'page_url' => 'index.php?mod=qun&view=event&qid=' . $qid); load::logic('event'); $EventLogic = new EventLogic(); $return = $EventLogic->getEventInfo($param); $count = $return['count'] ? $return['count'] : 0; $event = $return['event_list']; $page_arr = $return['page']; $get_topic_flg = false; } elseif ($view == 'vote') { load::logic('vote'); $VoteLogic = new VoteLogic(); $param = array('where' => " v.item = 'qun' and v.item_id = '{$qid}' ", 'order' => " order by v.dateline ", 'page' => true, 'perpage' => 10, 'page_url' => 'index.php?mod=qun&view=vote&qid=' . $qid); $return = $VoteLogic->find($param); $count = $return['count'] ? $return['count'] : 0; if (!empty($return)) { $vote_list = $return['vote_list']; $page_arr['html'] = $return['page']['html']; $uid_ary = $return['uids']; } if (!empty($uid_ary)) { $members = $this->TopicLogic->GetMember($uid_ary); } $get_topic_flg = false; } elseif ($view == 'image') { $param = array('item' => 'qun', 'itemid' => $qid, 'page' => true, 'per_page_num' => 20, 'page_url' => 'index.php?mod=qun&view=image&qid=' . $qid); $return = jlogic('image')->get($param); $count = $return['count'] ? $return['count'] : 0; $image_list = $return['list']; $page_arr['html'] = $return['page']['html']; $get_topic_flg = false; } elseif ($view == 'attach' && $this->Config['qun_attach_enable']) { global $attach_list; $type = $this->Get['type']; load::logic('attach'); $AttachLogic = new AttachLogic(); $param = array('item' => 'qun', 'itemid' => $qid, 'page' => true, 'per_page_num' => 20, 'page_url' => 'index.php?mod=qun&view=attach&qid=' . $qid . '&type=' . $type); if ($type) { if ('hot' == $type) { $param['order'] = " order by download DESC "; } else { if ('new' == $type) { $param['order'] = " order by id DESC "; } } } $return = $AttachLogic->get($param); $count = $return['count'] ? $return['count'] : 0; $attach_list = $return['list']; $page_arr['html'] = $return['page']['html']; $get_topic_flg = false; } else { $view = 'newtopic'; } } $active[$view] = "class='current'"; } if ($get_topic_flg) { $options = array('where' => $where, 'page' => true, 'perpage' => $this->ShowConfig['qun']['topic_new'] ? $this->ShowConfig['qun']['topic_new'] : 10, 'page_url' => $page_url); $topic_info = app_get_topic_list($this->item, $qid, $options); if (!empty($topic_info)) { $topic_list = $topic_info['list']; $page_arr['html'] = $topic_info['page']['html']; } } $topic_list_count = count($topic_list); $parent_list = $this->_get_parent_topic($topic_list); $gets = array('item' => $this->item, 'item_id' => $qid); $member =& $this->my; if (!$this->Config['acceleration_mode'] && $member['medal_id']) { $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']); } $set_qun_closed = 1; if (empty($tag)) { $new_members = $this->QunLogic->get_new_member_list($qid); $this->Title = $this->Config[changeword][weiqun] . ' - ' . $qun_info['name']; include template('qun/view'); } else { $this->Title = $this->Config[changeword][weiqun] . ' - ' . $qun_info['name'] . ' - ' . $tag; include template('qun/tag_view'); } }
function view() { $lid = jget('id', 'int', 'G'); if (!$this->TalkLogic->is_exists($lid)) { return false; } $list = $this->TalkLogic->Getguest($lid); $this->item = 'talk'; $this->item_id = $item_id = $lid; $talk = $this->TalkLogic->id2talkinfo($lid, $list); $uids = array(); $gets = array('mod' => 'talk', 'code' => 'view', 'id' => $lid); $page_url = 'index.php?' . url_implode($gets); $perpage = $talk['status_css'] == 'ico_ongoing' ? 1000 : 20; $options = array('page' => true, 'perpage' => $perpage, 'page_url' => $page_url, 'order' => ' dateline DESC '); if (empty($talk)) { $this->Messager('当前访谈不存在!'); } elseif ($talk['all']) { $defaust_value = ' <font color="#0080c7">我有一个想法和大家分享</font>'; foreach ($talk['all'] as $key => $val) { $uids[$key] = $key; } } if ($talk['status_css'] == 'ico_ongoing') { $talklistcss = ' talk-list'; $asklistcss = ' ask-list'; } $is_talk_hosts = in_array(MEMBER_ID, $uids) ? true : false; $talkvisit_str = $this->Config['site_url'] . '/index.php?mod=talk&code=view&id=' . $lid; $cat = $this->TalkLogic->get_category($talk['cat_id'], 'second'); $catp = $this->TalkLogic->get_category($cat['parent_id'], 'first'); $talk_config = jconf::get('talk'); if (MEMBER_STYLE_THREE_TOL) { $member = $this->TopicLogic->GetMember(MEMBER_ID); } $param = array('limit' => '5'); $talk_info = $this->TalkLogic->get_list($param); if (!empty($talk_info)) { $talk_count = $talk_info['count']; $talk_list = $talk_info['list']; } jfunc('app'); $options['talkwhere'] = ' uid NOT IN (' . jimplode($uids) . ')'; $topic_info = app_get_topic_list('talk', $lid, $options); $options['talkwhere'] = ' totid > 0'; $answer_info = app_get_topic_list('talk', $lid, $options); $options['talkwhere'] = ' istop = 1'; $options['order'] = ' lastupdate DESC '; $question_info = app_get_topic_list('talk', $lid, $options); $myanswerids = app_getmyanswerid($lid); if (!empty($topic_info['list'])) { $topic_list = $topic_info['list']; foreach ($topic_list as $key => $val) { if (in_array($val['tid'], $myanswerids) && $talk[status_css] == 'ico_ongoing') { $topic_list[$key]['reply_ok'] = true; } } $topic_count = $topic_info['count']; $topic_page_arr = $topic_info['page']; } if (!empty($question_info['list'])) { $question_list = $question_info['list']; $ask_count = $question_info['count']; $ask_page_arr = $question_info['page']; foreach ($question_list as $key => $val) { $ask_info = array(); $u_t = $this->TalkLogic->id2usertype($lid, $val['uid'], $list); if ($u_t == 'guest') { $question_list[$key]['user_str'] = '本期嘉宾'; } else { $question_list[$key]['user_str'] = ' '; } $question_list[$key]['user_css'] = 'talk' . $u_t; if (empty($question_list[$key]['touid'])) { $question_list[$key]['biank_css'] = 'talk_view_ping'; $question_list[$key]['tubiao_css'] = 'talk_view_pin'; } else { $question_list[$key]['biank_css'] = 'talk_view_wenda'; $question_list[$key]['tubiao_css'] = 'talk_view_wen'; if (!empty($answer_info['list'])) { foreach ($answer_info['list'] as $k => $v) { if ($v['totid'] == $val['tid']) { $ask_info['list'][$k] = $v; } } } if (!empty($ask_info)) { $question_list[$key]['ask_list'] = $ask_info['list']; foreach ($question_list[$key]['ask_list'] as $k => $v) { $u_ta = $this->TalkLogic->id2usertype($lid, $v['uid'], $list); if ($u_ta == 'guest') { $question_list[$key]['ask_list'][$k]['user_str'] = '本期嘉宾'; } else { $question_list[$key]['ask_list'][$k]['user_str'] = ' '; } $question_list[$key]['ask_list'][$k]['tubiao_css'] = 'talk_view_da'; $question_list[$key]['ask_list'][$k]['user_css'] = 'talk' . $u_ta; } } } } } $this->Title = '访谈 - ' . $talk['talkname']; $albums = jlogic('image')->getalbum(); include template("talk/talk"); }
show_message(r.msg,3); $('#username_new').focus(); }else{ show_message(r.msg,3); $('#username_new').val(''); $('#username_new').focus(); } } ); } return false; } $(document).ready(function(){ var selectOption= <?php jfunc('area'); echo area_config_to_json(); ?> ; <?php if ($op == '') { ?> changeProvince(); <?php } ?> }); var validateRegularList={ province:{dataType:"LimitB",min:'1',msg:"请选择省/直辖市"}, city:{dataType:"LimitB",min:'1',msg:"请选择城市/地区"}, email2:{require:"false",dataType:"Email",msg:"邮箱格式不正确"},
function edit($oldnickname, $oldpw = '', $nickname = '', $password = '', $email = '', $username = '', $ignoreoldpw = 0, $inadmin = 0, $email_checked = 0) { $oldmember = array(); if (!$ignoreoldpw) { $rets = $this->login_check($oldnickname, $oldpw); if ($rets['uid'] < 1) { return $rets['uid'] - 10; } else { $oldmember = $rets; } } else { $oldmember = jsg_get_member($oldnickname, 'nickname', 0); } $uc_password = $uc_email = ''; $newmember = array(); if ($nickname && $nickname != $oldmember['nickname'] && (true !== UCENTER || true === UCENTER_MODIFY_NICKNAME || $ignoreoldpw)) { if ($oldmember['nickname'] && !$GLOBALS['_J']['config']['edit_nickname_enable'] && !$ignoreoldpw) { return -8; } $ret = $this->checkname($nickname, 1, 0, $oldmember['uid']); if ($ret < 1) { return $ret; } $newmember['nickname'] = $nickname; } if ($password) { $salt = $oldmember['salt'] ? $oldmember['salt'] : jsg_member_salt(); $password_hash = jsg_member_password($password, $salt); if ($password_hash != $oldmember['password']) { $newmember['password'] = $password_hash; $newmember['salt'] = $salt; } $uc_password = $password; } if ($username && $username != $oldmember['username'] && (!$oldmember['username'] || is_numeric($oldmember['username']) || $ignoreoldpw)) { $ret = $this->checkname($username, 0, 0, $oldmember['uid']); if ($ret < 1) { return $ret; } $newmember['username'] = $username; } if ($email && $email != $oldmember['email']) { $ret = $this->checkemail($email); if ($ret < 1) { return $ret; } if ($GLOBALS['_J']['config']['reg_email_verify'] && !$inadmin) { $newmember['role_id'] = $oldmember['role_id'] && $oldmember['role_id'] != $GLOBALS['_J']['config']['no_verify_email_role_id'] ? $oldmember['role_id'] : $GLOBALS['_J']['config']['no_verify_email_role_id']; jfunc('my'); my_member_validate($oldmember['uid'], $email, (int) ($oldmember['role_id'] != $GLOBALS['_J']['config']['no_verify_email_role_id'] ? $oldmember['role_id'] : $GLOBALS['_J']['config']['normal_default_role_id'])); } if (!$inadmin && $oldmember['email_checked'] > 0) { $newmember['email2'] = $email; } else { $newmember['email'] = $email; } $uc_email = $email; } if ($email && $inadmin) { $newmember['email_checked'] = $email_checked; if ($oldmember['role_id'] == '5' && $email_checked > 0) { $newmember['role_id'] = '3'; } } if ($inadmin && $oldmember['email_checked'] > 0 && $email_checked == 0) { $newmember['email2'] = ''; } if (true === UCENTER && $oldmember['ucuid'] > 0 && ($uc_password || $uc_email)) { $ret = uc_user_edit($oldnickname, $oldpw, $uc_password, $uc_email, $ignoreoldpw); if ($ret < 0 && -7 != $ret && -8 != $ret) { return $ret; } } if ($newmember) { $ret = jtable('members')->update($newmember, $oldmember['uid']); } else { return -7; } #if NEDU if (defined('NEDU_MOYO')) { ndata('sync')->member()->modify($oldmember['uid']); } #endif return 1; }
function GetRewardList() { jfunc('app'); $item = "reward"; $item_id = intval(trim($this->Get['item_id'])); if ($item_id < 1) { exit; } $gets = array('mod' => $item, 'code' => "detail", 'id' => $item_id); $page_url = 'index.php?' . url_implode($gets); $where = ''; $options = array('where' => $where, 'page' => true, 'perpage' => 5, 'page_url' => $page_url); $topic_info = app_get_topic_list($item, $item_id, $options); $topic_list = array(); if (!empty($topic_info)) { $topic_list = $topic_info['list']; $page_arr['html'] = $topic_info['page']['html']; $no_from = true; include template('topic_list_ajax'); } exit; }
function add() { if (MEMBER_ID < 1) { Mobile::error('No Login', 410); } if ($this->MemberHandler->HasPermission($this->Module, $this->Code) == false) { Mobile::error('No Permission', 411); } $content = trim(strip_tags($this->Post['content'])); if (!$content) { Mobile::error('No Content', 420); } $topic_type = $this->Post['topictype']; if ('both' == $topic_type) { $type = 'both'; } elseif ('reply' == $topic_type) { $type = 'reply'; } elseif ('forward' == $topic_type) { $type = 'forward'; } elseif ('qun' == $topic_type) { $type = 'qun'; } elseif ('personal' == $topic_type) { $type = 'personal'; } elseif (is_numeric($topic_type)) { $type = 'first'; } else { $type = 'first'; } $totid = max(0, (int) $this->Post['totid']); $imageid = $this->Upload(); $videoid = max(0, (int) $this->Post['videoid']); $longtextid = max(0, (int) $this->Post['longtextid']); $subjectid = max(0, (int) $this->Post['subjectid']); $from = trim(strtolower($this->Post['from'])); $item = trim($this->Post['item']); $item_id = intval(trim($this->Post['item_id'])); if (!empty($item_id)) { jfunc('app'); $ret = app_check($item, $item_id); if (!$ret) { $item = ''; $item_id = 0; } } else { $item = ''; $item_id = 0; } $data = array('content' => $content, 'totid' => $totid, 'imageid' => $imageid, 'videoid' => $videoid, 'from' => empty($from) ? 'mobile' : $from, 'type' => $type, 'item' => $item, 'item_id' => $item_id, 'longtextid' => $longtextid, 'subjectid' => $subjectid); $return = $this->TopicLogic->Add($data); if (is_array($return) && $return['tid'] > 0) { Mobile::success('Publish Success' . $subjectid, 200); } else { $return = is_string($return) ? $return : (is_array($return) ? implode("", $return) : "Unkown Error"); Mobile::output($return, 'Error', 430); } }
function GetRewardDetail() { $id = (int) get_param('id'); if ($id < 1) { $this->Messager('你查看的有奖转发信息不存在或已删除', -1); } $reward = jlogic('reward')->getRewardInfo($id); if (!$reward) { $this->Messager('你查看的有奖转发信息不存在或已删除', -1); } if ($reward['rules']['tag']) { $content = '#' . implode('##', $reward['rules']['tag']) . '#'; } #有奖转发活动的参与者(显示N个) $param = array('rid' => $id, 'limit' => 9); $ret = jlogic('reward')->getRewardUser($param); $play_member = $ret['user']; $play_num = $ret['count']; jfunc('app'); $gets = array('mod' => 'reward', 'code' => "detail", 'id' => $id); $page_url = 'index.php?' . url_implode($gets); $options = array('page' => true, 'perpage' => 5, 'page_url' => $page_url); $topic_info = app_get_topic_list('reward', $id, $options); $topic_list = array(); if (!empty($topic_info)) { $topic_list = $topic_info['list']; $page_arr['html'] = $topic_info['page']['html']; $no_from = true; } $this->item = 'reward'; $this->item_id = $id; $set_qun_closed = 1; $set_event_closed = 1; $set_fenlei_closed = 1; $set_vote_closed = 1; if (DB::result_first("select id from `" . TABLE_PREFIX . "reward_user` where uid = '" . MEMBER_ID . "' and rid='" . $this->item_id . "' and`on` = 1")) { $isReward = true; } $member = jsg_member_info(MEMBER_ID); $this->Title = cut_str($reward['title'], 10); include_once template('reward/reward_datail'); }
function do_recd() { Load::logic('topic_recommend'); $TopicRecommendLogic = new TopicRecommendLogic(); $tid = intval($this->Post['tid']); $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("您的角色没有推荐微博的权限!"); } $recd = intval($this->Post['recd'][0]); if ($recd > 4 || $recd < 0) { json_error("推荐类型错误"); } 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("你没有权限推荐群内微博"); } } if ($recd == 0) { $topic_recd = $TopicRecommendLogic->delete(array($tid)); json_result("0|||取消推荐成功!"); } else { $expiration = jstrtotime(trim($this->Post['expiration'])); $tag_id = intval($this->Post['tag_id']); $r_title = strip_tags(trim($this->Post['r_title'])); if (!empty($tag_id)) { $count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('topic_tag') . " WHERE item_id='{$tid}' AND tag_id='{$tag_id}' "); if (!empty($count)) { $topic['item'] = 'tag'; $topic['item_id'] = $tag_id; } } $item = $this->Post['item_id'] ? 'channel' : $topic['item']; $item_id = $this->Post['item_id'] ? intval($this->Post['item_id']) : $topic['item_id']; if (empty($r_title)) { json_error("推荐标题为空或内容不合法"); } if ($expiration && $expiration < time()) { json_error("时间设置无效,请重新设置"); } $data = array('expiration' => $expiration, 'item' => $item, 'item_id' => $item_id, 'tid' => $tid, 'recd' => $recd, 'dateline' => TIMESTAMP, 'r_uid' => MEMBER_ID, 'r_nickname' => MEMBER_NICKNAME, 'r_title' => $r_title); if ($TopicRecommendLogic->is_exists($tid)) { unset($data['tid']); $TopicRecommendLogic->modify($data, array('tid' => $tid)); json_result("2|||重新推荐成功!"); } else { $TopicRecommendLogic->add($data); feed_msg('recommend', 'recommend', $tid, $r_title, $item_id); if ($recd == 4) { $iphone_msg = cut_str($topic['content'], 30, ''); ios_push_msg('all', $r_title . ':' . $iphone_msg); } $credits = jconf::get('credits'); update_credits_by_action('recommend', $topic['uid']); json_result("1|||推荐成功!被推荐者因:" . $this->js_show_msg(1)); } } }
function DoModifyHZSWB() { jfunc('hzswb'); $hzswb_default = jconf::get('hzswb'); $hzswb = $this->Post['hzswb']; $hzswb['enable'] = $hzswb['enable'] ? 1 : 0; $hzswb = hzswb_config($hzswb); if ($hzswb['enable'] != $this->Config['hzswb_enable']) { jconf::update('hzswb_enable', $hzswb['enable']); } if ($hzswb != $hzswb_default) { jconf::set('hzswb', $hzswb); } $this->Messager("配置修改成功"); }
function message($message, $url_forward = '', $options = array()) { if (!function_exists('jmessage')) { jfunc('message'); } return jmessage($message, $url_forward, $options); }
function view() { $lid = jget('id', 'int', 'G'); if (!$this->LiveLogic->is_exists($lid)) { return false; } $list = $this->LiveLogic->Getguest($lid); $this->item = 'live'; $this->item_id = $item_id = $lid; $ltype = $this->Get['list'] ? $this->Get['list'] : $this->Get['type']; $live = $this->LiveLogic->id2liveinfo($lid, $list); if (!in_array($ltype, array('g', 'h'))) { if ($live['status_css'] == 'ico_notyet') { $ltype = 'g'; } else { $ltype = 'h'; } } $params = array('item' => 'live', 'item_id' => $lid); $uids = array(); $gets = array('mod' => 'live', 'code' => 'view', 'type' => $ltype, 'id' => $lid); $page_url = 'index.php?' . url_implode($gets); $options = array('page' => true, 'perpage' => 20, 'page_url' => $page_url); if (empty($live)) { $this->Messager('当前直播不存在!'); } elseif ($live['all']) { $defaust_value = ' 一起来说说#' . $live['livename'] . '#吧'; foreach ($live['all'] as $key => $val) { $uids[$key] = $key; } if ($ltype == 'h') { $options['where'] = " uid IN(" . jimplode($uids) . ") "; } else { $options['where'] = " uid NOT IN(" . jimplode($uids) . ") "; } $content = '#' . $live['livename'] . '#'; } $is_live_hosts = in_array(MEMBER_ID, $uids) ? true : false; $live_config = jconf::get('live'); if (MEMBER_STYLE_THREE_TOL) { $member = $this->TopicLogic->GetMember(MEMBER_ID); } $param = array('limit' => '5'); $live_info = $this->LiveLogic->get_list($param); if (!empty($live_info)) { $live_count = $live_info['count']; $live_list = $live_info['list']; } jfunc('app'); $topic_info = app_get_topic_list('live', $lid, $options); $topic_list = array(); if (!empty($topic_info)) { $topic_list = $topic_info['list']; $page_arr['html'] = $topic_info['page']['html']; $no_from = false; if ($ltype == 'h' && !empty($topic_list)) { foreach ($topic_list as $key => $val) { $topic_list[$key]['user_css'] = 'live' . $this->LiveLogic->id2usertype($lid, $val['uid'], $list); $topic_list[$key]['user_str'] = ' '; } } $topic_count = $topic_info['count']; } $topic_count = $topic_count ? $topic_count : 0; $this->Title = '直播 - ' . $live['livename']; $albums = jlogic('image')->getalbum(); include template("live/live"); }
function editProfile() { Mobile::is_login(); $member_info = DB::fetch_first("SELECT * FROM " . DB::table('members') . " where `uid`='" . MEMBER_ID . "'"); if (!$member_info) { Mobile::error('No User', 300); } $gender = in_array($gender = (int) $this->Post['gender'], array(1, 2)) ? $gender : 0; $signature = $signature = trim(strip_tags($this->Post['signature'])); if ($filter_msg = filter($signature)) { Mobile::error('Illegal Strings', 334); } $nickname = trim($this->Post['nickname']); if (!empty($nickname)) { if ($nickname != $member_info['nickname']) { jfunc('member'); $ret = jsg_member_checkname($nickname, 1); if ($ret < 1) { $rets = array('0' => 335, '-1' => 336, '-2' => 337, '-3' => 338); Mobile::error('Nick Error', $rets[$ret]); } } } $arr = array('gender' => $gender, 'signature' => addslashes($signature)); if (!empty($nickname)) { $arr['nickname'] = $nickname; } $this->_update($arr); $field = "author"; if (!empty($_FILES) && $_FILES[$field]['name']) { $this->_uploadImage(); } Mobile::success("Success"); }
function _make_topic_from($topic) { $topic['from_html'] = $topic['from_string'] = ''; if ($topic['relateid'] > 0) { $topic['channel_type'] = 'default'; } if ($topic['featureid'] > 0) { $features = jlogic('feature')->get_feature(); $topic['topic_feature_status'] = $features[$topic['featureid']] ? $features[$topic['featureid']] : ''; } if ($topic['item'] && $topic['item_id'] > 0) { if (!function_exists('item_topic_from')) { jfunc('item'); } $topic = item_topic_from($topic); } elseif ($topic['from']) { static $topic_from_config = null; if (null === $topic_from_config) { $topic_from_config = jconf::get('topic_from'); } $topic_from = $topic_from_config[$topic['from']]; if ($topic_from) { $topic['from_html'] = $topic['from_string'] = '来自 ' . $topic_from['name']; if ($topic_from['link']) { $topic['from_html'] = '来自 <a href="' . $topic_from['link'] . '">' . $topic_from['name'] . '</a>'; } } } if (!$topic['from']) { $topic['from'] = 'web'; } if (!$topic['from_string']) { $topic['from_string'] = '来自 ' . $GLOBALS['_J']['config']['site_name']; } if (!$topic['from_html']) { $topic['from_html'] = '来自 <a href="' . $GLOBALS['_J']['config']['site_url'] . '">' . $GLOBALS['_J']['config']['site_name'] . '</a>'; } return $topic; }
function iframe_recommend() { $ids = (int) (jget('ids') ? jget('ids') : jget('id')); if ($ids < 1) { exit('ids is empty'); } $sql = " select * from `" . TABLE_PREFIX . "share` where `id` = '{$ids}' "; $query = $this->DatabaseHandler->Query($sql); $sharelist = $query->GetRow(); if (!$sharelist) { exit('ids is invalid'); } $share = @unserialize($sharelist['show_style']); $topic_charset = $share['topic_charset']; $share['limit'] = max(0, (int) $share['limit']); if ($share['limit'] < 1 || $share['limit'] > 200) { $share['limit'] = 20; } $share['string'] = max(0, (int) $share['string']); $order = ' `dateline` DESC '; $condition = ''; $rets = $topic_list = array(); if ('live' == $sharelist['type']) { $rr = jlogic('live')->get_script_out_list(1, $share['limit'], $share['string']); $rets = $live_list = $rr; } else { $user_topic_list = ''; if ('topic' == $sharelist['type']) { $nickname = ''; if ($sharelist['nickname']) { $nickname = $sharelist['nickname']; } else { $nickname = get_safe_code(jget('nickname')); } if ($nickname) { $ns = explode('|', $nickname); $uids = jtable('members')->get_ids(array('nickname' => $ns, 'result_count' => count($ns)), 'uid'); if (!$uids) { exit('nickname is invalid'); } $user_topic_list = " `uid` IN (" . jimplode($uids) . ") "; } } $tag_condition = ''; if ('tag' == $sharelist['type']) { $tag = ''; if ($sharelist['tag']) { $tag = $sharelist['tag']; } else { $tag = get_safe_code(jget('tag')); } if ($tag) { $ts = explode('|', $tag); $tagids = jtable('tag')->get_ids(array('name' => $ts, 'result_count' => count($ts)), 'id'); if (!$tagids) { exit('tag is invalid'); } $tids = jtable('topic_tag')->get_ids(array('tag_id' => $tagids, 'result_count' => $share['limit'], 'sql_order' => ' `dateline` DESC '), 'item_id'); if ($tids) { $tag_condition = " `tid` IN (" . jimplode($tids) . ") "; $topic_list = jlogic('topic')->Get($tids); } } } $channel_condition = ''; if ('channel' == $sharelist['type']) { $cids = array(); if ($share['channel']['name']) { $cname = $share['channel']['name']; } else { $channel_id = jget('channel_id', 'int'); if ($channel_id > 0) { $cids[$channel_id] = $channel_id; } else { $cname = jget('channel') ? jget('channel') : (jget('channel_name') ? jget('channel_name') : jget('ch_name')); } } if ($cname) { $ns = explode('|', $cname); $cids = jtable('channel')->get_ids(array('ch_name' => $ns, 'result_count' => count($ns)), 'ch_id'); if (!$cids) { exit('channel is invalid'); } } if ($cids) { $condition = " `item`='channel' AND `item_id` IN(" . jimplode($cids) . ") "; } } if ('recommend' == $sharelist['type']) { $p = array('sql_order' => ' `dateline` DESC ', 'result_count' => $share['limit']); $its = array(); $item = $share['recommend']['item']; if ($item) { $its = $share['recommend']['item_id']; } else { $item = jget('item', 'txt'); $its = jget('item_id', 'txt'); } if (in_array($item, array('qun', 'channel')) && $its) { ${$item_id . '_id'} = $its; $p['item_id'] = explode('|', $its); $p['item'] = $item; } $tids = jtable('topic_recommend')->get_ids($p, 'tid'); if ($tids) { $topic_list = jlogic('topic')->Get($tids); } foreach ($topic_list as $key_one => $topic_one) { $sql = " select r_title from `" . TABLE_PREFIX . "topic_recommend` where tid = " . $topic_one['tid']; $topic_list[$key_one]['recd_title'] = DB::result_first($sql); } } if ('live_weibo' == $sharelist['type']) { $live_id = (int) $share['live_weibo']['item_id']; $live_item = $share['live_weibo']['item']; if ($live_id > 0) { $live_info = jlogic('live')->id2liveinfo($live_id); $live_uids = array(); foreach ($live_info['all'] as $k => $v) { $live_uids[$k] = $k; } $p = array('limit' => $share['limit']); if ('live_all' == $live_item) { } elseif ('live_other' == $live_item) { $p['where'] = ' `uid` NOT IN (' . jimplode($live_uids) . ') '; } else { $p['where'] = " `uid` IN (" . jimplode($live_uids) . ") "; } jfunc('app'); $rets = app_get_topic_list('live', $live_id, $p); $topic_list = $rets['list']; } } if ($tag_condition) { $condition = " {$tag_condition} AND `type` = 'first' "; } elseif ($user_topic_list) { $condition = " {$user_topic_list} AND `type` = 'first' "; } if (!$condition) { $condition = " `type` = 'first' "; } $gorder = jget('order'); $where = " WHERE {$condition} ORDER BY {$order} LIMIT {$share['limit']} "; if (!$topic_list) { $topic_list = $this->TopicLogic->Get($where); } if ($topic_list) { if (!$share['hold_tags']) { foreach ($topic_list as $k => $v) { $topic_list[$k]['content'] = stripslashes($topic_list[$k]['content']); $topic_list[$k]['content'] = strip_tags($topic_list[$k]['content']); if ($share['string'] > 0) { $topic_list[$k]['content'] = cut_str($topic_list[$k]['content'], $share['string']); $topic_list[$k]['recd_title'] = cut_str($topic_list[$k]['recd_title'], $share['string']); } } } } $rets = $topic_list; } $output = jget('output'); if ('json' == $output) { $rets = array_values($rets); $rets = array_iconv($this->Config['charset'], 'utf-8', $rets); echo json_encode($rets); } else { ob_start(); include template('share/sharetemp_' . $ids); $content = ob_get_contents(); ob_clean(); $content = str_replace(array("\r\n", "\n", "\r"), "", $content); $content = str_replace("'", "\\'", $content); $content = str_replace("/http", "http", $content); $content = str_replace("index.php?", $this->Config['site_url'] . '/index.php?', $content); $content = str_replace($this->Config['site_url'] . "/" . $this->Config['site_url'], $this->Config['site_url'], $content); #开启伪静态以后加网址 $content = str_replace('href="/', 'href="' . $this->Config['site_url'] . '/', $content); $content = str_replace('target="_blank"', "", $content); $content = str_replace('<a ', '<a target="_blank" ', $content); $content = preg_replace(array("/[\r\n]+/s", "/\\>\\s+\\</", "/\\>\\s+/", "/\\s+\\</"), array("", "><", ">", "<"), $content); if (strtoupper($this->Config['charset']) != strtoupper($share['topic_charset'])) { @header('Content-Type: text/html; charset=' . $share['topic_charset']); $content = array_iconv($this->Config['charset'], $share['topic_charset'], $content); } if ('iframe' == $output) { echo $content; } else { echo "document.write('{$content}');"; } } exit; }
function DoModifyEmail() { $password_old = $this->Post['password_old']; $email_new = $this->Post['email_new']; $nickname_new = $this->Post['nickname_new']; $username_new = ''; if (!$this->Member['username'] || is_numeric($this->Member['username'])) { $username_new = $this->Post['username_new']; } $ret = jsg_member_edit($this->Member['nickname'], $password_old, $nickname_new, '', $email_new, $username_new); if ($ret < 1) { $rets = array('0' => '没有做任何修改', '-1' => '帐户/昵称 不合法,含有不允许注册的字符,请尝试更换一个。', '-2' => '帐户/昵称 不允许注册,含有被保留的字符,请尝试更换一个。', '-3' => '帐户/昵称 已经存在了,请尝试更换一个。', '-4' => 'Email 不合法,请输入正确的Email地址。', '-5' => 'Email 不允许注册,请尝试更换一个。', '-6' => 'Email 已经存在了,请尝试更换一个。', '-7' => '没有做任何修改。', '-8' => '网站后台已设置了帐户昵称不允许修改,请联系网站管理员。'); $message = $rets[$ret] ? $rets[$ret] : "密码输入错误,请重试"; $this->Messager($message); } jfunc('my'); my_member_validate(MEMBER_ID, $email_new, $this->Member['role_id'], 1); if ($this->Config['reg_email_verify'] and $email_new != $this->Member['email']) { $message = array(); $message[] = "Email 重新激活验证的方法已经发送到注册邮箱 <b>" . $email_new . "</b>,请用邮件中提供的方法进行激活。"; $message[] = "如果24小时内仍没有收到系统发送的系统邮件,请在个人设置/修改密码页面中重新提交或尝试更换成其他的email地址"; $this->Messager($message, null); } else { $this->Messager('确认 Email 已发送,请用邮件中提供的方法激活您的帐号。<br>如果您尚未收到我们发送的系统邮件,请点击个人资料中的“重新接收验证邮件”,或尝试更换另外一个地址', 'index.php?mod=settings&code=base'); } }
function view() { $uid = MEMBER_ID; $vid = empty($this->Get['vid']) ? 0 : intval($this->Get['vid']); $newpoll = $hotpoll = $poll = $option = array(); $vote = $this->VoteLogic->id2voteinfo($vid); if (empty($vote) || $vote['verify'] == 0 && MEMBER_ROLE_TYPE != 'admin') { $this->Messager('当前投票不存在或正在审核中!'); } $this->item_id = $vid; $ret = $this->VoteLogic->process_detail($vote, MEMBER_ID); extract($ret); $member = jsg_member_info($vote['uid']); if ($member['uid'] != MEMBER_ID) { $fllow = chk_follow(MEMBER_ID, $member['uid']); $follow_html = follow_html($member['uid'], $fllow); $all_vote_btn = "他的全部投票"; } else { $follow_html = ''; $all_vote_btn = "我的全部投票"; } if ($member['uid'] == MEMBER_ID || MEMBER_ROLE_TYPE == 'admin') { $exp_info = $this->VoteLogic->get_publish_form_param(); extract($exp_info); } $recd_list = $this->VoteLogic->get_recd_list(); jfunc('app'); $gets = array('mod' => 'vote', 'code' => 'view', 'vid' => $vid); $page_url = 'index.php?' . url_implode($gets); $options = array('page' => true, 'perpage' => 5, 'page_url' => $page_url); $topic_info = app_get_topic_list($this->item, $vid, $options); $topic_list = array(); if (!empty($topic_info)) { $topic_list = $topic_info['list']; $page_arr['html'] = $topic_info['page']['html']; } $params = array('item' => $this->item, 'item_id' => $vid, 'oc' => 'view'); $no_from = true; $this->item = 'vote'; $this->item_id = $vid; $set_qun_closed = 1; $set_vote_closed = 1; $expiration = FALSE; if ($vote['expiration'] < TIMESTAMP) { $expiration = true; } $this->Title = '投票 - ' . $vote['subject']; include template("vote/vote_view"); }
function _qqwbCheckEnv() { jfunc('qqwb_env'); return qqwb_env(); }
function eventDetail() { $id = intval($this->Get['id']); load::logic('event'); $EventLogic = new EventLogic(); $param = array('where' => " a.id = '{$id}' "); $return = $EventLogic->getEventInfo($param); $rs = $return['event_list'][$id]; if (!$rs) { $this->Messager("活动不存在或已删除", -1); } if (!$rs['verify'] || $rs['verify'] == 0) { if ($rs['postman'] != MEMBER_ID) { $this->Messager("活动还在审核中", -1); } } $from = array(); if ($rs['item'] == 'qun' && $rs['item_id'] > 0) { load::logic('qun'); $qun_logic = new QunLogic(); $qunInfo = $qun_logic->get_qun_info($rs['item_id']); $rs['qunname'] = $qunInfo['name']; $from['name'] = $this->Config[changeword][weiqun] . '--' . $rs['qunname']; $from['url'] = get_full_url('', 'index.php?mod=qun&qid=' . $rs['item_id']); } else { #if NEDU if (defined('NEDU_MOYO')) { if ($rs['item'] && $rs['item_id']) { $app = nlogic('com.object')->get_info($rs['item'], $rs['item_id']); if ($app) { $from = array('name' => $app['object_name'], 'url' => $app['object_url']); } } } #endif } $app_member_arr = $EventLogic->getAllUser(array('where' => " a.id = '{$id}' and a.app = 1 and a.play = 0 ", 'order' => " order by a.app_time ", 'limit' => " limit 6 "), 'app'); $app_count = $app_member_arr['count']; $app_member = $app_member_arr['member']; $play_member_arr = $EventLogic->getAllUser(array('where' => " a.id = '{$id}' and a.play = 1 ", 'order' => " order by a.play_time ", 'limit' => " limit 6 "), 'play'); $play_count = $play_member_arr['count']; $play_member = $play_member_arr['member']; $member = $this->Member; if ($member['medal_id']) { $medal_list = $this->TopicLogic->GetMedal($member['medal_id'], $member['uid']); } jfunc('app'); $gets = array('mod' => 'event', 'code' => "detail", 'id' => $id); $page_url = 'index.php?' . url_implode($gets); $options = array('page' => true, 'perpage' => 5, 'page_url' => $page_url); $topic_info = app_get_topic_list('event', $id, $options); $topic_list = array(); if (!empty($topic_info)) { $topic_list = $topic_info['list']; $page_arr['html'] = $topic_info['page']['html']; $no_from = true; } $this->item = 'event'; $this->item_id = $id; $set_qun_closed = 1; $set_event_closed = 1; $set_fenlei_closed = 1; $this->Title = $rs['title']; include template('event/event_dateil'); }
function DoModifyEmail() { $uid = MEMBER_ID; if (jdisallow($uid)) { exit('你无权验证他人的邮箱,点击进入验证自己的邮箱'); } $email = jget('email', 'email'); $checktype = $this->Post['checktype']; $sql = "SELECT `uid`,`ucuid`,`nickname`,`username`,`email`,`role_id`,`email_checked` from `" . TABLE_PREFIX . "members` where `uid` = '{$uid}' LIMIT 0,1"; $query = $this->DatabaseHandler->Query($sql); $members = $query->GetRow(); if ($email) { if ($checktype == 'modify') { $jsg_result = jsg_member_checkemail($email, $members['ucuid']); if ($jsg_result < 1) { $rets = array('0' => '【注册失败】有可能是站点关闭了注册功能', '-4' => 'Email 不合法,请输入正确的Email地址。', '-5' => 'Email 不允许注册,请尝试更换一个。', '-6' => 'Email 已经存在了,请尝试更换一个。'); echo $rets[$jsg_result]; die; } if ($members['email_checked'] == 0) { $sql = "update `" . TABLE_PREFIX . "members` set `email`='{$email}' where `uid`='{$uid}'"; } else { $sql = "update `" . TABLE_PREFIX . "members` set `email2`='{$email}' where `uid`='{$uid}'"; } DB::query($sql); } jfunc('my'); $ret = my_member_validate(MEMBER_ID, $email, $members['role_id'] != $this->Config['normal_default_role_id'] ? $members['role_id'] : (int) $this->Config['normal_default_role_id'], 1); if ($ret) { echo "邮件已重新发送成功"; } else { echo "邮件发送失败,请填写有效的邮箱地址或联系管理员。"; } echo "<script language='Javascript'>"; echo "parent.document.getElementById('user_email').innerHTML='{$email}';"; echo "</script>"; die; } else { echo "请输入正确的邮箱"; die; } }