Beispiel #1
0
 function output()
 {
     global $_G;
     $forums = $GLOBALS['forums'] ? $GLOBALS['forums'] : C::t('forum_forum')->fetch_all_by_status(1);
     foreach ($forums as $forum) {
         if ($forum['fup'] && $GLOBALS['forumlist'][$forum['fup']]) {
             $GLOBALS['forumlist'][$forum['fup']]['sublist'][] = mobile_core::getvalues($forum, array('fid', 'name', 'threads', 'posts', 'redirect', 'todayposts', 'description'));
         }
         if ($GLOBALS['forumlist'][$forum['fid']]['icon']) {
             $icon = preg_match('/src="(.+?)"/', $GLOBALS['forumlist'][$forum['fid']]['icon'], $r) ? $r[1] : '';
             if (!preg_match('/^http:\\//', $icon)) {
                 $icon = $_G['siteurl'] . $icon;
             }
             $GLOBALS['forumlist'][$forum['fid']]['icon'] = $icon;
         }
         //TODO:现在是用发帖总量来展示"今日发布量",数据量大了改回来
         if ($GLOBALS['forumlist'][$forum['fid']]['posts']) {
             $GLOBALS['forumlist'][$forum['fid']]['posts'] = "今日 " . $GLOBALS['forumlist'][$forum['fid']]['posts'];
         }
     }
     if ($_GET['checknotice']) {
         $variable = array();
     } else {
         $variable = array('member_email' => $_G['member']['email'], 'member_credits' => $_G['member']['credits'], 'setting_bbclosed' => $_G['setting']['bbclosed'], 'group' => mobile_core::getvalues($_G['group'], array('groupid', 'grouptitle', '/^allow.+?$/')), 'catlist' => array_values(mobile_core::getvalues($GLOBALS['catlist'], array('/^\\d+$/'), array('fid', 'name', 'forums'))), 'forumlist' => array_values(mobile_core::getvalues($GLOBALS['forumlist'], array('/^\\d+$/'), array('fid', 'name', 'threads', 'posts', 'redirect', 'todayposts', 'description', 'sublist', 'icon'))));
     }
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #2
0
 function common()
 {
     global $_G;
     $seccodecheck = $secqaacheck = false;
     if ($_GET['type'] == 'register') {
         $seccodecheck = $_G['setting']['seccodestatus'] & 1;
         $secqaacheck = $_G['setting']['secqaa']['status'] & 1;
     } elseif ($_GET['type'] == 'login') {
         $seccodecheck = $_G['setting']['seccodestatus'] & 2;
     } elseif ($_GET['type'] == 'post') {
         $seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
         $secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
     }
     $sechash = random(8);
     if ($seccodecheck || $secqaacheck) {
         $variable = array('sechash' => $sechash);
         if ($seccodecheck) {
             $variable['seccode'] = $_G['siteurl'] . 'api/mobile/index.php?module=seccode&sechash=' . $sechash . '&version=' . (empty($_GET['secversion']) ? '1' : $_GET['secversion']);
         }
         if ($secqaacheck) {
             require_once libfile('function/seccode');
             $variable['secqaa'] = make_secqaa($sechash);
         }
     }
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #3
0
 function output()
 {
     global $_G;
     include_once 'source/plugin/mobile/api/4/sub_threadlist.php';
     $variable['hash'] = md5(substr(md5($_G['config']['security']['authkey']), 8) . $_G['uid']);
     mobile_core::result(mobile_core::variable($variable));
 }
 function output()
 {
     global $_G;
     foreach ($_G['forum_threadlist'] as $k => $thread) {
         $_G['forum_threadlist'][$k]['tid'] = $thread['icontid'];
         if ($thread['displayorder'] > 0) {
             unset($_G['forum_threadlist'][$k]);
             continue;
         }
         $_G['forum_threadlist'][$k]['cover'] = array();
         if ($thread['cover']) {
             $_img = @getimagesize($thread['coverpath']);
             if ($_img) {
                 $_G['forum_threadlist'][$k]['cover'] = array('w' => $_img[0], 'h' => $_img[1]);
             }
         }
     }
     $variable = array('forum' => mobile_core::getvalues($_G['forum'], array('fid', 'fup', 'name', 'threads', 'posts', 'rules', 'autoclose', 'password')), 'group' => mobile_core::getvalues($_G['group'], array('groupid', 'grouptitle')), 'forum_threadlist' => mobile_core::getvalues(array_values($_G['forum_threadlist']), array('/^\\d+$/'), array('tid', 'author', 'authorid', 'subject', 'subject', 'dbdateline', 'dateline', 'dblastpost', 'lastpost', 'lastposter', 'attachment', 'replies', 'readperm', 'views', 'digest', 'cover')), 'sublist' => mobile_core::getvalues($GLOBALS['sublist'], array('/^\\d+$/'), array('fid', 'name', 'threads', 'todayposts', 'posts')), 'tpp' => $_G['tpp'], 'page' => $GLOBALS['page']);
     if (!empty($_G['forum']['threadtypes']) || !empty($_GET['debug'])) {
         $variable['threadtypes'] = $_G['forum']['threadtypes'];
     }
     if (!empty($_G['forum']['threadsorts']) || !empty($_GET['debug'])) {
         $variable['threadsorts'] = $_G['forum']['threadsorts'];
     }
     $variable['forum']['password'] = $variable['forum']['password'] ? '1' : '0';
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #5
0
 function output()
 {
     global $_G;
     //帖子列表增加图片 -start
     require_once libfile('function/discuzcode');
     foreach ($GLOBALS['data']['my']['threadlist'] as $k => $thread) {
         $post = C::t('forum_post')->fetch_threadpost_by_tid_invisible($GLOBALS['data']['my']['threadlist'][$k]['tid'], 0);
         $attachment[$post['pid']] = array();
         $GLOBALS['data']['my']['threadlist'][$k]['pid'] = $post['pid'];
         //TODO:下面的代码直接调用discuzcode时,会报错
         //./source/plugin/mobile/template/discuzcode.htm 文件不存在
         //cp ./source/plugin/mobile/template/mobile/discuzcode.htm ./source/plugin/mobile/template/
         //拷贝一份就可以了,原因未查明
         $GLOBALS['data']['my']['threadlist'][$k]['message'] = discuzcode($post['message']);
         //附件,0无附件 1普通附件 2有图片附件
         if (!empty($post['attachment']) && intval($post['attachment']) == 2) {
             $GLOBALS['data']['my']['threadlist'][$k]['attachments'] = array();
             $GLOBALS['data']['my']['threadlist'][$k]['imagelist'] = array();
             require_once libfile('function/attachment');
             $_G['tid'] = $post['tid'];
             parseattach(array_keys($attachment), array(), $attachment);
             $GLOBALS['data']['my']['threadlist'][$k]['attachments'] = $attachment[$post['pid']]['attachments'];
             $GLOBALS['data']['my']['threadlist'][$k]['imagelist'] = $attachment[$post['pid']]['imagelist'];
             unset($_G['tid']);
         }
     }
     //帖子列表增加图片 -end
     $data['forumnames'] = $GLOBALS['data']['my']['forumnames'];
     $data['threadcount'] = $GLOBALS['data']['my']['threadcount'];
     $data['threadlist'] = array_values($GLOBALS['data']['my']['threadlist']);
     $variable = array('data' => $data, 'perpage' => $GLOBALS['perpage']);
     mobile_core::result(mobile_core::variable($variable));
 }
 function output()
 {
     global $_G;
     $list = array_values($GLOBALS['list']);
     foreach ($list as $key => $value) {
         $list[$key]['dateline'] = date("Y-m-d H:i", $value['dateline']);
         if (isset($value['url'])) {
             unset($list[$key]['url']);
         }
         if (isset($value['url'])) {
             unset($list[$key]['url']);
         }
         if (isset($value['icon'])) {
             unset($list[$key]['icon']);
         }
     }
     if (!isset($_GET['page']) || !is_numeric($_GET['page']) || $_GET['page'] <= 0) {
         $_GET['page'] = 1;
     }
     $start = $GLOBALS['perpage'] * ($_GET['page'] - 1);
     $end = count($GLOBALS['list']) + $start;
     if ($end >= $GLOBALS['count']) {
         $GLOBALS['need_more'] = 0;
     } else {
         $GLOBALS['need_more'] = 1;
     }
     $variable = array('list' => $list, 'perpage' => $GLOBALS['perpage'], 'need_more' => $GLOBALS['need_more'], 'count' => $GLOBALS['count']);
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #7
0
 function output()
 {
     global $_G;
     $variable = array('sublist' => mobile_core::getvalues($GLOBALS['sublist'], array('/^\\d+$/'), array('fid', 'name', 'threads', 'todayposts', 'posts')));
     $variable['forum']['password'] = $variable['forum']['password'] ? '1' : '0';
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #8
0
 function output()
 {
     $variable = array();
     global $_G;
     if (true === BigAppConf::$debug) {
         $_G['trace'][] = __CLASS__ . '::' . __FUNCTION__;
     }
     $variable = array();
     if (isset($_G['messageparam'])) {
         foreach ($_G['messageparam'] as $value) {
             if (is_array($value) && isset($value['favid'])) {
                 $variable['favid'] = $value['favid'];
                 break;
             }
         }
     }
     if (!isset($variable['favid']) || empty($variable['favid'])) {
         $sql = 'SELECT favid FROM ' . DB::table('home_favorite') . ' WHERE uid = ' . $_G['uid'] . ' AND id = ' . $_GET['id'] . ' AND idtype = \'aid\'';
         $query = DB::query($sql);
         while ($dbRet = DB::fetch($query)) {
             if (isset($dbRet['favid'])) {
                 $variable['favid'] = $dbRet['favid'];
                 break;
             }
         }
     }
     if (!isset($variable['favid'])) {
         $variable['favid'] = 0;
     }
     mobile_core::result(mobile_core::variable($variable));
 }
 function output()
 {
     global $_G, $thread;
     if ($GLOBALS['hiddenreplies']) {
         foreach ($GLOBALS['postlist'] as $k => $post) {
             if (!$post['first'] && $_G['uid'] != $post['authorid'] && $_G['uid'] != $_G['forum_thread']['authorid'] && !$_G['forum']['ismoderator']) {
                 $GLOBALS['postlist'][$k]['message'] = '';
                 $GLOBALS['postlist'][$k]['attachments'] = array();
             }
         }
     }
     $variable = array('thread' => mobile_core::getvalues($_G['thread'], array('tid', 'author', 'authorid', 'subject', 'views', 'replies', 'attachment', 'price', 'freemessage')), 'fid' => $_G['fid'], 'postlist' => array_values(mobile_core::getvalues($GLOBALS['postlist'], array('/^\\d+$/'), array('pid', 'tid', 'author', 'first', 'dbdateline', 'dateline', 'useip', 'username', 'adminid', 'email', 'memberstatus', 'authorid', 'username', 'groupid', 'memberstatus', 'status', 'message', 'number', 'memberstatus', 'groupid', 'attachment', 'attachments', 'attachlist', 'imagelist', 'anonymous'))), 'ppp' => $_G['ppp'], 'setting_rewriterule' => $_G['setting']['rewriterule'], 'setting_rewritestatus' => $_G['setting']['rewritestatus'], 'forum_threadpay' => $_G['forum_threadpay'], 'cache_custominfo_postno' => $_G['cache']['custominfo']['postno']);
     if (!empty($GLOBALS['threadsortshow'])) {
         $optionlist = array();
         foreach ($GLOBALS['threadsortshow']['optionlist'] as $key => $val) {
             $val['optionid'] = $key;
             $optionlist[] = $val;
         }
         if (!empty($optionlist)) {
             $GLOBALS['threadsortshow']['optionlist'] = $optionlist;
             $GLOBALS['threadsortshow']['threadsortname'] = $_G['forum']['threadsorts']['types'][$thread['sortid']];
         }
     }
     $threadsortshow = mobile_core::getvalues($GLOBALS['threadsortshow'], array('/^(?!typetemplate).*$/'));
     if (!empty($threadsortshow)) {
         $variable['threadsortshow'] = $threadsortshow;
     }
     foreach ($variable['$postlist'] as $k => $v) {
         $variable['$postlist'][$k]['attachments'] = array_values(mobile_core::getvalues($v['attachments'], array('/^\\d+$/'), array('aid', 'tid', 'uid', 'dbdateline', 'dateline', 'filename', 'filesize', 'url', 'attachment', 'remote', 'description', 'readperm', 'price', 'width', 'thumb', 'picid', 'ext', 'imgalt', 'attachsize', 'payed', 'downloads')));
     }
     $variable['forum']['password'] = $variable['forum']['password'] ? '1' : '0';
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #10
0
 function output()
 {
     if ($_GET['t'] == 'output') {
         $variable = array();
         mobile_core::result(mobile_core::variable($variable));
     }
 }
Beispiel #11
0
 function output()
 {
     global $_G;
     $noticelang = lang('notification', 'reppost_noticeauthor');
     $noticepreg = '/^' . str_replace(array('\\{actor\\}', '\\{subject\\}', '\\{tid\\}', '\\{pid\\}'), array('(.+?)', '(.+?)', '(\\d+)', '(\\d+)'), preg_quote($noticelang, '/')) . '$/';
     $actorlang = '<a href="home.php?mod=space&uid={actoruid}">{actorusername}</a>';
     $actorpreg = '/^' . str_replace(array('\\{actoruid\\}', '\\{actorusername\\}'), array('(\\d+)', '(.+?)'), preg_quote($actorlang, '/')) . '$/';
     foreach ($GLOBALS['list'] as $_k => $_v) {
         if (preg_match($noticepreg, $_v['note'], $_r)) {
             list(, $actor, $tid, $pid, $subject) = $_r;
             if (preg_match($actorpreg, $actor, $_r)) {
                 list(, $actoruid, $actorusername) = $_r;
             }
             //取出回帖的内容
             include_once libfile('function/forum');
             require_once libfile('function/discuzcode');
             loadforum(null, $tid);
             if ($pid) {
                 $postlist = $this->post = get_post_by_pid($pid, 'message');
                 $GLOBALS['list'][$_k]['message'] = discuzcode($postlist['message']);
             }
             $GLOBALS['list'][$_k]['dateline'] = dgmdate($GLOBALS['list'][$_k]['dateline']);
             $GLOBALS['list'][$_k]['dbdateline'] = $GLOBALS['list'][$_k]['dateline'];
             $GLOBALS['list'][$_k]['notevar'] = array('tid' => $tid, 'pid' => $pid, 'subject' => $subject, 'actoruid' => $actoruid, 'actorusername' => $actorusername);
         }
     }
     $variable = array('hash' => md5(substr(md5($_G['config']['security']['authkey']), 8) . $_G['uid']), 'list' => mobile_core::getvalues(array_values($GLOBALS['list']), array('/^\\d+$/'), array('id', 'uid', 'type', 'new', 'authorid', 'author', 'note', 'dateline', 'from_id', 'from_idtype', 'from_num', 'style', 'rowid', 'notevar', 'message')), 'count' => $GLOBALS['count'], 'perpage' => $GLOBALS['perpage'], 'page' => intval($GLOBALS['page']));
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #12
0
 function output()
 {
     global $_G;
     $data = $GLOBALS['space'];
     unset($data['password'], $data['email'], $data['regip'], $data['lastip'], $data['regip_loc'], $data['lastip_loc']);
     $variable = array('space' => $data, 'extcredits' => $_G['setting']['extcredits']);
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #13
0
 function common()
 {
     $apifile = 'source/plugin/mobile/api/' . $_GET['version'] . '/sub_checkpost.php';
     if (file_exists($apifile)) {
         require_once $apifile;
     }
     mobile_core::result(mobile_core::variable(mobile_api_sub::getvariable()));
 }
Beispiel #14
0
 function output()
 {
     global $_G;
     foreach ($GLOBALS['data']['hot']['threadlist'] as $tid => $thread) {
         $GLOBALS['data']['hot']['threadlist'][$tid]['avatar'] = avatar($thread['authorid'], 'big', true);
     }
     $variable = array('data' => array_values($GLOBALS['data']['hot']['threadlist']), 'perpage' => $GLOBALS['perpage']);
     mobile_core::result(mobile_core::variable($variable));
 }
 function output()
 {
     $comments = array();
     foreach ($GLOBALS['comments'] as $comment) {
         $comments[] = array('author' => $comment['author'], 'authorid' => $comment['authorid'], 'avatar' => avatar($comment['authorid'], 'small', 1), 'message' => $comment['comment'], 'dateline' => strip_tags($comment['dateline']));
     }
     $variable = array('tid' => $_GET['tid'], 'pid' => $_GET['pid'], 'postlist' => $comments);
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #16
0
 function output()
 {
     global $_G;
     $data['forumnames'] = $GLOBALS['data']['my']['forumnames'];
     $data['tids'] = $GLOBALS['data']['my']['tids'];
     $data['posts'] = $GLOBALS['data']['my']['posts'];
     $variable = array('all' => $GLOBALS['data'], 'data' => $data, 'perpage' => $GLOBALS['perpage']);
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #17
0
 function output()
 {
     extract($GLOBALS);
     $_G['forum_thread']['replies'] = $_G['forum_thread']['replies'] >= 0 ? $_G['forum_thread']['replies'] : 0;
     if ($_G['page'] > @ceil(($_G['forum_thread']['replies'] + 1) / $_G['ppp'])) {
         $content = '';
     } elseif ($postlist) {
         if (!function_exists('mobileoem_template')) {
             include_once DISCUZ_ROOT . './source/plugin/mobileoem/discuzcode.func.php';
         }
         $variable = array();
         foreach ($GLOBALS['aimgs'] as $pid => $aids) {
             foreach ($aids as $aid) {
                 $_url = parse_url($postlist[$pid]['attachments'][$aid]['url']);
                 $variable['imagelist'][$aid] = (!$postlist[$pid]['attachments'][$aid]['remote'] && !$_url['scheme'] ? $_G['siteurl'] : '') . $postlist[$pid]['attachments'][$aid]['url'] . $postlist[$pid]['attachments'][$aid]['attachment'];
                 if (strexists($postlist[$pid]['message'], '[attach]' . $aid . '[/attach]')) {
                     $postlist[$pid]['message'] = str_replace('[attach]' . $aid . '[/attach]', mobileoem_parseimg($postlist[$pid]['attachments'][$aid]['width'], 0, $variable['imagelist'][$aid]), $postlist[$pid]['message']);
                 } else {
                     $postlist[$pid]['message'] .= '<br /><br />' . mobileoem_parseimg($postlist[$pid]['attachments'][$aid]['width'], 0, $variable['imagelist'][$aid]);
                 }
             }
         }
         foreach ($postlist as $pid => $post) {
             if ($post['attachlist']) {
                 foreach ($post['attachlist'] as $aid) {
                     $aidencode = packaids($postlist[$pid]['attachments'][$aid]);
                     $_code = parseurl('/forum.php?mod=attachment&aid=' . $aidencode, $postlist[$pid]['attachments'][$aid]['filename'], 0);
                     if (strexists($postlist[$pid]['message'], '[attach]' . $aid . '[/attach]')) {
                         $postlist[$pid]['message'] = str_replace('[attach]' . $aid . '[/attach]', $_code, $postlist[$pid]['message']);
                     } else {
                         $postlist[$pid]['message'] .= '<br /><br />' . $_code;
                     }
                 }
             }
             $postlist[$pid]['message'] = preg_replace("/\\[attach\\]\\d+\\[\\/attach\\]/i", '', $postlist[$pid]['message']);
         }
         $get = $_GET;
         unset($get['page'], $get['debug']);
         $nexturl = http_build_query($get);
         include mobileoem_template('forum/viewthread');
         if (!empty($_GET['debug'])) {
             exit;
         }
         $content = ob_get_contents();
         ob_end_clean();
     }
     $variable['forumname'] = $forum['name'];
     $variable['datatype'] = $_G['page'] == 1 ? 0 : 1;
     $variable['webview_page'] = $content;
     $variable['ppp'] = $_G['ppp'];
     $variable['posts'] = count($postlist);
     $variable['page'] = $_G['page'];
     if ($_G['forum_discuzcode']['passwordauthor']) {
         $variable['passwordpid'] = array_keys($_G['forum_discuzcode']['passwordauthor']);
     }
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #18
0
 function output()
 {
     $comments = mobile_core::getvalues($GLOBALS['comments'], array('/^\\d+$/'), array('id', 'tid', 'pid', 'author', 'authorid', 'dateline', 'comment', 'avatar'));
     foreach ($GLOBALS['comments'] as $k => $c) {
         $comments[$k]['avatar'] = avatar($c['authorid'], 'small', true);
     }
     $variables = array('tid' => $_GET['tid'], 'pid' => $_GET['pid'], 'comments' => array($_GET['pid'] => $comments), 'totalcomment' => $GLOBALS['totalcomment'], 'count' => $GLOBALS['count']);
     mobile_core::result(mobile_core::variable($variables));
 }
Beispiel #19
0
 function common()
 {
     global $_G;
     if (!in_array('wechat', $_G['setting']['plugins']['available'])) {
         mobile_core::result(mobile_core::variable(array()));
     }
     require_once DISCUZ_ROOT . './source/plugin/wechat/wsq.class.php';
     mobile_core::result(mobile_core::variable(wsq::siteinfo()));
 }
Beispiel #20
0
 function output()
 {
     global $_G;
     $variable = array('list' => mobile_core::getvalues($GLOBALS['list'], array('/^\\d+$/'), array('plid', 'isnew', 'pmnum', 'lastupdate', 'lastdateline', 'authorid', 'author', 'pmtype', 'subject', 'members', 'dateline', 'touid', 'pmid', 'lastauthorid', 'lastauthor', 'lastsummary', 'msgfromid', 'msgfrom', 'message', 'msgtoid', 'tousername')), 'count' => $GLOBALS['count'], 'perpage' => $GLOBALS['perpage'], 'page' => intval($GLOBALS['page']));
     if ($_GET['subop']) {
         $variable = array_merge($variable, array('pmid' => $GLOBALS['pmid']));
     }
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #21
0
 function output()
 {
     global $_G;
     $variable = array('tid' => $GLOBALS['tid'], 'pid' => $GLOBALS['pid']);
     if (!empty($_G['forum']['threadtypes'])) {
         $variable['threadtypes'] = $_G['forum']['threadtypes'];
     }
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #22
0
 function common()
 {
     global $_G;
     loadcache(array('smilies', 'smileytypes'));
     $variable = array();
     foreach ($_G['cache']['smilies']['replacearray'] as $id => $img) {
         $variable['smilies'][] = array('code' => $_G['cache']['smilies']['searcharray'][$id], 'image' => $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$id]]['directory'] . '/' . $img);
     }
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #23
0
 function output()
 {
     global $_G;
     if ($_GET['checknotice']) {
         $variable = array();
     } else {
         $variable = array('member_email' => $_G['member']['email'], 'member_credits' => $_G['member']['credits'], 'setting_bbclosed' => $_G['setting']['bbclosed'], 'group' => mobile_core::getvalues($_G['group'], array('groupid', 'grouptitle', '/^allow.+?$/')), 'catlist' => array_values(mobile_core::getvalues($GLOBALS['catlist'], array('/^\\d+$/'), array('fid', 'name', 'forums'))), 'forumlist' => array_values(mobile_core::getvalues($GLOBALS['forumlist'], array('/^\\d+$/'), array('fid', 'name', 'threads', 'posts', 'redirect', 'todayposts', 'description'))));
     }
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #24
0
 function output()
 {
     global $_G;
     $data = $GLOBALS['space'];
     if ($_G['uid'] && $data['uid'] == $_G['uid']) {
         $data['favthreads'] = C::t('home_favorite')->count_by_uid_idtype($_G['uid'], 'tid');
     }
     unset($data['password'], $data['email'], $data['regip'], $data['lastip'], $data['regip_loc'], $data['lastip_loc']);
     $variable = array('space' => $data, 'extcredits' => $_G['setting']['extcredits']);
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #25
0
 function common()
 {
     global $_G;
     $forums = array();
     $sql = !empty($_G['member']['accessmasks']) ? "SELECT f.fid, f.type, f.name, f.fup, f.status, ff.password, ff.redirect, ff.viewperm, ff.postperm, ff.threadtypes, ff.threadsorts\r\n\t\t\t\tFROM " . DB::table('forum_forum') . " f\r\n\t\t\t\tLEFT JOIN " . DB::table('forum_forumfield') . " ff ON ff.fid=f.fid\r\n\t\t\t\tLEFT JOIN " . DB::table('forum_access') . " a ON a.uid='{$_G['uid']}' AND a.allowview>'0' AND a.fid=f.fid\r\n\t\t\t\tWHERE f.status='1' ORDER BY f.type, f.displayorder" : "SELECT f.fid, f.type, f.name, f.fup, f.status, ff.password, ff.redirect, ff.viewperm, ff.postperm, ff.threadtypes, ff.threadsorts\r\n\t\t\t\tFROM " . DB::table('forum_forum') . " f\r\n\t\t\t\tLEFT JOIN " . DB::table('forum_forumfield') . " ff USING(fid)\r\n\t\t\t\tWHERE f.status='1' ORDER BY f.type, f.displayorder";
     $query = DB::query($sql);
     //$query = DB::query("SELECT f.fid, f.type, f.name, f.fup, f.status, ff.password, ff.redirect, ff.viewperm, ff.postperm, ff.threadtypes, ff.threadsorts FROM ".DB::table('forum_forum')." f LEFT JOIN ".DB::table('forum_forumfield')." ff ON ff.fid=f.fid LEFT JOIN ".DB::table('forum_access')." a ON a.fid=f.fid AND a.allowview>'0' WHERE f.status='1' ORDER BY f.type, f.displayorder");
     while ($forum = DB::fetch($query)) {
         if ($forum['redirect'] || $forum['password']) {
             continue;
         }
         if (!$forum['viewperm'] || $forum['viewperm'] && forumperm($forum['viewperm'])) {
             $forum['name'] = strip_tags($forum['name']);
             if ($forum['threadsorts']) {
                 $forum['threadsorts'] = unserialize($forum['threadsorts']);
                 foreach ($forum['threadsorts']['types'] as $k => $v) {
                     $forum['threadsorts']['types'][$k] = strip_tags($v);
                 }
                 $forum['threadsorts'] = mobile_core::getvalues($forum['threadsorts'], array('required', 'types'));
             }
             if ($forum['threadtypes']) {
                 $forum['threadtypes'] = unserialize($forum['threadtypes']);
                 $unsetthreadtype = false;
                 if ($_G['adminid'] == 3 && strpos($forum['moderators'], $_G['username']) === false) {
                     $unsetthreadtype = true;
                 }
                 if ($_G['adminid'] == 0) {
                     $unsetthreadtype = true;
                 }
                 if ($unsetthreadtype) {
                     foreach ($forum['threadtypes']['moderators'] as $k => $v) {
                         if (!empty($v)) {
                             unset($forum['threadtypes']['types'][$k]);
                         }
                     }
                 }
                 $flag = 0;
                 foreach ($forum['threadtypes']['types'] as $k => $v) {
                     $forum['threadtypes']['types'][$k] = strip_tags($v);
                     if ($k == 0) {
                         $flag = 1;
                     }
                 }
                 if ($flag == 1) {
                     krsort($forum['threadtypes']['types']);
                 }
                 $forum['threadtypes'] = mobile_core::getvalues($forum['threadtypes'], array('required', 'types'));
             }
             $forums[] = mobile_core::getvalues($forum, array('fid', 'type', 'name', 'fup', 'viewperm', 'postperm', 'status', 'threadsorts', 'threadtypes'));
         }
     }
     $variable['forums'] = $forums;
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #26
0
 function output()
 {
     if (!empty($_POST)) {
         mobile_core::result(mobile_core::variable());
     } else {
         global $_G;
         $bbrulehash = $_G['setting']['bbrules'] ? substr(md5(FORMHASH), 0, 8) : '';
         $isconnect = $_G['qc']['connect_app_id'] && $_G['qc']['connect_openid'];
         include template('mobile:register');
         exit;
     }
 }
 function output()
 {
     global $_G;
     $variable = array('forum' => mobile_core::getvalues($_G['forum'], array('fid', 'fup', 'name', 'threads', 'posts', 'rules', 'autoclose', 'password')), 'group' => mobile_core::getvalues($_G['group'], array('groupid', 'grouptitle')), 'forum_threadlist' => mobile_core::getvalues($_G['forum_threadlist'], array('/^\\d+$/'), array('tid', 'author', 'authorid', 'subject', 'subject', 'dbdateline', 'dateline', 'dblastpost', 'lastpost', 'lastposter', 'attachment', 'replies', 'readperm', 'views', 'digest')), 'sublist' => mobile_core::getvalues($GLOBALS['sublist'], array('/^\\d+$/'), array('fid', 'name', 'threads', 'todayposts', 'posts')), 'tpp' => $_G['tpp'], 'page' => $GLOBALS['page']);
     if (!empty($_G['forum']['threadtypes']) || !empty($_GET['debug'])) {
         $variable['threadtypes'] = $_G['forum']['threadtypes'];
     }
     if (!empty($_G['forum']['threadsorts']) || !empty($_GET['debug'])) {
         $variable['threadsorts'] = $_G['forum']['threadsorts'];
     }
     $variable['forum']['password'] = $variable['forum']['password'] ? '1' : '0';
     mobile_core::result(mobile_core::variable($variable));
 }
Beispiel #28
0
 function common()
 {
     global $_G;
     $uids = explode(',', $_GET['uids']);
     if (!$uids) {
         mobile_core::result(mobile_core::variable(array()));
     }
     $profiles = C::t('common_member')->fetch_all_username_by_uid($uids);
     $return = array();
     foreach ($uids as $uid) {
         $return[] = array('uid' => $uid, 'username' => $profiles[$uid]);
     }
     mobile_core::result(mobile_core::variable(array('profiles' => $return)));
 }
Beispiel #29
0
 function output()
 {
     global $_G;
     $data = $GLOBALS['space'];
     $data['groupiconid'] = mobile_core::usergroupIconId($data['groupid']);
     if ($data['group']['type'] == 'member' && $data['group']['groupcreditslower'] != 999999999) {
         $data['upgradecredit'] = $data['group']['creditslower'] - $data['credits'];
         $data['upgradeprogress'] = 100 - ceil($data['upgradecredit'] / ($data['group']['creditslower'] - $data['group']['creditshigher']) * 100);
         $data['upgradeprogress'] = max($data['upgradeprogress'], 2);
     }
     unset($data['password'], $data['email'], $data['regip'], $data['lastip'], $data['regip_loc'], $data['lastip_loc']);
     $variable = array('space' => $data, 'extcredits' => $_G['setting']['extcredits'], 'wsq' => array('wsq_apicredit' => getuserprofile('extcredits' . $_G['wechat']['setting']['wsq_apicredit'])));
     mobile_core::result(mobile_core::variable($variable));
 }
 function common()
 {
     global $_G;
     if (submitcheck('hash', true) && $_G['uid']) {
         $r = updatecreditbyaction('mobilesign', $_G['uid']);
         if ($r['updatecredit']) {
             $_G['messageparam'][0] = 'mobilesign_success';
         } else {
             $_G['messageparam'][0] = 'mobilesign_failed';
         }
     } else {
         $_G['messageparam'][0] = 'mobilesign_formhash_failed';
     }
     mobile_core::result(mobile_core::variable(array()));
 }