コード例 #1
0
ファイル: misc.mod.php プロジェクト: YouthAndra/huaitaoo2o
 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);
 }
コード例 #2
0
ファイル: pm.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function getHistoryList()
 {
     $uid = intval($this->Get['uid']);
     if (empty($uid)) {
         Mobile::error("No Error Tips", 321);
     }
     $info = $this->MyPmLogic->getHistoryList(MEMBER_ID, $uid, array("per_page_num" => Mobile::config("perpage_pm")));
     if (!empty($info)) {
         $info['current_page'] = empty($info['current_page']) ? 1 : $info['current_page'];
         Mobile::output($info);
     } else {
         Mobile::error("No Error Tips", 400);
     }
 }
コード例 #3
0
ファイル: search.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function searchUser()
 {
     Mobile::logic('member');
     $MemberLogic = new MemberLogic();
     $q = trim($this->Get['q']);
     if (empty($q)) {
         Mobile::error("No Data", 400);
     }
     $param = array('limit' => Mobile::config("perpage_member"), 'nickname' => $q, 'max_id' => $this->Get['max_id']);
     $ret = $MemberLogic->getMemberList($param);
     if (is_array($ret)) {
         Mobile::output($ret);
     } else {
         Mobile::error("No Data", $ret);
     }
 }
コード例 #4
0
ファイル: friend.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function blacklist()
 {
     $param = array('limit' => Mobile::config("perpage_member"), 'uid' => intval($this->Get['uid']), 'max_id' => intval($this->Get['max_id']));
     $ret = $this->FriendLogic->getBlackList($param);
     if (is_array($ret)) {
         Mobile::output($ret);
     } else {
         Mobile::error("No Error Tips", $ret);
     }
 }
コード例 #5
0
ファイル: topic.mod.php プロジェクト: YouthAndra/huaitaoo2o
 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);
     }
 }
コード例 #6
0
 function error($e)
 {
     $text = "ERROR<br><br>";
     if ($e == "fileNotFound") {
         $text .= "テンプレートファイルが見つかりません。<br><br>";
     }
     $this->tempData = array("{%text}" => $text);
     $html_temp = "{%text}";
     $html = Mobile::tempReplace($html_temp, $this->tempData);
     Mobile::output($html);
     //HTMLを出力
     exit;
 }
コード例 #7
0
ファイル: mobile.func.php プロジェクト: YouthAndra/huaitaoo2o
 function success($msg, $code = 200, $halt = true)
 {
     Mobile::output($msg, 'Success', $code, false);
     $halt && exit;
 }
コード例 #8
0
ファイル: member.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function getUserInfo()
 {
     Mobile::is_login();
     $uid = trim($this->Get['uid']);
     $nick = get_safe_code(trim($this->Get['nick']));
     if (!empty($uid) && $uid > 0) {
         $member = DB::fetch_first("SELECT * FROM " . DB::table('members') . " WHERE uid='{$uid}'");
     } else {
         if (!empty($nick)) {
             $member = DB::fetch_first("SELECT * FROM " . DB::table('members') . " WHERE nickname='{$nick}'");
         }
     }
     if (empty($member)) {
         Mobile::error("No User", 300);
     }
     $ret = array('uid' => $member['uid'], 'nick' => $member['nickname'], 'gender' => $member['gender'], 'face' => face_get($member), 'face_original' => face_get($member, 'big'), 'signature' => $member['signature'], 'province' => $member['province'], 'city' => $member['city'], 'fans_num' => $member['fans_count'], 'follower_num' => $member['follow_count'], 'mblog_num' => $member['topic_count'], 'topic_num' => $member['tag_favorite_count']);
     Mobile::output($ret);
 }