Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/modules/news/NewsWebModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class NewsWebModule extends WebModule {
protected $showPubDate = false;
protected $showAuthor = false;
protected $showLink = false;
protected $showCommentsLink = false;
protected $legacyController = false;

public static function validateFeed($section, $feedData) {
Expand Down Expand Up @@ -202,6 +203,7 @@ protected function initialize() {
$this->showPubDate = isset($feedData['SHOW_PUBDATE']) ? $feedData['SHOW_PUBDATE'] : false;
$this->showAuthor = isset($feedData['SHOW_AUTHOR']) ? $feedData['SHOW_AUTHOR'] : false;
$this->showLink = isset($feedData['SHOW_LINK']) ? $feedData['SHOW_LINK'] : false;
$this->showCommentsLink = isset($feedData['SHOW_COMMENTS_LINK']) ? $feedData['SHOW_COMMENTS_LINK'] : false;
}

protected function htmlEncodeFeedString($string) {
Expand Down Expand Up @@ -264,8 +266,15 @@ protected function initializeForPage() {
$this->assign('author', $this->htmlEncodeFeedString($story->getAuthor()));
$this->assign('image', $this->getImageForStory($story));
$this->assign('link', $story->getLink());
if ($story->getComments()) {
$this->assign('commentslink', $story->getComments());
}
else {
$this->assign('commentslink', $story->getLink());
}
$this->assign('ajax', $this->getArg('ajax'));
$this->assign('showLink', $this->showLink);
$this->assign('showCommentsLink', $this->showCommentsLink);
break;

case 'search':
Expand Down
1 change: 1 addition & 0 deletions app/modules/news/strings/en_US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NEXT_STORY_TEXT="Next %s stories"
SECTION_TEXT="Section:"
NO_RESULTS="No Stories Found"
READ_MORE="Read More"
READ_COMMENTS="Read/Leave Comments"
AUTHOR_CREDIT="by %s"
NEWS_ADMIN_OPTIONS_TITLE="Options"
NEWS_ADMIN_OPTIONS_DESCRIPTION=""
Expand Down
5 changes: 5 additions & 0 deletions app/modules/news/templates/story.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
</div>
{/block}
{/if}
{if $showCommentsLink}
<div id="comments">
<a href="{$commentslink}">{"READ_COMMENTS"|getLocalizedString}</a>
</div>
{/if}
</div><!--story-->
</div>

Expand Down