Bug #14569 » 0000832-indexed_search.diff

Administrator Admin, 2005-02-23 09:53

View differences:

F:\XAMPP\xampp\htdocs\3.8.0\typo3\sysext\indexed_search\pi\class.tx_indexedsearch.php Tue Feb 22 20:59:28 2005
177 177
			// Do search:
178 178
			// If there were any search words entered...
179 179
		if (is_array($this->sWArr))	{
180
			$content = $this->doSearch($this->sWArr);
180
			$content = $this->doSearch($this->sWArr, $conf);
181 181
		}
182 182

  
183 183
			// Finally compile all the content, form, messages and results:
......
455 455
	 * @param	array		Search words in array, see ->getSearchWords() for details
456 456
	 * @return	string		HTML for result display.
457 457
	 */
458
	function doSearch($sWArr)	{
458
	function doSearch($sWArr, $conf)    {
459 459

  
460 460
			// Get result rows:
461 461
		$pt1 = t3lib_div::milliseconds();
......
578 578
	 * @param	array		Array with result rows, count, first row.
579 579
	 * @return	string		HTML content to display result.
580 580
	 */
581
	function getDisplayResults($sWArr, $resData)	{
581
	function getDisplayResults($sWArr, $resData, $conf)    {
582 582
			// Perform display of result rows array:
583 583
		if ($resData)	{
584 584
			$GLOBALS['TT']->push('Display Final result');
......
629 629
	 * @param	array		Result rows
630 630
	 * @return	string		HTML
631 631
	 */
632
	function compileResult($resultRows)	{
632
	function compileResult($resultRows, $conf)    {
633 633
		$content = '';
634 634

  
635 635
			// Transfer result rows to new variable, performing some mapping of sub-results etc.
......
686 686

  
687 687
						// Render result rows:
688 688
					foreach($resultRows as $row)	{
689
						$content.= $this->printResultRow($row);
689
						$content.= $this->printResultRow($row, $conf);
690 690
					}
691 691
				}
692 692
			break;
......
1303 1303
	 * @param	integer		1=Display only header (for sub-rows!), 2=nothing at all
1304 1304
	 * @return	string		HTML code
1305 1305
	 */
1306
	function printResultRow($row, $headerOnly=0)	{
1306
	function printResultRow($row, $conf, $headerOnly=0)    {
1307 1307

  
1308 1308
			// Get template content:
1309
		$tmplContent = $this->prepareResultRowTemplateData($row, $headerOnly);
1309
		$tmplContent = $this->prepareResultRowTemplateData($row, $conf, $headerOnly);
1310 1310

  
1311 1311
		if ($hookObj = &$this->hookRequest('printResultRow'))	{
1312 1312
			return $hookObj->printResultRow($row, $headerOnly, $tmplContent);
......
1441 1441
	 * @param	boolean		If set, display only header of result (for sub-results)
1442 1442
	 * @return	array		Array with data to insert in result row template
1443 1443
	 */
1444
	function prepareResultRowTemplateData($row, $headerOnly)	{
1444
	function prepareResultRowTemplateData($row, $conf, $headerOnly);
1445 1445

  
1446 1446
			// Initialize:
1447 1447
		$specRowConf = $this->getSpecialConfigForRow($row);
......
1464 1464
		$tmplContent['title'] = $title;
1465 1465
		$tmplContent['result_number'] = $row['result_number'];
1466 1466
		$tmplContent['icon'] = $this->makeItemTypeIcon($row['item_type'],'',$specRowConf);
1467
		$tmplContent['rating'] = $this->makeRating($row);
1467
		$tmplContent['rating'] = $this->makeRating($row, $conf);
1468 1468
		$tmplContent['description'] = $this->makeDescription($row,$this->piVars['extResume'] && !$headerOnly?0:1);
1469 1469
		$tmplContent = $this->makeInfo($row,$tmplContent);
1470 1470
		$tmplContent['access'] = $this->makeAccessIndication($row['page_id']);
......
1609 1609
	 * @param	array		Result row array
1610 1610
	 * @return	string		String showing ranking value
1611 1611
	 */
1612
	function makeRating($row)	{
1612
	function makeRating($row, $conf)	{
1613 1613

  
1614 1614
		switch((string)$this->piVars['order'])	{
1615 1615
			case 'rank_count':		// Number of occurencies on page
......
1635 1635
				return ceil(log($total)/log($max)*100).'%';
1636 1636
			break;
1637 1637
			case 'crdate':	// Based on creation date
1638
				return $this->cObj->calcAge(time()-$row['item_crdate'],0); // ,$conf['age']
1638
				return $this->cObj->calcAge(time()-$row['item_crdate'], $conf['age']);
1639 1639
			break;
1640 1640
			case 'mtime':	// Based on modification time
1641
				return $this->cObj->calcAge(time()-$row['item_mtime'],0); // ,$conf['age']
1641
				return $this->cObj->calcAge(time()-$row['item_mtime'], $conf['age']);
1642 1642
			break;
1643 1643
			default:	// fx. title
1644 1644
				return ' ';
......
2068 2068
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/pi/class.tx_indexedsearch.php'])	{
2069 2069
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/indexed_search/pi/class.tx_indexedsearch.php']);
2070 2070
}
2071
?>
2071
?>
(1-1/2)