35 if (!$this->
_checkUser($this->params[1], $this->params[2])) {
44 foreach ($fields as $tag => $detail) {
46 if (!isset($this->params[3][$maptag])) {
47 $data = $this->
_getTagCdata($this->params[3][
'description'], $maptag,
true);
48 if (trim($data) ==
''){
49 if ($detail[
'required']) {
56 $post[$tag] = $this->params[3][$maptag];
59 if (count($missing) > 0) {
61 foreach ($missing as $m) {
62 $msg .=
'<'.$m.
'> ';echo $m;
67 $newparams[0] = $this->params[0];
68 $newparams[1] = $this->params[1];
69 $newparams[2] = $this->params[2];
70 foreach ($post as $key => $value) {
71 $newparams[3][$key] = $value;
74 $newparams[3][
'xoops_text'] = $this->params[3][
'description'];
75 if (isset($this->params[3][
'categories']) && is_array($this->params[3][
'categories'])) {
76 foreach ($this->params[3][
'categories'] as $k => $v) {
77 $newparams[3][
'categories'][$k] = $v;
80 $newparams[4] = $this->params[4];
82 $xoopsapi->_setUser($this->user, $this->isadmin);
91 if (!$this->
_checkUser($this->params[1], $this->params[2])) {
98 foreach ($fields as $tag => $detail) {
100 if (!isset($this->params[3][$maptag])) {
101 $data = $this->
_getTagCdata($this->params[3][
'description'], $maptag,
true);
102 if (trim($data) ==
''){
103 if ($detail[
'required']) {
110 $post[$tag] = $this->params[3][$maptag];
113 if (count($missing) > 0) {
115 foreach ($missing as $m) {
120 $newparams = array();
121 $newparams[0] = $this->params[0];
122 $newparams[1] = $this->params[1];
123 $newparams[2] = $this->params[2];
124 foreach ($post as $key => $value) {
125 $newparams[3][$key] = $value;
128 if (isset($this->params[3][
'categories']) && is_array($this->params[3][
'categories'])) {
129 foreach ($this->params[3][
'categories'] as $k => $v) {
130 $newparams[3][
'categories'][$k] = $v;
133 $newparams[3][
'xoops_text'] = $this->params[3][
'description'];
134 $newparams[4] = $this->params[4];
136 $xoopsapi->_setUser($this->user, $this->isadmin);
137 $xoopsapi->editPost();
145 if (!$this->
_checkUser($this->params[1], $this->params[2])) {
150 $xoopsapi->_setUser($this->user, $this->isadmin);
151 $ret = $xoopsapi->getPost(
false);
152 if (is_array($ret)) {
155 foreach ($ret as $key => $value) {
173 $content .=
'<'.$key.
'>'.trim($value).
'</'.$key.
'>';
178 $this->response->add($struct);
187 if (!$this->
_checkUser($this->params[1], $this->params[2])) {
192 $xoopsapi->_setUser($this->user, $this->isadmin);
193 $ret = $xoopsapi->getRecentPosts(
false);
194 if (is_array($ret)) {
203 foreach($ret[
$i] as $key => $value) {
221 $content .=
'<'.$key.
'>'.trim($value).
'</'.$key.
'>';
229 $this->response->add($arr);
239 if (!$this->
_checkUser($this->params[1], $this->params[2])) {
244 $xoopsapi->_setUser($this->user, $this->isadmin);
245 $ret = $xoopsapi->getCategories(
false);
246 if (is_array($ret)) {
248 foreach ($ret as
$id => $detail) {
254 $catstruct->add($detail[
'title'], $struct);
255 $arr->add($catstruct);
259 $this->response->add($arr);
MetaWeblogApi(&$params, &$response, &$module)
_getTagCdata(&$text, $tag, $remove=true)
XoopsXmlRpcApi(array &$params, XoopsXmlRpcResponse &$response, XoopsModule &$module)
_getPostFields($post_id=null, $blog_id=null)
_getXoopsTagMap($xoopstag)
_checkUser($username, $password)
_setXoopsTagMap($xoopstag, $blogtag)
if(!is_object($module)||!$module->getVar('isactive')) $msg