Please do not spider search results in an automated fashion. " ."It can generate significant system load. "; if (PluginManager::getInstance()->pluginEnabled("XmlSitemap")) { print "Instead, please use the " ."XML Sitemap " ."that we provide."; } print "
"; return; } # set page title PageTitle("Search Results - ".StdLib::NeatlyTruncateString( $H_SearchParams->TextDescription(false), 120 )); # ----- LOCAL FUNCTIONS ------------------------------------------------------ /** * Get hidden tags needed by the sort controls for sorting and ordering. * @param int $ItemType Type of item handled by sort controls. * @param mixed $SortField The field to sort by. * @param string $UrlParameterString String with all URL parameters. * @param int $NumSearchResults Number of search results * @return array Two-element array of strings where the first gives the hidden * tags for sort fields and the second gives the hidden tags for the sort * direction. */ function getSortFieldHiddenTags( int $ItemType, $SortField, string $UrlParameterString ) : array { # split out URL parameters to build hidden tags for sort field and direction parse_str($UrlParameterString, $UrlParameters); $SortFieldHiddenTags = ""; $SortDirectionHiddenTags = ""; # for each URL parameter foreach ($UrlParameters as $Param => $Values) { $VarNameSuffix = $ItemType ? $ItemType : ""; # if multiple values were (or may be) provided if (is_array($Values)) { # for each value foreach ($Values as $Index => $Value) { # build hidden tag $Tag = "\n"; if ((($Param != TransportControlsUI::PNAME_SORTFIELD.$VarNameSuffix) && ($Param != TransportControlsUI::PNAME_STARTINGINDEX.$VarNameSuffix)) || ($Index != $ItemType)) { # add tag to sort field tags $SortFieldHiddenTags .= $Tag; } # if not reverse sort parameter for this item type if (($Param != TransportControlsUI::PNAME_REVERSESORT.$VarNameSuffix) || ($Index != $ItemType)) { # add tag to sort direction tags $SortDirectionHiddenTags .= $Tag; } } } else { # build hidden tag $Tag = "\n"; # if param isn't reverse sort tag if ($Param != TransportControlsUI::PNAME_REVERSESORT.$VarNameSuffix) { # add to direction tags $SortDirectionHiddenTags .= $Tag; # and if param also isn't sort field tag or start index tag if ($Param != TransportControlsUI::PNAME_SORTFIELD.$VarNameSuffix || $Param != TransportControlsUI::PNAME_STARTINGINDEX.$VarNameSuffix) { # add to sort field tags $SortFieldHiddenTags .= $Tag; } } } } return [$SortFieldHiddenTags, $SortDirectionHiddenTags]; } /** * Get the controls for sorting and ordering. * @param int $ItemType Type of item handled by sort controls. * @param mixed $SortField The field to sort by. * @param bool $SortDescending Set to TRUE to indicate that sorting is in * descending order. * @param array $SortableFields Array of sortable fields. * @param string $UrlParameterString String with all URL parameters. * @param SearchParameterSet $SearchParams Search parameters for this search * @param int $NumSearchResults Number of search results * @return string Returns the sort controls HTML as a string. */ function GetSortControls( int $ItemType, $SortField, bool $SortDescending, array $SortableFields, string $UrlParameterString, SearchParameterSet $SearchParams, int $NumSearchResults ) : string { # get hidden tags list($SortFieldHiddenTags, $SortDirectionHiddenTags) = getSortFieldHiddenTags( $ItemType, $SortField, $UrlParameterString ); # retrieve specifications for sort direction button list($AscOrderInfo, $DescOrderInfo) = GetSortOrderButton($SortField); # grab unique ID for use in the JavaScript below $SafeUniqId = defaulthtmlentities(uniqid()); $SafeSortFieldId = null; $ForwardSortValue = (is_null($SortField) || $SortField->Type() == MetadataSchema::MDFTYPE_DATE || $SortField->Type() == MetadataSchema::MDFTYPE_TIMESTAMP) ? 1 : 0; $VarNameSuffix = $ItemType ? $ItemType : ""; $SortFieldVarName = TransportControlsUI::PNAME_SORTFIELD.$VarNameSuffix; $ReverseSortVarName = TransportControlsUI::PNAME_REVERSESORT.$VarNameSuffix; ob_start(); ?>