예제 #1
0
    		  $properties=array();
    		  // The name of the text input form field
    		  $properties["name"]="pattern";
    		  $properties["link"]=$config['rootUrl'] . "/search.php?language=any_language&station=$stationName";
    		  $properties["title"]="Search for:";
    		  $properties["description"]= $page->getlocalizedWithParams('search_in_station', $stationName);
    		  $rss_writer_object->addtextinput($properties);
    */
    $rss .= "\n</channel>";
} elseif ($query) {
    // ***************** SERIALIZED QUERY ****************
    $advsearch = new sotf_AdvSearch();
    $advsearch->Deserialize($query);
    // send results of advanced query given as string
    $rss .= "\n<channel>";
    $queryTags = $advsearch->GetHumanReadable();
    for ($i = 0; $i < count($queryTags); $i++) {
        // TODO: this is a rough solution
        if ($i == count($queryTags) - 1) {
            $queryTexts[] = $queryTags[$i][1] . ' ' . $queryTags[$i][2] . ' ' . $queryTags[$i][3];
        } else {
            $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>";
            if ($topic["name"] != "") {
                if ($values[$topicname] == "") {
                    $values[$topicname] = $topic["name"];
                } else {
                    $values[$topicname] .= "; " . $topic["name"];
                }
            }
        }
    }
    $item['title'] = $result[$i][title];
    $item['id'] = $result[$i][id];
    $item['icon'] = sotf_Blob::cacheIcon2($result[$i]);
    $item['values'] = $values;
    $selected[] = $item;
    $item = "";
    $values = "";
}
//var_dump($selected);
//if (DB::isError($result)) die($result->getMessage());
//print("<BR />".count($result));
$smarty->assign("SQLquery", $SQLquery);
//the query
$smarty->assign("SQLquerySerial", $SQLquerySerial);
//the serialized query
//$smarty->assign("SQLqueryfields", $advsearch->GetSQLqueryfields());	//translated name for all fieldnames of the query
//$smarty->assign("SQLqueryEQs", $advsearch->GetSQLqueryEQs());		//translated name for all EQs (<, >, = ...) of the query
$smarty->assign("HumanReadable", $advsearch->GetHumanReadable());
//human readable format for the query fileds
$smarty->assign("result", $selected);
//result array
$page->send();