OSDN Git Service

前回のコミットの補遺
[nucleus-jp/nucleus-next.git] / nucleus / xmlrpc / api_mt.inc.php
index a68887e..0be5e36 100644 (file)
@@ -2,7 +2,7 @@
 
 /*
  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
- * Copyright (C) 2002-2012 The Nucleus Group
+ * Copyright (C) 2002-2009 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
@@ -16,8 +16,8 @@
  * Wouter Demuynck 2003-08-31
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
- * @copyright Copyright (C) 2002-2012 The Nucleus Group
- * @version $Id: api_mt.inc.php 1388 2009-07-18 06:31:28Z shizuki $
+ * @copyright Copyright (C) 2002-2009 The Nucleus Group
+ * @version $Id: api_mt.inc.php 1860 2012-05-19 03:47:59Z sakamocchi $
  */
 
        // mt.supportedMethods
 
                $trackbacks = array ();
                $tbstruct   = array ();
-                       
-               $manager->notify('RetrieveTrackback', array ('tb_id' => $itemid, 'trackbacks' => & $trackbacks));
+               
+               $data = array('tb_id' => $itemid, 'trackbacks' => & $trackbacks);
+               $manager->notify('RetrieveTrackback', $data);
                                
                while (list(,$v) = each ($trackbacks)) {
                        $tbstruct[] = new xmlrpcval(
                        return _error(6,"No such item ($itemid)");
 
                $blogid = getBlogIDFromItemID($itemid);
-               $blog = new Blog($blogid);
+               $blog =& $manager->getBlog($blogid);
 
                if (!$mem->canAlterItem($itemid))
                        return _error(7,"Not allowed to alter item");
                        return _error(6,"No such item ($itemid)");
 
                $blogid = getBlogIDFromItemID($itemid);
-               $blog = new Blog($blogid);
+               $blog =& $manager->getBlog($blogid);
 
                if (!$mem->canAlterItem($itemid))
                        return _error(7, 'You are not allowed to request this information');
 
                // get item data
                $blogid = getBlogIDFromItemID($itemid);
-               $blog = new Blog($blogid);
+               $blog =& $manager->getBlog($blogid);
                $old =& $manager->getItem($itemid,1,1);
 
                return _edititem($itemid, $username, $password, $old['catid'], $old['title'], $old['body'], $old['more'], $old['draft'], 1, $old['closed']);
 
 
        function _mt_categoryList($blogid, $username, $password) {
+               global $manager;
                // 1. login
                $mem = new Member();
                if (!$mem->login($username, $password))
                if (!$mem->teamRights($blogid))
                        return _error(3,"Not a team member");
 
-               $b = new Blog($blogid);
+               $b =& $manager->getBlog($blogid);
 
                $categorystruct = array();
 
 
        function _mt_getRecentPostTitles($blogid, $username, $password, $iAmount)
        {
+               global $manager;
+               
                $blogid = intval($blogid);
                $iAmount = intval($iAmount);
 
                // 3. create and return list of recent items
                // Struct returned has dateCreated, userid, postid and title
 
-               $blog = new Blog($blogid);
+               $blog =& $manager->getBlog($blogid);
 
                $structarray = array();         // the array in which the structs will be stored
 
 
 
 
-?>
\ No newline at end of file
+?>