/*
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
- * Copyright (C) 2002-2007 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
* This file contains definitions for the methods of the metaWeblog API
*
* @license http://nucleuscms.org/license.txt GNU General Public License
- * @copyright Copyright (C) 2002-2007 The Nucleus Group
+ * @copyright Copyright (C) 2002-2009 The Nucleus Group
* @version $Id: api_metaweblog.inc.php,v 1.6 2007-02-04 06:28:46 kimitake Exp $
* $NucleusJP: api_metaweblog.inc.php,v 1.5 2006/07/17 20:03:45 kimitake Exp $
*/
$category = _getArrayVal($catlist, 0);
- $comments = (int) _getStructVal($struct, 'mt_allow_comments') ? 0 : 1;
- $publish = _getScalar($m,4);
+// $comments = (int) _getStructVal($struct, 'mt_allow_comments') ? 0 : 1;\r
+ $comments = $struct->structmem('mt_allow_comments');\r
+ if ($comments) {\r
+ $closed = (intval(_getStructVal($struct, 'mt_allow_comments')) == 1) ? 0 : 1;\r
+ } else {\r
+ $closed = 0;\r
+ }\r
+ $publish = _getScalar($m,4);
// Add item
- $res = _addItem($blogid, $username, $password, $title, $content, $more, $publish, $comments, $category);
-
+// $res = _addItem($blogid, $username, $password, $title, $content, $more, $publish, $comments, $category);\r
+ $res = _addItem($blogid, $username, $password, $title, $content, $more, $publish, $closed, $category);\r
+
// Handle trackbacks
$trackbacks = array();
$tblist = $struct->structmem('mt_tb_ping_urls');
$comments = $struct->structmem('mt_allow_comments');
if ($comments) {
- $comments = (int) _getStructVal($struct, 'mt_allow_comments') ? 0 : 1;
+// $comments = (int) _getStructVal($struct, 'mt_allow_comments') ? 0 : 1;\r
+ $closed = (intval(_getStructVal($struct, 'mt_allow_comments')) == 1) ? 0 : 1;\r
} else {
- $comments = $old['closed'];
+// $comments = $old['closed'];\r
+ $closed = $old['closed'];\r
}
- $res = _edititem($itemid, $username, $password, $catid, $title, $content, $more, $wasdraft, $publish, $comments);
-
+// $res = _edititem($itemid, $username, $password, $catid, $title, $content, $more, $wasdraft, $publish, $comments);\r
+ $res = _edititem($itemid, $username, $password, $catid, $title, $content, $more, $wasdraft, $publish, $closed);
// Handle trackbacks
$trackbacks = array();
$tblist = $struct->structmem('mt_tb_ping_urls');