23 |
include('libs/XML/Server.php'); |
include('libs/XML/Server.php'); |
24 |
$s = new XML_RPC_Server(array( |
$s = new XML_RPC_Server(array( |
25 |
"query" => array( |
"query" => array( |
26 |
"function" => "nfo_query" |
"function" => "nfo_query" |
27 |
), |
), |
28 |
"getContent" => array( |
"getContent" => array( |
29 |
"function" => "nfo_get_content", |
"function" => "nfo_get_content", |
57 |
#nfo_debug_write($nqlquery); |
#nfo_debug_write($nqlquery); |
58 |
$result = array(); |
$result = array(); |
59 |
cms_query($nqlquery,&$result); |
cms_query($nqlquery,&$result); |
60 |
#nfo_debug_write($result); |
nfo_debug_write($result); |
61 |
|
|
62 |
$structinfo = array(); |
$structinfo = array(); |
63 |
$structcontent = array(); |
$structcontent = array(); |
64 |
$structfields = array(); |
$structfields = array(); |
65 |
|
|
66 |
foreach ($result[0] as $key => $value) { |
foreach ($result[0] as $key => $value) { |
67 |
$structinfo[$key] = new XML_RPC_Value($value,"string"); |
if ($key == 'all'){ |
68 |
} |
$datall = array(); |
69 |
foreach ($result[1] as $key => $value) { |
foreach ($result[0][$key] as $keyall => $valall) { |
70 |
$structcontent[$key] = new XML_RPC_Value($value,"struct"); |
|
71 |
|
if ($keyall == 'fieldlist'){ |
72 |
|
$datall2 = array(); |
73 |
|
foreach ($result[0][$key][$keyall] as $fieldkey => $fieldval){ |
74 |
|
$datall2 = new XML_RPC_Value($fieldval,"string"); |
75 |
|
} |
76 |
|
$datall[$keyall] = new XML_RPC_Value($datall2,"struct"); |
77 |
|
}else{ |
78 |
|
$datall[$keyall] = new XML_RPC_Value($valall,"string"); |
79 |
|
} |
80 |
|
} |
81 |
|
$structinfo[$key] = new XML_RPC_Value($datall,"struct"); |
82 |
|
}else{ |
83 |
|
$structinfo[$key] = new XML_RPC_Value($value,"string"); |
84 |
|
} |
85 |
} |
} |
86 |
|
|
87 |
|
#foreach ($result[1] as $key => $value) { |
88 |
|
#$structcontent[$key] = new XML_RPC_Value($value,"struct"); |
89 |
|
# } |
90 |
|
|
91 |
|
foreach ($result[1] as $key => $value) { |
92 |
|
$cdata = array(); |
93 |
|
foreach($value as $item => $data) { |
94 |
|
$cdata[$item] = new XML_RPC_Value($data,"string"); |
95 |
|
} |
96 |
|
$structcontent[$key] = new XML_RPC_Value($cdata,"struct"); |
97 |
|
} |
98 |
|
|
99 |
foreach ($result[2] as $key => $value) { |
foreach ($result[2] as $key => $value) { |
100 |
$structfields[$key] = new XML_RPC_Value($value,"string"); |
$structfields[$key] = new XML_RPC_Value($value,"string"); |
101 |
} |
} |