【php开源代码栏目提醒】:网学会员为需要php开源代码的朋友们搜集整理了api_blogger.inc.php相关资料,希望对各位网友有所帮助!
<?php
/*
* Nucleus:
PHP/MySQL Weblog CMS (http://nucleuscms.org/)
* Copyright (C) 2002-2005 The Nucleus Group
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* (see nucleus/documentation/index.html#license for more info)
*/
/**
* This file contains definitions for the methods in the Blogger API
*
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-2005 The Nucleus Group
* @version $Id: api_blogger.inc.php 760 2005-08-15 10:51:09Z dekarma $
*/
// blogger.newPost
$f_blogger_newPost_sig = array(array(
// return type
$xmlrpcString, // itemid of the new item
// params:
$xmlrpcString, // appkey (ignored)
$xmlrpcString, // blogid
$xmlrpcString, // username
$xmlrpcString, // password
$xmlrpcString, // content
$xmlrpcBoolean, // publish boolean (set to false to create draft)
));
$f_blogger_newPost_doc = "Adds a new item to the given blog. Adds it as a draft when publish is false";
function f_blogger_newPost($m) {
$blogid = _getScalar($m,1);
$username = _getScalar($m,2);
$password = _getScalar($m,3);
$content = _getScalar($m,4);
$publish = _getScalar($m,5);
$title = blogger_extractTitle($content);
$category = blogger_extractCategory($content);
$content = blogger_removeSpecialTags($content);
return _addItem($blogid, $username, $password, $title, $content, '', $publish, 0, $category);
}
// blogger.editPost
$f_blogger_editPost_sig = array(array(
// return type
$xmlrpcBoolean, // true or false
// params:
$xmlrpcString, // appkey (ignored)
$xmlrpcString, // postid
$xmlrpcString, // username
$xmlrpcString, // password
$xmlrpcString, // content
$xmlrpcBoolean, // publish boolean (only considered when dealing with a draft)
));
$f_blogger_editPost_doc = "Edits an item of a blog";
function f_blogger_editPost($m) {
global $manager;
$itemid = intval(_getScalar($m,1));
$username = _getScalar($m,2);
$password = _getScalar($m,3);
$content = _getScalar($m,4);
$publish = _getScalar($m,5);
$title = blogger_extractTitle($content);
$category = blogger_extractCategory($content);
$content = blogger_removeSpecialTags($content);
// get old title and extended part
if (!$manager->existsItem($itemid,1,1))
return _error(6,"No such item ($itemid)");
$old =& $manager->getItem($itemid,1,1);
$blogid = getBlogIDFromItemID($itemid);
$blog = new BLOG($blogid);
$catid = $blog->getCategoryIdFromName($category);
if ($old['draft'] && $publish) {
$wasdraft = 1;
$publish = 1;
} else {
$wasdraft = 0;
}
return _edititem($itemid, $username, $password, $catid, $title, $content, $old['more'], $wasdraft, $publish, $old['closed']);
}
// blogger.getUsersBlogs
$f_blogger_getUsersBlogs_sig = array(array(
// return type
$xmlrpcArray, // array containing structs containing blog info
// params:
$xmlrpcString, // appkey (ignored)
$xmlrpcString, // username
$xmlrpcString, // password
));
$f_blogger_getUsersBlogs_doc = "Returns a list of all the blogs where the given member is on the team";
function f_blogger_getUsersBlogs($m) {
$username = _getScalar($m,1);
$password = _getScalar($m,2);
return _getUsersBlogs($username, $password);
}
// blogger.getRecentPosts
$f_blogger_getRecentPosts_sig = array(array(
// return type
$xmlrpcArray, // array of strucs (representing items)
// params
$xmlrpcString, // appkey (ignored)
$xmlrpcString, // blogid
$xmlrpcString, // username
$xmlrpcString, // password
$xmlrpcInt, // amount of items to return (max = 20)
));
$f_blogger_getRecentPosts_doc = "Returns a maximum of 20 recent items";
function f_blogger_getRecentPosts($m) {
$blogid = _getScalar($m, 1);
$username = _getScalar($m, 2);
$password = _getScalar($m, 3);
$amount = _getScalar($m, 4);
return _getRecentItemsBlogger($blogid, $username, $password, $amount);
}
// blogger.getPost
$f_blogger_getPost_sig = array(array(
// return type
$xmlrpcStruct, // A struct representing the item
// params
$xmlrpcString, // appkey (ignored)
$
xmlrpcString, // postid
$xmlrpcString, // username
$xmlrpcS