当前位置: 首页>>代码示例>>PHP>>正文


PHP pwJsonEncode函数代码示例

本文整理汇总了PHP中pwJsonEncode函数的典型用法代码示例。如果您正苦于以下问题:PHP pwJsonEncode函数的具体用法?PHP pwJsonEncode怎么用?PHP pwJsonEncode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pwJsonEncode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ajaxExport

/**
 * @param unknown_type $output
 */
function ajaxExport($output)
{
    echo is_array($output) ? stripslashes(pwJsonEncode($output)) : $output;
    ajax_footer();
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:8,代码来源:message.php

示例2: empty

}
empty($subtype) && ($subtype = 'groupsms');
$normalUrl = $baseUrl . "?type={$subtype}";
!empty($winduid) && ($userId = $winduid);
S::gp(array('smstype', 'page'), 'GP');
!$page && ($page = 1);
$selected_all = $selected_self = $selected_other = '';
$selected_all = $action == '' || $action == 'all' ? 'selected' : '';
$selected_self = $action == 'self' ? 'selected' : '';
$selected_other = $action == 'other' ? 'selected' : '';
$groupsmsCount = $groupsmsAllCount = (int) $messageServer->countAllGroupMessage($userId);
$notReadCount = (int) $messageServer->countGroupMessagesNotRead($userId);
//editer
$uploadfiletype = $db_uploadfiletype ? unserialize($db_uploadfiletype) : array();
$attachAllow = pwJsonEncode($uploadfiletype);
$imageAllow = pwJsonEncode(getAllowKeysFromArray($uploadfiletype, array('jpg', 'jpeg', 'gif', 'png', 'bmp')));
if (empty($action) || $action == 'all') {
    $pageCount = ceil($groupsmsCount / $perpage);
    $page = validatePage($page, $pageCount);
    $groupsmsList = $messageServer->getAllGroupMessages($userId, $page, $perpage);
    $url = "{$normalUrl}&";
    !$groupsmsCount && ($emptyListTip = "暂无任何群消息");
} elseif ($action == 'unread') {
    $groupsmsCount = $notReadCount;
    $pageCount = ceil($groupsmsCount / $perpage);
    $page = validatePage($page, $pageCount);
    $groupsmsList = $messageServer->getGroupMessagesNotRead($userId, $page, $perpage);
    $url = "{$normalUrl}&action=unread&";
    $pages = numofpage($groupsmsCount, $page, $pageCount, $url);
    !$notReadCount && ($emptyListTip = "暂无任何未读群消息");
} elseif ($action == 'self') {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:ms_groupsms.php

示例3: MIN

        $pid = $db->get_value("SELECT MIN(b.pid) AS pid FROM pw_cnphoto a LEFT JOIN pw_cnphoto b ON a.aid=b.aid AND a.pid<b.pid WHERE a.pid=" . pwEscape($pid));
        echo "ok\t{$pid}";
    }
    ajax_footer();
} elseif ($a == 'pre') {
    define('AJAX', 1);
    InitGP(array('pid', 'aid'), null, 2);
    if ($aid) {
        $next_photo = $db->get_one("SELECT c.pid,c.path,c.ifthumb,m.groupid FROM pw_cnphoto c LEFT JOIN pw_members m ON c.uploader=m.username WHERE c.pid<" . pwEscape($pid) . " AND  c.aid=" . pwEscape($aid) . " ORDER BY c.pid DESC");
        if ($next_photo) {
            $next_photo['path'] = getphotourl($next_photo['path'], $next_photo['ifthumb']);
            if ($next_photo['groupid'] == 6 && $db_shield && $groupid != 3) {
                $next_photo['path'] = $pwModeImg . '/banuser.gif';
            }
            unset($next_photo['ifthumb']);
            $pid = pwJsonEncode($next_photo);
            echo "ok\t{$pid}";
        } else {
            echo "begin";
        }
    } else {
        $pid = $db->get_value("SELECT MAX(b.pid) AS pid FROM pw_cnphoto a LEFT JOIN pw_cnphoto b ON a.aid=b.aid AND a.pid>b.pid WHERE a.pid=" . pwEscape($pid));
        echo "ok\t{$pid}";
    }
    ajax_footer();
} elseif ($a == 'editphoto') {
    banUser();
    InitGP(array('pid'), null, 2);
    $photo = $db->get_one("SELECT p.aid,p.pintro,a.ownerid,p.path,a.lastphoto FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid WHERE pid=" . pwEscape($pid));
    if (empty($photo) || !$isGM && $photo['ownerid'] != $winduid) {
        Showmsg('data_error');
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:index.php

示例4: array

 S::gp(array('ckey', 'advertype', 'adverstatus'));
 /*hold*/
 $cates = $cateDescrip = array();
 $optCates = '';
 $query = $db->query("SELECT id,ckey,uid,ifshow,descrip,config FROM pw_advert WHERE type=0 AND ifshow=1 ORDER BY id");
 while ($rt = $db->fetch_array($query)) {
     list($rt['name'], $rt['descrip']) = explode("~\t~", $rt['descrip']);
     $rt['ifhire'] = $rt['uid'];
     $rt['config'] = unserialize($rt['config']);
     $cates[$rt['ckey']] = $rt;
     $selected = $ckey == $rt['ckey'] ? "selected=selected" : "";
     $optCates .= "<option value=\"{$rt['ckey']}\" {$selected}>{$rt['name']}</option>";
     $cateDescrip[strtolower($rt['ckey'])] = addslashes($rt['descrip']);
     //$cateDescrip .= "'".addslashes(strtolower($rt['ckey']))."' : '".addslashes($rt['descrip'])."',";
 }
 $cateDescrip = pwJsonEncode($cateDescrip);
 $adverClass = L::loadclass('adver', 'advertisement');
 /*search*/
 $adverTypeSelect = $adverClass->buildTypeSelect($advertype);
 $adverStatusSelect = $adverClass->buildStatusSelect($adverstatus);
 $ckeySelect = $adverClass->getAdverBenchSelect($ckey, 'ckey', 'ckey');
 if (empty($job)) {
     S::gp(array('ckey', 'keyword', 'page'));
     $sql = '';
     $ids = array();
     $ckey && ($sql .= " AND ckey=" . S::sqlEscape($ckey));
     $keyword && ($sql .= " AND descrip LIKE " . S::sqlEscape("%{$keyword}%"));
     in_array($advertype, array_keys($adverClass->getType())) && ($sql .= " AND config LIKE " . S::sqlEscape("%\"" . $advertype . "\";%"));
     in_array($adverstatus, array_keys($adverClass->getStatus())) && $adverstatus != '' && ($sql .= " AND ifshow=" . S::sqlEscape($adverstatus));
     $count = $db->get_value("SELECT COUNT(*) FROM pw_advert WHERE type=1 {$sql}");
     $page < 1 && ($page = 1);
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:setadvert.php

示例5: getMedalJson

/**
 * JSON处理
 * 
 * @return Ambigous <multitype:, string>
 */
function getMedalJson($medal)
{
    $openMedalTemp = array();
    foreach ($medal as $v) {
        $openMedalTemp[] = $v;
    }
    return pwJsonEncode($openMedalTemp);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:13,代码来源:manage.php

示例6: Showmsg

                Showmsg('can_not_modify_field_type');
            }
            $sql = getFieldSqlByType($fieldtype);
            $db->query("ALTER TABLE {$tablename} CHANGE {$fieldname} {$fieldname} {$sql}");
        }
        $db->update("UPDATE pw_topicfield SET " . S::sqlSingle(array('name' => $name, 'type' => $fieldtype, 'rules' => $s_rules, 'descrip' => $descrip)) . " WHERE fieldid=" . S::sqlEscape($fieldid));
        Showmsg('field_edit_success');
    }
} elseif ($action == 'showfield') {
    define('AJAX', 1);
    S::gp(array('currentmodelid'));
    $query = $db->query("SELECT fieldid,name FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid));
    while ($rt = $db->fetch_array($query)) {
        $fielddb[$rt['fieldid']] = $rt['name'];
    }
    $fielddb = pwJsonEncode($fielddb);
    echo "success\t{$fielddb}";
    ajax_footer();
} elseif ($action == 'copyfield') {
    define('AJAX', 1);
    S::gp(array('copyfield'));
    if (empty($copyfield) || !is_array($copyfield)) {
        adminmsg('topiccate_copyfield_none');
    }
    $query = $db->query("SELECT name,type,rules,descrip FROM pw_topicfield WHERE fieldid IN (" . S::sqlImplode($copyfield) . ")");
    while ($rt = $db->fetch_array($query)) {
        $name = $db->get_value("SELECT name FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid));
        $db->update("INSERT INTO pw_topicfield SET " . S::sqlSingle(array('name' => $rt['name'], 'fieldname' => $rt['fieldname'], 'modelid' => $modelid, 'type' => $rt['type'], 'rules' => $rt['rules'], 'descrip' => $rt['descrip'])), false);
        $fieldid = $db->insert_id();
        $fieldname = 'field' . $fieldid;
        $tablename = GetTopcitable($modelid);
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:topiccate.php

示例7: exit

!defined('P_W') && exit('Forbidden');
define('AJAX', 1);
$output = array();
S::gp(array('key'), 'GP');
PostCheck();
$key = pwConvert(urldecode($key), $db_charset, 'utf8');
if (!$winduid || !$key || strlen($key) > 15) {
    $output['status'] = 0;
    echo pwJsonEncode($output);
    exit;
}
$attentionService = L::loadClass('Attention', 'friend');
/* @var $attentionService PW_Attention */
$friends = $attentionService->getUidsInFollowList($winduid, 1, 500);
if (S::isArray($friends)) {
    $userService = L::loadClass('userservice', 'user');
    $usernames = $userService->getUserNamesByUserIds($friends);
    foreach ($usernames as $k => $v) {
        if (strpos($v, $key) !== 0) {
            unset($usernames[$k]);
        }
    }
    $output['status'] = 1;
    foreach ((array) $usernames as $k => $v) {
        $output['users'][] = array('uid' => $k, 'uname' => $v);
    }
} else {
    $output['status'] = 0;
}
echo pwJsonEncode($output);
开发者ID:jechiy,项目名称:PHPWind,代码行数:30,代码来源:friends.php

示例8: list

                    break;
                case 'invcode':
                    $return = $registerCheckService->checkInvcode($value[2]);
                    break;
                case 'customerfield':
                    list($fieldname, $v) = explode('|', $value[2]);
                    $v = S::escapeChar(urldecode($v));
                    $return = $registerCheckService->checkCustomerField($fieldname, $v);
                    break;
            }
            $return && ($returnArray[$value[0]] = $return);
        }
        if (!S::isArray($returnArray)) {
            echo 'success';
        } else {
            echo pwJsonEncode($returnArray);
        }
    }
    ajax_footer();
} elseif (S::getGP('action', 'P') == 'pay') {
    //* include_once pwCache::getPath(D_P."data/bbscache/inv_config.php");
    //* include_once pwCache::getPath(D_P.'data/bbscache/ol_config.php');
    pwCache::getData(D_P . "data/bbscache/inv_config.php");
    pwCache::getData(D_P . 'data/bbscache/ol_config.php');
    if ($_POST['step'] == '3') {
        S::gp(array('invnum', 'email'));
        if (!is_numeric($invnum) || $invnum < 1) {
            $invnum = 1;
        }
        $order_no = str_pad('0', 10, "0", STR_PAD_LEFT) . get_date($timestamp, 'YmdHis') . num_rand(5);
        $rt = array();
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:register.php

示例9: define

    define('AJAX', 1);
    $pushdataService->deletePushdata($id);
    echo getLangInfo('msg', 'operate_success') . "\treload";
    ajax_footer();
} elseif ($action == 'verify') {
    S::gp(array('id'), '', 2);
    define('AJAX', 1);
    $pushdataService->verifyPushdata($id);
    echo getLangInfo('msg', 'operate_success') . "\treload";
    ajax_footer();
} elseif ($action == 'channelchange') {
    S::gp(array('alias', 'ifverify'));
    define('AJAX', 1);
    $portalPageService = L::loadClass('portalpageservice', 'area');
    $invokes = $portalPageService->getPageInvokesForSelect($alias, $ifverify);
    echo pwJsonEncode($invokes);
    ajax_footer();
} elseif ($action == 'verifys') {
    S::gp(array('selid'), '', 2);
    if (!S::isArray($selid)) {
        Showmsg('ÇëÑ¡ÔñÒªÉóºËµÄÍÆËÍÄÚÈÝ');
    }
    foreach ($selid as $value) {
        $value = (int) $value;
        if (!$value) {
            continue;
        }
        $pushdataService->verifyPushdata($value);
    }
    adminmsg('operate_success');
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:pushdata.php

示例10: stopicUploadImg

        if ($image_type == 1) {
            L::loadClass('stopicupload', 'upload', false);
            $imgUrl = stopicUploadImg(0);
            if ($imgUrl !== false) {
                $banner_image = $imgUrl;
            }
        }
        $block_data = array('image' => $banner_image, 'title' => $banner_title, 'title_left' => $postion_left, 'title_top' => $postion_top, 'title_style' => $font_style, 'title_size' => $font_size, 'title_color' => $font_color);
    } elseif ('spclTpc' == $block_type) {
        S::gp(array('tid', 'height'), null, 2);
        $block_data = array('tid' => $tid, 'height' => $height);
    }
    stopic_stripslashes($block_data);
    $stopic_service->updateUnitByFild($stopic_id, $block_id, array('title' => $block_title, 'data' => $block_data));
    $result = array('title' => stripslashes($block_title), 'content' => $block_type == 'comment' ? '' : $stopic_service->getHtmlData($block_data, $block_type, $block_id));
    $result = pwJsonEncode($result);
    $result = stripslashes($result);
    echo "success\t" . $result;
    ajax_footer();
}
function stopic_stripslashes(&$array)
{
    if (is_array($array)) {
        foreach ($array as $key => $value) {
            if (is_array($value)) {
                stopic_stripslashes($array[$key]);
            } else {
                $array[$key] = stripslashes($value);
            }
        }
    }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:editblock.php

示例11: elseif

    } else {
        echo 'error';
    }
} elseif ($job == 'listphotos') {
    S::gp(array('aid'));
    if ($photos = getPhotoList($photoService, $aid)) {
        echo "success\t" . pwJsonEncode($photos);
    } else {
        echo 'error';
    }
} else {
    $albums = getAlbumList($photoService);
    if ($albums) {
        $aid = $albums[0][0];
        $photos = getPhotoList($photoService, $aid);
        echo "success\t" . pwJsonEncode($albums) . "\t" . pwJsonEncode($photos);
    } else {
        echo 'error';
    }
}
exit;
function getAlbumList($sv)
{
    $sv->setPerpage($sv->getAlbumNumByUid());
    $result = $sv->getAlbumBrowseList();
    list(, $albums) = $result;
    $array = array();
    if ($albums) {
        foreach ($albums as $key => $value) {
            $array[] = array($value['aid'], $value['aname']);
        }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:image.php

示例12: toString

 /**
  * 输出消息
  * @return unknown_type
  */
 function toString()
 {
     return pwJsonEncode($this->msg);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:8,代码来源:commend.php

示例13: exit

<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('u'), 'P', 2);
if (!$u) {
    Showmsg('undefined_action');
}
if ($u != $winduid) {
    Showmsg('undefined_action');
}
$msgdb = array();
$messageServer = L::loadClass("message", 'message');
$temp = array();
$msgdb = $messageServer->getAllNotRead($winduid, 1, 10);
foreach ($msgdb as $value) {
    $type = $messageServer->getReverseConst(substr($value['typeid'], 0, 1));
    $temp[] = array('fromuid' => $value['uid'], 'from' => $value['username'], 'title' => substrs($value['title'], 30), 'rid' => $value['rid'], 'mid' => $value['mid'], 'typeid' => $value['typeid'], 'type' => $type);
}
$str = '';
if ($temp) {
    $str = stripcslashes(pwJsonEncode($temp));
}
echo "success\t{$str}";
ajax_footer();
开发者ID:jechiy,项目名称:PHPWind,代码行数:24,代码来源:pwb_message.php

示例14: USING

S::gp(array('fid', 'tid', 'pid', 'pingid'), null, 2);
//权限
$foruminfo = $db->get_one('SELECT * FROM pw_forums f LEFT JOIN pw_forumsextra fe USING(fid) WHERE f.fid=' . S::sqlEscape($fid));
!$foruminfo && Showmsg('data_error');
$isGM = $isBM = $admincheck = 0;
if ($groupid != 'guest') {
    $isGM = S::inArray($windid, $manager);
    $isBM = admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid);
    $admincheck = $isGM || $isBM ? 1 : 0;
}
$pingdata = $db->get_one("SELECT * FROM pw_pinglog WHERE id=" . S::sqlEscape($pingid));
!$pingdata && Showmsg('data_error');
!($admincheck || $_G['markable'] && $pingdata['pinger'] == $windid) && Showmsg('data_error');
//$db->update("UPDATE pw_pinglog SET ifhide=1 WHERE id=" . S::sqlEscape($pingid) . " LIMIT 1");
pwQuery::update('pw_pinglog', 'id=:id  LIMIT 1', array($pingid), array('ifhide' => 1));
if ($db->affected_rows()) {
    $pingService = L::loadClass("ping", 'forum');
    $pingTotal = $pingService->getPingLogAll($tid, $pid);
    $pingTotal = pwJsonEncode($pingTotal);
    echo "success\t{$pingTotal}";
    $pingService->update_markinfo($tid, $pid);
    # memcache reflesh
    if ($db_memcache) {
        //* $threads = L::loadClass('Threads', 'forum');
        //* $threads->delThreads($tid);
        Perf::gatherInfo('changeThreadWithThreadIds', array('tid' => $tid));
    }
} else {
    echo "data_error";
}
ajax_footer();
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:delpinglog.php

示例15: initFileTypeInfo

function initFileTypeInfo($db_uploadfiletype)
{
    $uploadfiletype = $db_uploadfiletype ? unserialize($db_uploadfiletype) : array();
    $attachAllow = pwJsonEncode($uploadfiletype);
    $imageAllow = pwJsonEncode(getAllowKeysFromArray($uploadfiletype, array('jpg', 'jpeg', 'gif', 'png', 'bmp')));
    return array($attachAllow, $imageAllow);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:m_post.php


注:本文中的pwJsonEncode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。