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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations)
Mon Aug 30 11:27:30 2004 UTC (19 years, 10 months ago) by joko
Branch: MAIN
Changes since 1.4: +35 -8 lines
U renamed api methods
+ debugging functions

1 <?php
2 /*------------------------------------------------------------------------------
3 --- www.netfrag.org
4 --- NetFraggle client link page.
5 --------------------------------------------------------------------------------
6 --- rabit, 01:28 24.08.2004
7 --- joko, 04:05 30.08.2004
8 --- $Id: netfraggle.php,v 1.4 2004/08/30 02:33:26 joko Exp $
9 ------------------------------------------------------------------------------*/
10
11 include('inc/common/common.php.inc');
12
13 //------------------------------------------------------------------------------
14
15 // ...NetFraggle interconnection code...
16 // by now using XML-RPC, see API-Documentation at:
17 // http://pear.php.net/manual/en/package.webservices.xml-rpc.api.php
18
19 $type = 'XMLRPC';
20
21 switch ($type) {
22 case 'XMLRPC':
23 include('libs/XML/Server.php');
24 $s = new XML_RPC_Server(array(
25 "listTopics" => array("function" => "nfo_list_topics"),
26 "listContents" => array("function" => "nfo_list_contents"),
27 #"getContent" => array("function" => "nfo_get_content", "signature" => array($xmlrpcStruct, xmlrpcString)),
28 "getContent" => array("function" => "nfo_get_content"),
29 "listUsers" => array("function" => "nfo_list_users"),
30 ));
31 break;
32 default:
33 break;
34 }
35
36
37 function nfo_list_topics() {
38 }
39 function nfo_list_contents() {
40 }
41 function nfo_get_content($ck) {
42 #nfo_debug_clean();
43 #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() {
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 ?>

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