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


PHP MEMBER::teamRights方法代码示例

本文整理汇总了PHP中MEMBER::teamRights方法的典型用法代码示例。如果您正苦于以下问题:PHP MEMBER::teamRights方法的具体用法?PHP MEMBER::teamRights怎么用?PHP MEMBER::teamRights使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MEMBER的用法示例。


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

示例1: _getItem

/**
 * Returns one item (Nucleus version)
 */
function _getItem($itemid, $username, $password)
{
    global $manager;
    // 1. login
    $mem = new MEMBER();
    if (!$mem->login($username, $password)) {
        return _error(1, "Could not log in");
    }
    // 2. check if allowed
    if (!$manager->existsItem($itemid, 1, 1)) {
        return _error(6, "No such item ({$itemid})");
    }
    $blogid = getBlogIDFromItemID($itemid);
    if (!$mem->teamRights($blogid)) {
        return _error(3, "Not a team member");
    }
    // 3. return the item
    // Structure returned has dateCreated, userid, blogid and content
    $item =& $manager->getItem($itemid, 1, 1);
    // (also allow drafts and future items)
    $blog = new BLOG($blogid);
    if ($blog->convertBreaks()) {
        $item['body'] = removeBreaks($item['body']);
    }
    $newstruct = new xmlrpcval(array("publishDate" => new xmlrpcval(iso8601_encode($item['timestamp']), "dateTime.iso8601"), "userid" => new xmlrpcval($item['authorid'], "string"), "blogid" => new xmlrpcval($blogid, "string"), "title" => new xmlrpcval($item['title'], "string"), "body" => new xmlrpcval($item['body'], "string"), "more" => new xmlrpcval($item['more'], "string"), "draft" => new xmlrpcval($item['draft'], "boolean"), "closed" => new xmlrpcval($item['closed'], "boolean")), 'struct');
    return new xmlrpcresp($newstruct);
}
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:30,代码来源:api_nucleus.inc.php

示例2: _getItemBlogger

/**
 * Returns one item (Blogger version)
 */
function _getItemBlogger($itemid, $username, $password)
{
    global $manager;
    // 1. login
    $mem = new MEMBER();
    if (!$mem->login($username, $password)) {
        return _error(1, "Could not log in");
    }
    // 2. check if allowed
    if (!$manager->existsItem($itemid, 1, 1)) {
        return _error(6, "No such item ({$itemid})");
    }
    $blogid = getBlogIDFromItemID($itemid);
    if (!$mem->teamRights($blogid)) {
        return _error(3, "Not a team member");
    }
    // 3. return the item
    // Structure returned has dateCreated, userid, blogid and content
    $item =& $manager->getItem($itemid, 1, 1);
    // (also allow drafts and future items)
    $blog = new BLOG($blogid);
    // get category
    $item['category'] = $blog->getCategoryName($item['catid']);
    // remove linebreaks if needed
    if ($blog->convertBreaks()) {
        $item['body'] = removeBreaks($item['body']);
    }
    $content = blogger_specialTags($item) . $item['body'];
    $newstruct = new xmlrpcval(array("dateCreated" => new xmlrpcval(iso8601_encode($item['timestamp']), "dateTime.iso8601"), "userid" => new xmlrpcval($item['authorid'], "string"), "blogid" => new xmlrpcval($blogid, "string"), "content" => new xmlrpcval($content, "string")), 'struct');
    return new xmlrpcresp($newstruct);
}
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:34,代码来源:api_blogger.inc.php

示例3: _mt_getRecentPostTitles

function _mt_getRecentPostTitles($blogid, $username, $password, $iAmount)
{
    $blogid = intval($blogid);
    $iAmount = intval($iAmount);
    // 1. login
    $mem = new MEMBER();
    if (!$mem->login($username, $password)) {
        return _error(1, "Could not log in");
    }
    // 2. check if allowed
    if (!BLOG::existsID($blogid)) {
        return _error(2, "No such blog ({$blogid})");
    }
    if (!$mem->teamRights($blogid)) {
        return _error(3, "Not a team member");
    }
    $iAmount = intval($iAmount);
    if ($iAmount < 1) {
        return _error(5, "Amount parameter must be positive");
    }
    // 3. create and return list of recent items
    // Struct returned has dateCreated, userid, postid and title
    $blog = new BLOG($blogid);
    $structarray = array();
    // the array in which the structs will be stored
    $query = "SELECT inumber, ititle as title, itime, iauthor" . ' FROM ' . sql_table('item') . " WHERE iblog={$blogid}" . " ORDER BY itime DESC" . " LIMIT {$iAmount}";
    $r = sql_query($query);
    while ($row = sql_fetch_assoc($r)) {
        $newstruct = new xmlrpcval(array("dateCreated" => new xmlrpcval(iso8601_encode(strtotime($row['itime'])), "dateTime.iso8601"), "postid" => new xmlrpcval($row['inumber'], "string"), "title" => new xmlrpcval($row['title'], "string"), "userid" => new xmlrpcval($row['iauthor'], "string")), 'struct');
        array_push($structarray, $newstruct);
    }
    return new xmlrpcresp(new xmlrpcval($structarray, "array"));
}
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:33,代码来源:api_mt.inc.php

示例4: _setSkinPart

function _setSkinPart($blogid, $username, $password, $content, $type)
{
    // 1. login
    $mem = new MEMBER();
    if (!$mem->login($username, $password)) {
        return _error(1, "Could not log in");
    }
    // 2. check if allowed
    if (!BLOG::existsID($blogid)) {
        return _error(2, "No such blog ({$blogid})");
    }
    if (!$mem->teamRights($blogid)) {
        return _error(3, "Not a team member");
    }
    // 3. update skin part
    $blog = new BLOG($blogid);
    $skin = new SKIN($blog->getDefaultSkin());
    $skin->update($type, $content);
    return new xmlrpcresp(new xmlrpcval(1, 'boolean'));
}
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:20,代码来源:server.php

示例5: _mw_getPost

function _mw_getPost($itemid, $username, $password)
{
    global $manager;
    // 1. login
    $mem = new MEMBER();
    if (!$mem->login($username, $password)) {
        return _error(1, "Could not log in");
    }
    // 2. check if allowed
    if (!$manager->existsItem($itemid, 1, 1)) {
        return _error(6, "No such item ({$itemid})");
    }
    $blogid = getBlogIDFromItemID($itemid);
    if (!$mem->teamRights($blogid)) {
        return _error(3, "Not a team member");
    }
    // 3. return the item
    $item =& $manager->getItem($itemid, 1, 1);
    // (also allow drafts and future items)
    $b = new BLOG($blogid);
    if ($b->convertBreaks()) {
        $item['body'] = removeBreaks($item['body']);
        $item['more'] = removeBreaks($item['more']);
    }
    $categoryname = $b->getCategoryName($item['catid']);
    $newstruct = new xmlrpcval(array("dateCreated" => new xmlrpcval(iso8601_encode($item['timestamp']), "dateTime.iso8601"), "userid" => new xmlrpcval($item['authorid'], "string"), "blogid" => new xmlrpcval($blogid, "string"), "postid" => new xmlrpcval($itemid, "string"), "description" => new xmlrpcval($item['body'], "string"), "title" => new xmlrpcval($item['title'], "string"), "categories" => new xmlrpcval(array(new xmlrpcval($categoryname, "string")), "array"), "mt_text_more" => new xmlrpcval($item['more'], "string"), "mt_allow_comments" => new xmlrpcval($item['closed'] ? 0 : 1, "int"), "mt_allow_pings" => new xmlrpcval(1, "int")), 'struct');
    //TODO: add "String link" to struct?
    //TODO: add "String permaLink" to struct?
    return new xmlrpcresp($newstruct);
}
开发者ID:hatone,项目名称:Nucleus-v3.64,代码行数:30,代码来源:api_metaweblog.inc.php


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