Skip to content

Commit

Permalink
Advanced search #188: Keyword highlight.
Browse files Browse the repository at this point in the history
  • Loading branch information
lincanbin committed Jun 4, 2016
1 parent f0f2b38 commit ab928e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions styles/default/template/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function KeywordHighlight($Content)
if ($KeywordArray) {
$KeywordHighlightArray = array();
foreach ($KeywordArray as $Value) {
$KeywordHighlightArray[] = '<span class="red">' . $Value . '</span>';
$KeywordHighlightArray[] = '<span class="search-keyword">' . $Value . '</span>';
}
return str_ireplace($KeywordArray, $KeywordHighlightArray, $Content);
} else {
Expand Down Expand Up @@ -42,7 +42,7 @@ function KeywordHighlight($Content)
</h2>
<?php if( isset($Topic['MinContent']) ) { ?>
<div class="topic-dec">
<?php echo $Topic['MinContent']; ?>
<?php echo $PostsSearch ? KeywordHighlight($Topic['MinContent']) : $Topic['MinContent']; ?>
</div>
<?php } ?>
<span class="item-tags">
Expand Down
2 changes: 1 addition & 1 deletion styles/default/template/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</div>
<div class="c"></div>
</div>
<p class="fs14"><?php echo ($Tag['Description']? mb_strlen($Tag['Description']) > 60 ? mb_substr($Tag['Description'], 0, 60, 'utf-8').'……' : $Tag['Description'] : '' ); ?></p>
<p class="fs14"><?php echo ($Tag['Description']? mb_strlen($Tag['Description']) > 60 ? mb_substr($Tag['Description'], 0, 60, 'utf-8').'……' : $DescStr : '' ); ?></p>
</div>
<?php
}
Expand Down
2 changes: 1 addition & 1 deletion styles/mobile/template/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<?php echo $Tag['Name']; ?> (<?php echo $Tag['TotalPosts']; ?>)
</a>
</h2>
<p><?php echo ($Tag['Description']? mb_strlen($Tag['Description']) > 60 ? mb_substr($Tag['Description'], 0, 60, 'utf-8').'……' : $Tag['Description'] : '' ); ?>
<p><?php echo ($Tag['Description']? mb_strlen($Tag['Description']) > 60 ? mb_substr($Tag['Description'], 0, 60, 'utf-8').'……' : $DescStr : '' ); ?>
</p>
</div>

Expand Down

0 comments on commit ab928e8

Please sign in to comment.