Skip to content

Commit

Permalink
Advanced search #188: Automatically jump to post.
Browse files Browse the repository at this point in the history
  • Loading branch information
lincanbin committed Jun 15, 2016
1 parent bea580e commit 1bb743f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion styles/default/template/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@ function KeywordHighlight($Content)
</div>
<div class="item-content">
<h2>
<a href="<?php echo $Config['WebsitePath']; ?>/t/<?php echo $Topic['ID']; ?>"><?php echo KeywordHighlight($Topic['Topic']); ?></a>
<?php
if (empty($Topic['PostID'])):
?>
<a href="<?php echo $Config['WebsitePath']; ?>/t/<?php echo $Topic['ID']; ?>">
<?php
else:
?>
<a href="/goto/<?php echo $Topic['ID']; ?>-<?php echo $Topic['PostID']; ?>#Post<?php echo $Topic['PostID']; ?>">
<?php
endif
?>
<?php echo KeywordHighlight($Topic['Topic']); ?>
</a>
</h2>
<?php if( isset($Topic['MinContent']) ) { ?>
<div class="topic-dec">
Expand Down

0 comments on commit 1bb743f

Please sign in to comment.