function getQueryResults($params) { global $config, $db; $query = xmlrpc_decode($params->getParam(0)); $advsearch = new sotf_AdvSearch(); //create new search object object with this array $SQLquery = $advsearch->Deserialize($query); //deserialize the content of the hidden field $query = $advsearch->GetSQLCommand(); $results = $db->getAll($query . " LIMIT 30 OFFSET 0"); foreach ($results as $key => $result) { $icon = sotf_Blob::cacheIcon($result['id']); $results[$key]['icon'] = $config['cacheUrl'] . "/" . $result['id'] . ".png"; //TODO if no icon {$IMAGEDIR}/noicon.png $imageprefix???? } $retval = xmlrpc_encode($results); return new xmlrpcresp($retval); }
$queryTexts[] = $queryTags[$i][1] . ' ' . $queryTags[$i][2] . ' ' . $queryTags[$i][3] . ' ' . $queryTags[$i][0]; } } $queryText = implode(' ', $queryTexts); writeTag($rss, "title", "StreamOnTheFly query results"); writeTag($rss, "description", $queryText); writeTag($rss, "link", $config['rootUrl'] . "/advsearchresults.php?back=true&SQLquerySerial={$query}"); //added slash - martin schmidt //$properties["language"]="en"; $rss .= "\n<image>"; writeTag($rss, "url", $config['rootUrl'] . "/static/sotflogosmall.gif"); writeTag($rss, "link", $config['rootUrl']); writeTag($rss, "title", "Results of StreamOnTheFly query"); // width, height $rss .= "\n</image>"; $query = $advsearch->GetSQLCommand(); $res = $db->limitQuery($query, 0, $items); $hits = array(); while (DB_OK === $res->fetchInto($row)) { //$row['icon'] = sotf_Blob::cacheIcon($row['id']); $hits[] = $row; } foreach ($hits as $prog) { $prgObj =& $repository->getObject($prog['id']); addItem($rss, $prgObj); } $rss .= "\n</channel>"; } else { raiseError("Need a series or station id!"); } $rss .= "\n</rss>";
/** For portal */ function getQueryResults($params) { global $config, $db; $query = xmlrpc_decoder($params->getParam(0)); $advsearch = new sotf_AdvSearch(); //create new search object object with this array $SQLquery = $advsearch->Deserialize($query); //deserialize the content of the hidden field $query = $advsearch->GetSQLCommand(); $results = $db->getAll($query . " LIMIT 30 OFFSET 0"); foreach ($results as $key => $result) { $icon = sotf_Blob::cacheIcon2($result); if ($icon) { $results[$key]['icon'] = $config['cacheUrl'] . "/" . $icon; } //TODO if no icon {$IMAGEDIR}/noicon.png $imageprefix???? $prg =& new sotf_Programme($result['id']); // audio files for programme $audioFiles = $prg->listAudioFiles('true'); $results[$key]['audioFiles'] = array(); $results[$key]['downloadFiles'] = array(); foreach ($audioFiles as $fileList) { if ($fileList['stream_access'] == "t") { $results[$key]['audioFiles'][] = $fileList; } if ($fileList['download_access'] == "t") { $results[$key]['downloadFiles'][] = $fileList; } } } $retval = xmlrpc_encoder($results); return new xmlrpcresp($retval); }