本文整理汇总了PHP中mobile_core::getvalues方法的典型用法代码示例。如果您正苦于以下问题:PHP mobile_core::getvalues方法的具体用法?PHP mobile_core::getvalues怎么用?PHP mobile_core::getvalues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mobile_core
的用法示例。
在下文中一共展示了mobile_core::getvalues方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output
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));
}
示例2: output
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));
}
示例3: output
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));
}
示例4: output
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));
}
示例5: output
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));
}
示例6: output
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));
}
示例7: output
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));
}
示例8: output
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));
}
示例9: common
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));
}
示例10: output
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));
}
示例11: output
function output()
{
global $_G;
foreach ($GLOBALS['sublist'] as $k => $sublist) {
if ($sublist['icon']) {
$icon = preg_match('/src="(.+?)"/', $sublist['icon'], $r) ? $r[1] : '';
if (!preg_match('/^http:\\//', $icon)) {
$icon = $_G['siteurl'] . $icon;
}
$GLOBALS['sublist'][$k]['icon'] = $icon;
}
}
$variable = array('sublist' => mobile_core::getvalues($GLOBALS['sublist'], array('/^\\d+$/'), array('fid', 'name', 'threads', 'todayposts', 'posts', 'icon')));
$variable['forum']['password'] = $variable['forum']['password'] ? '1' : '0';
mobile_core::result(mobile_core::variable($variable));
}
示例12: common
function common()
{
global $_G;
$start = !empty($_GET['start']) ? $_GET['start'] : 0;
$limit = !empty($_GET['limit']) ? $_GET['limit'] : 20;
$variable['data'] = C::t('forum_newthread')->fetch_all_by_fids(dintval(explode(',', $_GET['fids']), true), $start, $limit);
foreach (C::t('forum_thread')->fetch_all_by_tid(array_keys($variable['data']), 0, $limit) as $thread) {
$thread['dbdateline'] = $thread['dateline'];
$thread['dblastpost'] = $thread['lastpost'];
$thread['dateline'] = dgmdate($thread['dateline'], 'u');
$thread['lastpost'] = dgmdate($thread['lastpost'], 'u');
$variable['data'][$thread['tid']] = mobile_core::getvalues($thread, array('tid', 'author', 'authorid', 'subject', 'subject', 'dbdateline', 'dateline', 'dblastpost', 'lastpost', 'lastposter', 'attachment', 'replies', 'readperm', 'views', 'digest'));
}
$variable['data'] = array_values($variable['data']);
mobile_core::result(mobile_core::variable($variable));
}
示例13: output
function output()
{
global $_G;
foreach ($GLOBALS['list'] as $_k => $_v) {
if ($_v['lastdateline']) {
$GLOBALS['list'][$_k]['vdateline'] = dgmdate($_v['lastdateline'], 'u');
} elseif ($_v['dateline']) {
$GLOBALS['list'][$_k]['vdateline'] = dgmdate($_v['dateline'], 'u');
}
}
$variable = array('list' => mobile_core::getvalues($GLOBALS['list'], array('/^\\d+$/'), array('plid', 'isnew', 'vdateline', 'subject', 'pmid', 'msgfromid', 'msgfrom', 'message', 'touid', '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));
}
示例14: getvalues
function getvalues($variables, $keys, $subkeys = array()) {
$return = array();
foreach($variables as $key => $value) {
foreach($keys as $k) {
if($k{0} == '/' && preg_match($k, $key) || $key == $k) {
if($subkeys) {
$return[$key] = mobile_core::getvalues($value, $subkeys);
} else {
if(!empty($value) || !empty($_GET['debug']) || (is_numeric($value) && intval($value) === 0 )) {
$return[$key] = is_array($value) ? mobile_core::arraystring($value) : (string)$value;
}
}
}
}
}
return $return;
}
示例15: output
public function output()
{
global $_G;
$variable = array("count" => $GLOBALS['count'], "list" => array_values(mobile_core::getvalues($GLOBALS['list'], array('/^.+?$/'), array('uid', 'username', 'gid', 'groupid', 'adminid'))));
foreach ($variable["list"] as &$item) {
$uid = $item["uid"];
$gid = $item["groupid"];
//unset($item["gid"]);
//$item["groupid"] = $gid;
$item["groupname"] = "unknown";
if (isset($_G['cache']['usergroups'][$gid]['grouptitle'])) {
$item['groupname'] = preg_replace('/<.*?\\>/', '', $_G['cache']['usergroups'][$gid]['grouptitle']);
}
$item["avatar"] = avatar($uid, 'big', 'true');
}
bigapp_core::result(bigapp_core::variable($variable));
}