本文整理汇总了PHP中m_display函数的典型用法代码示例。如果您正苦于以下问题:PHP m_display函数的具体用法?PHP m_display怎么用?PHP m_display使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了m_display函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 0;
FanweService::instance()->cache->loadCache(array('mindex', 'madv'));
$advs = $_FANWE['cache']['madv']['index'];
if ($advs) {
foreach ($advs as $adv) {
$adv['img'] = FS("Image")->getImageUrl($adv['img'], 2);
if ($adv['type'] == 1) {
$tag_count = count($adv['data']['tags']);
unset($adv['data']);
$adv['data']['count'] = $tag_count;
} elseif ($adv['type'] != 2 && $adv['type'] != 8) {
unset($adv['data']);
}
unset($adv['sort'], $adv['status'], $adv['page']);
$root['advs'][] = $adv;
}
}
foreach ($_FANWE['cache']['mindex'] as $index) {
$index['img'] = FS("Image")->getImageUrl($index['img'], 2);
if ($index['type'] == 1) {
$tag_count = count($index['data']['tags']);
unset($index['data']);
$index['data']['count'] = $tag_count;
} elseif ($index['type'] != 2 && $index['type'] != 8) {
unset($index['data']);
}
unset($index['sort'], $index['status']);
$root['indexs'][] = $index;
}
m_display($root);
}
示例2: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
//未登陆直接退出
if ($_FANWE['uid'] == 0) {
$root['status'] = -1;
m_display($root);
}
$uid = (int) $_FANWE['requestData']['uid'];
//没有关注的会员编号直接退出
if ($uid == 0) {
$root['status'] = -2;
m_display($root);
}
//没有会员直接退出
if (!FS('User')->getUserExists($uid)) {
$root['status'] = -3;
m_display($root);
}
if (FS('User')->followUser($uid)) {
$root['is_follow'] = 1;
} else {
$root['is_follow'] = 0;
}
$root['status'] = 1;
m_display($root);
}
示例3: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
$share_id = (int) $_FANWE['requestData']['share_id'];
$page = (int) $_FANWE['requestData']['page'];
$page = max(1, $page);
$sql_count = "SELECT COUNT(DISTINCT comment_id) FROM " . FDB::table("share_comment") . " WHERE share_id = " . $share_id;
$total = FDB::resultFirst($sql_count);
$page_size = PAGE_SIZE;
$page_total = ceil($total / $page_size);
if ($page > $page_total) {
$page = $page_total;
}
$limit = ($page - 1) * $page_size . "," . $page_size;
$sql = 'SELECT c.*,u.user_name,u.server_code FROM ' . FDB::table('share_comment') . ' AS c
INNER JOIN ' . FDB::table('user') . ' AS u ON u.uid = c.uid
WHERE c.share_id = ' . $share_id . ' ORDER BY c.comment_id DESC LIMIT ' . $limit;
$res = FDB::query($sql);
$list = array();
while ($item = FDB::fetch($res)) {
$item['user_avatar'] = avatar($item['uid'], 'm', $item['server_code'], 1, true);
$item['time'] = getBeforeTimelag($item['create_time']);
m_express(&$item, $item['content']);
$list[] = $item;
}
$root['item'] = $list;
$root['page'] = array("page" => $page, "page_total" => $page_total);
m_display($root);
}
示例4: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
$root['act'] = 'delcomment';
if ($_FANWE['uid'] == 0) {
exit;
}
$comment_id = intval($_FANWE['requestData']['id']);
if ($comment_id == 0) {
exit;
}
$share = FDB::fetchFirst('SELECT s.uid,s.share_id
FROM ' . FDB::table('share_comment') . ' AS sc
INNER JOIN ' . FDB::table('share') . ' AS s ON s.share_id = sc.share_id
WHERE sc.comment_id = ' . $comment_id);
if (empty($share)) {
exit;
}
$uid = intval($share['uid']);
if ($uid != $_FANWE['uid']) {
exit;
}
FS('Share')->deleteShareComment($comment_id);
$root['return'] = 1;
m_display($root);
}
示例5: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 0;
if ($_FANWE['uid'] == 0) {
$root['info'] = "请先登陆";
m_display($root);
}
$user = FS("User")->getUserById($_FANWE['uid']);
$data = array('oldpassword' => $_FANWE['requestData']['oldpassword'], 'newpassword' => $_FANWE['requestData']['newpassword']);
$vservice = FS('Validate');
$validate = array(array('oldpassword', 'required', '请输入现在的密码'), array('newpassword', 'range_length', '请输入正确的新密码', 6, 32));
if (!$vservice->validation($validate, $data)) {
$root['info'] = $vservice->getError();
m_display($root);
} else {
if (md5($data['oldpassword']) != $user['password']) {
$root['info'] = '原密码不正确';
m_display($root);
} else {
FDB::update('user', array('password' => md5($data['newpassword'])), 'uid = ' . $_FANWE['uid']);
$root['info'] = '修改成功';
$user_field = $_FANWE['setting']['integrate_field_id'];
$sql = "SELECT {$user_field} FROM " . FDB::table('user') . " WHERE uid = '{$_FANWE['uid']}'";
$integrate_id = intval(FDB::resultFirst($sql));
if ($integrate_id > 0) {
FS("Integrate")->editUser($integrate_id, $data['newpassword'], '', '');
}
}
}
$root['return'] = 1;
m_display($root);
}
示例6: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 0;
$data = array('email' => $_FANWE['requestData']['email'], 'user_name' => $_FANWE['requestData']['user_name'], 'password' => $_FANWE['requestData']['password'], 'gender' => intval($_FANWE['requestData']['gender']));
$vservice = FS('Validate');
$validate = array(array('email', 'required', lang('user', 'register_email_require')), array('email', 'email', lang('user', 'register_email_error')), array('user_name', 'required', lang('user', 'register_user_name_require')), array('user_name', 'range_length', lang('user', 'register_user_name_len'), 2, 20), array('user_name', '/^[\\x{4e00}-\\x{9fa5}a-zA-Z][\\x{4e00}-\\x{9fa5}a-zA-Z0-9]+$/u', lang('user', 'register_user_name_error')), array('password', 'range_length', lang('user', 'register_password_range'), 6, 20));
if (!$vservice->validation($validate, $data)) {
$root['info'] = "注册失败:" . $vservice->getError();
m_display($root);
}
$uservice = FS('User');
if ($uservice->getEmailExists($data['email'])) {
$root['info'] = "注册失败:" . lang('user', 'register_email_exist');
m_display($root);
}
if ($uservice->getUserNameExists($data['user_name'])) {
$root['info'] = "注册失败:" . lang('user', 'register_user_name_exist');
m_display($root);
}
//================add by chenfq 2011-10-14 =======================
$user_field = $_FANWE['setting']['integrate_field_id'];
$integrate_id = FS("Integrate")->addUser($data['user_name'], $data['password'], $data['email']);
if ($integrate_id < 0) {
$info = FS("Integrate")->getInfo();
$root['info'] = "注册失败:" . $info;
m_display($root);
}
//================add by chenfq 2011-10-14=======================
$user = array('email' => $data['email'], 'user_name' => $data['user_name'], 'user_name_match' => segmentToUnicode($data['user_name']), 'password' => md5($data['password']), 'status' => 1, 'email_status' => 0, 'avatar_status' => 0, 'gid' => 7, 'invite_id' => FS('User')->getReferrals(), 'reg_time' => TIME_UTC, $user_field => $integrate_id);
$uid = FDB::insert('user', $user, true);
if ($uid > 0) {
$_FANWE['uid'] = $uid;
FDB::insert('user_count', array('uid' => $uid));
if ($user['invite_id'] > 0) {
FS('User')->insertReferral($uid, $user['invite_id'], $user['user_name']);
}
FS("User")->updateUserScore($uid, 'user', 'register');
unset($user);
$user_profile = array('uid' => $uid, 'gender' => $data['gender']);
FDB::insert('user_profile', $user_profile);
unset($user_profile);
$user_status = array('uid' => $uid, 'reg_ip' => $_FANWE['client_ip'], 'last_ip' => $_FANWE['client_ip'], 'last_time' => TIME_UTC, 'last_activity' => TIME_UTC);
FDB::insert('user_status', $user_status);
$root['return'] = 1;
$root['info'] = "用户注册成功";
$root['uid'] = $uid;
$root['user_name'] = $data['user_name'];
$root['user_avatar'] = avatar($uid, 'm', '', 1, true);
$root['user_email'] = $data['email'];
$deviceuid = addslashes(trim($_FANWE['requestData']['deviceuid']));
$sql = "update " . FDB::table('apns_devices') . " set clientid = " . $uid . " where clientid = 0 and deviceuid = '" . $deviceuid . "'";
FDB::query($sql);
} else {
$root['info'] = lang('user', 'register_error');
}
m_display($root);
}
示例7: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
$root['newslist'] = $_FANWE['MConfig']['newslist'];
m_display($root);
}
示例8: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
$is_hot = (int) $_FANWE['requestData']['is_hot'];
$is_new = (int) $_FANWE['requestData']['is_new'];
$page = (int) $_FANWE['requestData']['page'];
$page = max(1, $page);
$today_time = getTodayTime();
$field = '';
$whrer = '';
$book_photo_goods = (int) $_FANWE['setting']['book_photo_goods'];
if ($book_photo_goods == 0) {
$whrer = " WHERE share_data IN ('goods','photo','goods_photo')";
} elseif ($book_photo_goods == 1) {
$whrer = " WHERE share_data IN ('photo','goods_photo')";
} elseif ($book_photo_goods == 2) {
$whrer = " WHERE share_data IN ('goods','goods_photo')";
}
if ($is_hot == 1) {
$day7_time = $today_time - 604800;
$field = ",(create_time > {$day7_time}) AS time_sort ";
$sort = " ORDER BY time_sort DESC,collect_count DESC";
}
if ($is_new == 1) {
$sort = " ORDER BY share_id DESC";
}
$sql_count = "SELECT COUNT(DISTINCT share_id) FROM " . FDB::table("share");
$total = FDB::resultFirst($sql_count);
$page_size = PAGE_SIZE;
$max_page = 100;
if ($total > $max_page * $page_size) {
$total = $max_page * $page_size;
}
if ($page > $max_page) {
$page = $max_page;
}
$page_total = ceil($total / $page_size);
$limit = ($page - 1) * $page_size . "," . $page_size;
$sql = 'SELECT DISTINCT(share_id),cache_data ' . $field . '
FROM ' . FDB::table('share') . $whrer . $sort . ' LIMIT ' . $limit;
$res = FDB::query($sql);
$share_list = array();
while ($item = FDB::fetch($res)) {
$cache_data = fStripslashes(unserialize($item['cache_data']));
$img = current($cache_data['imgs']['all']);
$data = array();
$data['share_id'] = $item['share_id'];
$data['img'] = getImgName($img['img'], 100, 999, 0, true);
$data['height'] = $img['height'] * (100 / $img['width']);
$share_list[] = $data;
}
$root['item'] = $share_list;
$root['page'] = array("page" => $page, "page_total" => $page_total);
m_display($root);
}
示例9: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 0;
$uid = (int) $_FANWE['requestData']['uid'];
$cid = (int) $_FANWE['requestData']['cid'];
$album_title = trim($_FANWE['requestData']['title']);
$data = array('title' => $album_title, 'cid' => $cid);
$vservice = FS('Validate');
$validate = array(array('title', 'required', lang('album', 'name_require')), array('title', 'max_length', lang('album', 'name_max'), 60), array('cid', 'min', lang('album', 'cid_min'), 1));
if (!$vservice->validation($validate, $data)) {
$root['info'] = $vservice->getError();
m_display($root);
}
$check_result = FS('Share')->checkWord($album_title, 'title');
if ($check_result['error_code'] == 1) {
$root['info'] = $check_result['error_msg'];
m_display($root);
}
if ($uid > 0) {
if (!FS('User')->getUserExists($uid)) {
$uid = 0;
}
}
if ($cid == 0) {
$uid == 0;
}
if ($uid == 0) {
$root['info'] = "请先登录";
m_display($root);
}
$share_data = array();
$share_data['uid'] = $uid;
$share_data['type'] = 'album';
$share_data['content'] = $album_title;
$share = FS('Share')->submit($share_data, false, true, true);
if ($share['status']) {
$data = array();
$data['title'] = htmlspecialchars($album_title);
$data['album_title_match'] = segmentToUnicode(clearSymbol($album_title));
$data['uid'] = $uid;
$data['cid'] = $cid;
$data['share_id'] = $share['share_id'];
$data['create_day'] = getTodayTime();
$data['create_time'] = TIME_UTC;
$data['show_type'] = 2;
$aid = FDB::insert('album', $data, true);
FDB::query('UPDATE ' . FDB::table('share') . ' SET rec_id = ' . $aid . '
WHERE share_id = ' . $share['share_id']);
FDB::query("update " . FDB::table("user_count") . " set albums = albums + 1 where uid = " . $uid);
$root['aid'] = $aid;
$root['album_name'] = $album_title;
$root['return'] = 1;
}
m_display($root);
}
示例10: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 0;
$uid = (int) $_FANWE['requestData']['uid'];
if ($uid > 0) {
if (!FS('User')->getUserExists($uid)) {
$uid = 0;
}
}
if ($uid == 0) {
$uid = $_FANWE['uid'];
$root['home_user'] = $_FANWE['user'];
}
if ($uid == 0) {
$root['info'] = "请选择要查看的会员";
m_display($root);
}
if (!isset($root['home_user'])) {
$root['home_user'] = FS("User")->getUserById($uid);
unset($root['home_user']['user_name_match'], $root['home_user']['password'], $root['home_user']['active_hash'], $root['home_user']['reset_hash']);
$root['home_user']['user_avatar'] = avatar($uid, 'm', $root['home_user']['server_code'], 1, true);
}
$page = (int) $_FANWE['requestData']['page'];
$page = max(1, $page);
$is_spare_flow = (int) $_FANWE['requestData']['is_spare_flow'];
$img_size = 200;
$scale = 2;
if ($is_spare_flow == 1) {
$img_size = 100;
$scale = 1;
}
$total = FDB::resultFirst('SELECT COUNT(photo_id) FROM ' . FDB::table('share_photo') . ' WHERE uid = ' . $uid);
$page_size = 20;
//PAGE_SIZE;
$page_total = max(1, ceil($total / $page_size));
if ($page > $page_total) {
$page = $page_total;
}
$limit = ($page - 1) * $page_size . "," . $page_size;
$photo_list = array();
$res = FDB::query('SELECT photo_id,share_id,img
FROM ' . FDB::table('share_photo') . '
WHERE uid = ' . $uid . ' ORDER BY photo_id DESC LIMIT ' . $limit);
while ($photo = FDB::fetch($res)) {
$photo['img'] = getImgName($photo['img'], $img_size, $img_size, 1, true);
$photo['height'] = round($img_size / $scale);
$photo['url'] = FU('note/m', array('sid' => $photo['share_id'], 'id' => $photo['photo_id']), true);
$photo_list[] = $photo;
}
$root['return'] = 1;
$root['item'] = $photo_list;
$root['page'] = array("page" => $page, "page_total" => $page_total);
m_display($root);
}
示例11: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
$key = 'm/sharecate';
$cache_list = getCache($key);
if ($cache_list !== NULL || TIME_UTC - $cache_list['cache_time'] > 600) {
$cate_list = array();
$min_time = $this->getQuarterMinTime();
$max_time = getTodayTime();
FanweService::instance()->cache->loadCache('albums');
$album_cate = $_FANWE['cache']['albums']['category'];
foreach ($album_cate as $k => $v) {
$cate = array();
$cate['cate_id'] = $v['id'];
$cate['cate_name'] = $v['name'];
$cate['short_name'] = $v['name'];
$cate['cate_code'] = $v['cate_code'];
$cate['cate_icon'] = FS("Image")->getImageUrl($v['img'], 2);
$cate['desc'] = $v['desc'];
$cate['create_time'] = $v['create_time'];
//获取本季分享数量
$share_count_sql = 'select count(DISTINCT s.share_id) from ' . FDB::table("share") . ' as s
INNER JOIN ' . FDB::table("album_share") . ' as al on s.share_id = al.share_id where al.cid = ' . $v['id'] . " and s.day_time >= {$min_time} AND s.day_time <= {$max_time} ";
$cate['share_count'] = FDB::resultFirst($share_count_sql);
$cate['img_tags'] = array();
$img_size = 320;
$sql = 'select s.share_id,al.title,sp.img from ' . FDB::table("share") . ' as s
INNER JOIN ' . FDB::table("album_share") . ' as als ON s.share_id = als.share_id
INNER JOIN ' . FDB::table("album") . ' as al ON als.album_id = al.id
INNER JOIN ' . FDB::table("share_photo") . " as sp ON s.share_id = sp.share_id \r\n\t\t\t\t\tWHERE s.day_time >= {$min_time} AND s.day_time <= {$max_time} AND als.cid = " . $v['id'] . " GROUP BY s.share_id ORDER BY s.share_id desc limit 5";
$res = FDB::query($sql);
while ($data = FDB::fetch($res)) {
$img_data = array();
$img_data['share_id'] = $data['share_id'];
$img_data['tag_name'] = $data['title'];
$img_data['is_tag'] = 0;
$img_data['img'] = FS("Image")->getImageUrl(getImgName($data['img'], $img_size, $img_size, 1, true), 2);
$img_data['url_tag'] = urlencode($data['title']);
$cate['img_tags'][] = $img_data;
$img_size = 160;
}
$cate['txt_tags'] = array();
$cate_list[] = $cate;
}
$cache_list = array();
$cache_list['cate_list'] = $cate_list;
$cache_list['cache_time'] = TIME_UTC;
setCache($key, $cache_list);
} else {
$cate_list = $cache_list['cate_list'];
}
$root['item'] = $cate_list;
m_display($root);
}
示例12: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 0;
if ($_FANWE['uid'] == 0) {
$root['info'] = "请先登陆";
m_display($root);
}
if (isset($_FILES['image_1'])) {
if ($img = FS("Image")->save('image_1')) {
if (FS("Image")->getIsServer()) {
$server = FS("Image")->getServer();
$args = array();
$args['pic_url'] = FS("Image")->getImageUrl($img['url'], 2);
$server = FS("Image")->getImageUrlToken($args, $server, 1);
$body = FS("Image")->sendRequest($server, 'uploadtemp', true);
if (!empty($body)) {
$img = unserialize($body);
$server = FS("Image")->getServer($img['server_code']);
if (!empty($server)) {
$args = array();
$args['pic_url'] = $img['path'];
$args['types'] = array('small' => '32', 'middle' => '64', 'big' => '160');
$server = FS("Image")->getImageUrlToken($args, $server, 1);
$body = FS("Image")->sendRequest($server, 'saveavatar', true);
if (!empty($body)) {
$avatar = unserialize($body);
FS("Image")->setServerUploadCount($avatar['server_code']);
FS('User')->updateAvatar($_FANWE['uid'], $avatar['server_code']);
}
}
$root['user_avatar'] = avatar($_FANWE['uid'], 'm', $avatar['server_code'], 1, true);
} else {
$root['info'] = "上传图片失败";
m_display($root);
}
} else {
FS('User')->saveAvatar($_FANWE['uid'], $img['path']);
$root['user_avatar'] = avatar($_FANWE['uid'], 'm', '', 1, true);
}
} else {
$root['info'] = "上传图片失败";
m_display($root);
}
} else {
$root['info'] = "请上传图片";
m_display($root);
}
$root['return'] = 1;
m_display($root);
}
示例13: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
$list = array();
FanweService::instance()->cache->loadCache('msearchcate');
foreach ($_FANWE['cache']['msearchcate'] as $cate) {
$cate['bg'] = FS("Image")->getImageUrl($cate['bg'], 2);
$list[] = $cate;
}
$root['item'] = $list;
m_display($root);
}
示例14: run
public function run()
{
global $_FANWE;
$root = array();
$root['return'] = 1;
$page = (int) $_FANWE['requestData']['page'];
$page = max(1, $page);
$total = FDB::resultFirst('SELECT COUNT(id) FROM ' . FDB::table('user_daren') . ' WHERE status = 1');
$page_size = PAGE_SIZE;
$page_total = max(1, ceil($total / $page_size));
if ($page > $page_total) {
$page = $page_total;
}
$limit = ($page - 1) * $page_size . "," . $page_size;
$user_follows = array();
$res = FDB::query('SELECT u.uid,u.user_name,u.server_code,uc.fans,ud.reason,up.introduce
FROM ' . FDB::table('user_daren') . ' AS ud
INNER JOIN ' . FDB::table('user') . ' AS u ON u.uid = ud.uid
INNER JOIN ' . FDB::table('user_count') . ' AS uc ON uc.uid = ud.uid
INNER JOIN ' . FDB::table('user_profile') . ' AS up ON up.uid = ud.uid
WHERE ud.status = 1 ORDER BY ud.id DESC LIMIT ' . $limit);
while ($data = FDB::fetch($res)) {
$data['user_avatar'] = avatar($data['uid'], 'm', $data['server_code'], 1, true);
$data['desc'] = $data['introduce'];
if (!empty($data['reason'])) {
$data['desc'] = $data['reason'];
}
unset($data['server_code'], $data['introduce'], $data['reason']);
if ($data['uid'] == $_FANWE['uid']) {
$data['is_follow'] = -1;
} else {
$user_follows[$data['uid']] = 0;
$data['is_follow'] = 0;
}
$user_list[$data['uid']] = $data;
}
$uids = array_keys($user_follows);
$uids = implode(',', $uids);
$uids = str_replace(',,', ',', $uids);
if (!empty($uids)) {
$res = FDB::query("SELECT uid FROM " . FDB::table('user_follow') . '
WHERE f_uid = ' . $_FANWE['uid'] . ' AND uid IN (' . $uids . ')');
while ($item = FDB::fetch($res)) {
$user_list[$item['uid']]['is_follow'] = 1;
}
}
$root['item'] = array_slice($user_list, 0);
$root['page'] = array("page" => $page, "page_total" => $page_total);
m_display($root);
}
示例15: run
public function run()
{
global $_FANWE;
$root = array();
$root['serverVersion'] = $_FANWE['MConfig']['version'];
$root['filename'] = $_FANWE['site_url'] . $_FANWE['MConfig']['filename'];
if (file_exists(APP_ROOT_PATH . $_FANWE['MConfig']['filename'])) {
$root['hasfile'] = 1;
} else {
$root['hasfile'] = 0;
}
$root['filesize'] = filesize(APP_ROOT_PATH . $_FANWE['MConfig']['filename']);
m_display($root);
}