--- nfo/site/htdocs/netfraggle.php 2004/09/20 23:38:14 1.13 +++ nfo/site/htdocs/netfraggle.php 2004/09/21 12:04:45 1.14 @@ -5,7 +5,7 @@ -------------------------------------------------------------------------------- --- rabit, 01:28 24.08.2004 --- joko, 04:05 30.08.2004 ---- $Id: netfraggle.php,v 1.13 2004/09/20 23:38:14 xabbu Exp $ +--- $Id: netfraggle.php,v 1.14 2004/09/21 12:04:45 xabbu Exp $ ------------------------------------------------------------------------------*/ include('inc/common/common.php.inc'); @@ -52,46 +52,43 @@ $querytxt = $params->getParam(0); $nqlquery = $querytxt->getval(); - nfo_debug_clean(); + #nfo_debug_clean(); #nfo_debug_write($params); #nfo_debug_write($nqlquery); $result = array(); cms_query($nqlquery,&$result); - nfo_debug_write($result); + #nfo_debug_write($result); $structinfo = array(); $structcontent = array(); $structfields = array(); foreach ($result[0] as $key => $value) { + $datall = array(); if ($key == 'all'){ - $datall = array(); + #nfo_debug_write($value); foreach ($result[0][$key] as $keyall => $valall) { - - if ($keyall == 'fieldlist'){ - $datall2 = array(); - foreach ($result[0][$key][$keyall] as $fieldkey => $fieldval){ - $datall2 = new XML_RPC_Value($fieldval,"string"); - } - $datall[$keyall] = new XML_RPC_Value($datall2,"struct"); - }else{ - if($keyall == 'with'){ - // DO nothing yet - }else{ - $datall[$keyall] = new XML_RPC_Value($valall,"string"); - } - } + $datall2 = array(); + if ($keyall == 'fieldlist'){ + foreach ($result[0][$key][$keyall] as $fieldkey => $fieldval) + { + $datall2[$fieldkey] = new XML_RPC_Value($fieldval,"string"); } + $datall[$keyall] = new XML_RPC_Value($datall2,"struct"); + }elseif($keyall == 'with'){ + //nothing yet + }else{ + $datall[$keyall] = new XML_RPC_Value($valall,"string"); + } + } + $structinfo[$key] = new XML_RPC_Value($datall,"struct"); + }else{ $structinfo[$key] = new XML_RPC_Value($value,"string"); } - } - - #foreach ($result[1] as $key => $value) { - #$structcontent[$key] = new XML_RPC_Value($value,"struct"); - # } - + } + foreach ($result[1] as $key => $value) { $cdata = array(); foreach($value as $item => $data) { @@ -102,14 +99,15 @@ foreach ($result[2] as $key => $value) { $structfields[$key] = new XML_RPC_Value($value,"string"); - } + } + $struct = array(); $struct[0] = new XML_RPC_Value($structinfo,"struct"); $struct[1] = new XML_RPC_Value($structcontent,"struct"); $struct[2] = new XML_RPC_Value($structfields,"struct"); $xmldoc = new XML_RPC_Response(new XML_RPC_Value($struct, "struct")); - nfo_debug_write($xmldoc); + #nfo_debug_write($xmldoc); #nfo_debug_write($xmldoc->serialize()); return $xmldoc;