public function writeOutput()
 {
     if ($this->isFault()) {
         XMLRPC_error($this->faultCode, $this->faultString);
     } elseif ($this->returnValue == null) {
         // TODO: Can we return nothing throuh xmlrpc?
         // TODO: Why is XMLRPC_prepare going nuts with an empty string passed?
         XMLRPC_response(XMLRPC_prepare("void"));
     } else {
         $type = $this->returnValue->getType();
         if ($type == Types::DATE) {
             $convertedValue = XMLRPC_convert_timestamp_to_iso8601($this->returnValue->getValue());
         } else {
             $convertedValue = $this->returnValue->getValue();
         }
         XMLRPC_response(XMLRPC_prepare($convertedValue));
     }
 }
function metaWeblog_getPost($params)
{
    global $loq;
    if ($loq->userauth($params[1], $params[2])) {
        $postid = $params[0];
        $entryrow = $loq->get_post($postid, TRUE, TRUE);
        $entry['userid'] = 1;
        $entry['dateCreated'] = XMLRPC_convert_timestamp_to_iso8601($entryrow->posttime);
        $entry['postid'] = $entryrow->postid;
        $entry['description'] = $entryrow->body;
        $entry['title'] = $entryrow->title;
        $entry['link'] = $loq->_get_entry_permalink($entryrow->postid);
        //$entryar =array();
        //$entryar[]=$entry;
        //ob_start();
        //print_r($entryar);
        //echo "entry row :";
        //print_r($entryrow);
        //$o = ob_get_contents();
        //ob_end_clean();
        XMLRPC_response(XMLRPC_prepare($entry), WEBLOG_XMLPRPC_USERAGENT);
    } else {
        XMLRPC_error("301", "The username and password you entered was not accepted. Please try again.", WEBLOG_XMLRPC_USERAGENT);
    }
}
Example #3
0
 function _convertDocumentToStruct($d)
 {
     // Valid item elements per http://backend.userland.com/rss#hrelementsOfLtitemgt
     // FIXME: get rid of hard coded URLs!
     $tmp = array('postid' => $d->ID, 'guid' => 'http://improbable.org/chris/index.php?ID=' . $d->ID, 'link' => 'http://improbable.org/chris/index.php?ID=' . $d->ID, 'title' => $d->Title, 'description' => $d->Body, 'dateCreated' => XMLRPC_convert_timestamp_to_iso8601($d->Created), 'pubDate' => XMLRPC_convert_timestamp_to_iso8601($d->Modified));
     return $tmp;
 }