/[cvs]/nfo/site/htdocs/netfraggle.php
ViewVC logotype

Diff of /nfo/site/htdocs/netfraggle.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by joko, Mon Aug 30 02:33:26 2004 UTC revision 1.5 by joko, Mon Aug 30 11:27:30 2004 UTC
# Line 20  $type = 'XMLRPC'; Line 20  $type = 'XMLRPC';
20    
21  switch ($type) {  switch ($type) {
22    case 'XMLRPC':    case 'XMLRPC':
23        include('libs/XML/Server.php');
24      $s = new XML_RPC_Server(array(      $s = new XML_RPC_Server(array(
25        "nfo.listTopics" => array("function" => "nfo_list_topics"),        "listTopics" => array("function" => "nfo_list_topics"),
26        "nfo.listContents" => array("function" => "nfo_list_contents"),        "listContents" => array("function" => "nfo_list_contents"),
27        "nfo.getContent" => array("function" => "nfo_get_content"),        #"getContent" => array("function" => "nfo_get_content", "signature" => array($xmlrpcStruct, xmlrpcString)),
28        "nfo.listUsers" => array("function" => "nfo_list_users"),        "getContent" => array("function" => "nfo_get_content"),
29          "listUsers" => array("function" => "nfo_list_users"),
30      ));      ));
31      break;      break;
32    case default:    default:
33      break;      break;
34  }  }
35    
# Line 37  function nfo_list_topics() { Line 39  function nfo_list_topics() {
39  function nfo_list_contents() {  function nfo_list_contents() {
40  }  }
41  function nfo_get_content($ck) {  function nfo_get_content($ck) {
42    $content = cms_getcontent($ck);    #nfo_debug_clean();
43    return new XML_RPC_Response(new XML_RPC_Value("content", "array" | "struct"));    #nfo_debug_write("ck: $ck\n");
44      $ck = 'Home';
45      $content = cms_getcontent('xmlpage', $ck);
46      nfo_debug_write($content);
47      #return new XML_RPC_Response(new XML_RPC_Value("content", "string"));
48      $struct = array();
49      foreach ($content as $key => $value) {
50        $struct[$key] = new XML_RPC_Value($value, "string");
51      }
52      $xmldoc = new XML_RPC_Response(new XML_RPC_Value($struct, "struct"));
53      #nfo_debug_write($xmldoc);
54      nfo_debug_write($xmldoc->serialize());
55      return $xmldoc;
56  }  }
57  function nfo_list_users() {  function nfo_list_users() {
58  }  }
59    
60    function nfo_debug_clean() {
61      #`rm dump`;
62    }
63    
64    function nfo_debug_write($data) {
65      ob_start();
66      print_r($data);
67      $data = ob_get_clean();
68      $f = fopen('dump', 'w+');
69      fputs($f, $data);
70      fclose($f);
71    }
72    
73  //------------------------------------------------------------------------------  //------------------------------------------------------------------------------
74    
75  ?>  ?>

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed