Skip to content

Commit

Permalink
Updating to 1.8.1-beta2
Browse files Browse the repository at this point in the history
Handling outputSeparator much better now. thanks @theboxer
  • Loading branch information
jpdevries committed Jan 20, 2014
1 parent ab836e5 commit cdffd16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _build/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
define('PKG_NAME','SimpleSearch');
define('PKG_NAME_LOWER','simplesearch');
define('PKG_VERSION','1.8.1');
define('PKG_RELEASE','beta1');
define('PKG_RELEASE','beta2');

/* define sources */
$root = dirname(dirname(__FILE__)).'/';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
$resultsTpl = array('default' => array('results' => array(),'total' => $response['total']));
if (!empty($response['results'])) {
/* iterate through search results */
$total = count($response['results']);
foreach ($response['results'] as $resourceArray) {
$resourceArray['idx'] = $idx;
if (empty($resourceArray['link'])) {
Expand All @@ -99,7 +98,7 @@
$extract = str_replace(array('[[',']]'),'',$extract);
$resourceArray['extract'] = !empty($highlightResults) ? $search->addHighlighting($extract,$highlightClass,$highlightTag) : $extract;
}
$resultsTpl['default']['results'][] = $search->getChunk($tpl,$resourceArray) . (($total > $idx) ? $outputSeparator : "");
$resultsTpl['default']['results'][] = $search->getChunk($tpl,$resourceArray);
$idx++;
}
}
Expand Down Expand Up @@ -129,7 +128,7 @@
foreach ($facetResults['results'] as $r) {
$r['idx'] = $idx;
$fTpl = !empty($scriptProperties['tpl'.$facetKey]) ? $scriptProperties['tpl'.$facetKey] : $tpl;
$resultsTpl[$facetKey]['results'][] = $search->getChunk($fTpl,$r) . (($facetResults['total'] > $idx) ? $outputSeparator : "");
$resultsTpl[$facetKey]['results'][] = $search->getChunk($fTpl,$r);
$idx++;
}
}
Expand All @@ -139,7 +138,7 @@
/* set faceted results to placeholders for easy result positioning */
$output = array();
foreach ($resultsTpl as $facetKey => $facetResults) {
$resultSet = implode("\n",$facetResults['results']);
$resultSet = implode($outputSeparator,$facetResults['results']);
$placeholders[$facetKey.'.results'] = $resultSet;
$placeholders[$facetKey.'.total'] = !empty($facetResults['total']) ? $facetResults['total'] : 0;
$placeholders[$facetKey.'.key'] = $facetKey;
Expand Down

0 comments on commit cdffd16

Please sign in to comment.