| 1 |
rabit |
1.2 |
<?php |
| 2 |
|
|
/*------------------------------------------------------------------------------ |
| 3 |
|
|
--- www.netfrag.org |
| 4 |
|
|
--- NetFraggle client link page. |
| 5 |
|
|
-------------------------------------------------------------------------------- |
| 6 |
|
|
--- rabit, 01:28 24.08.2004 |
| 7 |
joko |
1.4 |
--- joko, 04:05 30.08.2004 |
| 8 |
joko |
1.5 |
--- $Id: netfraggle.php,v 1.4 2004/08/30 02:33:26 joko Exp $ |
| 9 |
rabit |
1.2 |
------------------------------------------------------------------------------*/ |
| 10 |
|
|
|
| 11 |
joko |
1.4 |
include('inc/common/common.php.inc'); |
| 12 |
rabit |
1.2 |
|
| 13 |
|
|
//------------------------------------------------------------------------------ |
| 14 |
|
|
|
| 15 |
|
|
// ...NetFraggle interconnection code... |
| 16 |
joko |
1.4 |
// 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 |
joko |
1.5 |
include('libs/XML/Server.php'); |
| 24 |
joko |
1.4 |
$s = new XML_RPC_Server(array( |
| 25 |
joko |
1.5 |
"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 |
joko |
1.4 |
)); |
| 31 |
|
|
break; |
| 32 |
joko |
1.5 |
default: |
| 33 |
joko |
1.4 |
break; |
| 34 |
|
|
} |
| 35 |
|
|
|
| 36 |
|
|
|
| 37 |
|
|
function nfo_list_topics() { |
| 38 |
|
|
} |
| 39 |
|
|
function nfo_list_contents() { |
| 40 |
|
|
} |
| 41 |
|
|
function nfo_get_content($ck) { |
| 42 |
joko |
1.5 |
#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 |
joko |
1.4 |
} |
| 57 |
|
|
function nfo_list_users() { |
| 58 |
joko |
1.5 |
} |
| 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 |
joko |
1.4 |
} |
| 72 |
rabit |
1.2 |
|
| 73 |
|
|
//------------------------------------------------------------------------------ |
| 74 |
|
|
|
| 75 |
|
|
?> |