| 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" | 
|  | "signature" => array(array('struct','struct','struct')), |  | 
| 27 | ), | ), | 
| 28 | "getContent" => array( | "getContent" => array( | 
| 29 | "function" => "nfo_get_content", | "function" => "nfo_get_content", | 
| 52 |  |  | 
| 53 | $querytxt = $params->getParam(0); | $querytxt = $params->getParam(0); | 
| 54 | $nqlquery = $querytxt->getval(); | $nqlquery = $querytxt->getval(); | 
| 55 | nfo_debug_clean(); | #nfo_debug_clean(); | 
| 56 | #nfo_debug_write($params); | #nfo_debug_write($params); | 
| 57 | #nfo_debug_write($nqlquery); | #nfo_debug_write($nqlquery); | 
| 58 | $result = array(); | $result = 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"); | $datall = array(); | 
| 68 |  | if ($key == 'all'){ | 
| 69 |  | #nfo_debug_write($value); | 
| 70 |  | foreach ($result[0][$key] as $keyall => $valall) { | 
| 71 |  | $datall2 = array(); | 
| 72 |  | if ($keyall == 'fieldlist'){ | 
| 73 |  | foreach ($result[0][$key][$keyall] as $fieldkey => $fieldval) | 
| 74 |  | { | 
| 75 |  | $datall2[$fieldkey] = new XML_RPC_Value($fieldval,"string"); | 
| 76 |  | } | 
| 77 |  | $datall[$keyall] = new XML_RPC_Value($datall2,"struct"); | 
| 78 |  | }elseif($keyall == 'with'){ | 
| 79 |  | //nothing yet | 
| 80 |  | }else{ | 
| 81 |  | $datall[$keyall] = new XML_RPC_Value($valall,"string"); | 
| 82 |  | } | 
| 83 | } | } | 
| 84 | foreach ($result[1] as $key => $value)  { |  | 
| 85 | $structcontent[$key] = new XML_RPC_Value($value,"struct"); | $structinfo[$key] = new XML_RPC_Value($datall,"struct"); | 
| 86 |  |  | 
| 87 |  | }else{ | 
| 88 |  | $structinfo[$key] = new XML_RPC_Value($value,"string"); | 
| 89 |  | } | 
| 90 | } | } | 
| 91 |  |  | 
| 92 |  | foreach ($result[1] as $key => $value)  { | 
| 93 |  | $cdata = array(); | 
| 94 |  | foreach($value as $item => $data) { | 
| 95 |  | $cdata[$item] = new XML_RPC_Value($data,"string"); | 
| 96 |  | } | 
| 97 |  | $structcontent[$key] = new XML_RPC_Value($cdata,"struct"); | 
| 98 |  | } | 
| 99 |  |  | 
| 100 | foreach ($result[2] as $key => $value) { | foreach ($result[2] as $key => $value) { | 
| 101 | $structfields[$key] = new XML_RPC_Value($value,"string"); | $structfields[$key] = new XML_RPC_Value($value,"string"); | 
| 102 | } | } | 
| 103 |  |  | 
| 104 | $struct = array(); | $struct = array(); | 
| 105 | $struct[0] = new XML_RPC_Value($structinfo,"struct"); | $struct[0] = new XML_RPC_Value($structinfo,"struct"); | 
| 106 | $struct[1] = new XML_RPC_Value($structcontent,"struct"); | $struct[1] = new XML_RPC_Value($structcontent,"struct"); | 
| 107 | $struct[2] = new XML_RPC_Value($structfields,"struct"); | $struct[2] = new XML_RPC_Value($structfields,"struct"); | 
| 108 |  |  | 
| 109 | $xmldoc = new XML_RPC_Response(new XML_RPC_Value($struct, "struct")); | $xmldoc = new XML_RPC_Response(new XML_RPC_Value($struct, "struct")); | 
| 110 | nfo_debug_write($xmldoc); | #nfo_debug_write($xmldoc); | 
| 111 | #nfo_debug_write($xmldoc->serialize()); | #nfo_debug_write($xmldoc->serialize()); | 
| 112 |  |  | 
| 113 | return $xmldoc; | return $xmldoc; |