'.$newline;
// pagination
if ($grabMax > 0){
$numResultPages = ceil($limit/$grabMax);
$resultPageLinks = '
';
$resultPageLinks .= ($limit>$grabMax)? $paginationTextMultiplePages : $paginationTextSinglePage ;
$resultPageLinkNumber = 1;
for ($nrp=0;$nrp<$limit && $limit > $grabMax;$nrp+=$grabMax){
if($offset == ($resultPageLinkNumber-1)*$grabMax){
$resultPageLinks .= $resultPageLinkNumber;
} else {
$resultPageLinks .= '' . $resultPageLinkNumber . '';
}
$resultPageLinks .= ($nrp+$grabMax < $limit)? $pageLinkSeparator : '' ;
$resultPageLinkNumber++;
}
$resultPageLinks .= "".$newline;
$SearchForm .= '".$newline;
} // end if grabMax
// search results
$useLimit = ($grabMax > 0)? $offset+$grabMax : $limit;
for ($y = $offset; ($y < $useLimit) && ($y<$limit); $y++) {
$moveToRow = mysql_data_seek($rs,$y);
$SearchFormsrc=$modx->fetchRow($rs);
if ($extract) {
$text=$SearchFormsrc['content'];
if (count($search)>1){
$count=1;
$summary='';
foreach ($search as $searchTerm){
$summary .= PrepareSearchContent( $text, $length=200, $searchTerm );
$summary = preg_replace( '/' . preg_quote( $searchTerm, '/' ) . '/i', '
\0', $summary );
$count++;
}
$text=$summary;
} else {
$search=$searchString;
$text=PrepareSearchContent( $text, $length=200, $search );
$text = preg_replace( '/' . preg_quote( $searchString, '/' ) . '/i', '
\0', $text );
}
}
$SearchForm.='
'.$newline;
// Handle weblinks.
$theLink = '[~'.$SearchFormsrc['id'].'~]';
$linkClass = "";
if (($SearchFormsrc['type']=='reference') && $useWeblink) {
$theLink = $SearchFormsrc['content']; // Get the weblink content, which should be the URL that the link points to
$linkClass = $weblinkClass; // Set the css class.
}
$SearchForm.='
".$newline;
$SearchForm.=$SearchFormsrc['description']!='' ? '
' . $SearchFormsrc['description'] . "".$newline : "" ;
$SearchForm.=''.$newline;
$SearchForm.='
'.$newline;
}
$SearchForm.='';
$SearchForm.='
'.$newline;
} else {
$SearchForm.='