Jump to content

Last post in topic widget?


Apfelstrudel

Recommended Posts

Hello,

how can I change the shown date of a topic in the topic widget that it shows the date of the last post and not of the topic start? This makes more sense for me and the community.

Also it would be great to show the username of the last poster and not the topic starter.

Thanks in advance for any help.

Link to comment
Share on other sites

try to change template :thumbsup:

forums -> front -> widgets >> topicFeed

{{if !empty( $topics ) }}
	<h3 class='ipsWidget_title ipsType_reset'>{$title}</h3>

	{{if $orientation == 'vertical'}}
		<div class='ipsPad_half ipsWidget_inner'>
			<ul class='ipsDataList ipsDataList_reducedSpacing'>
				{{foreach $topics as $topic}}
					<li class='ipsDataItem{{if $topic->unread()}} ipsDataItem_unread{{endif}}{{if $topic->hidden()}} ipsModerated{{endif}}'>
						<div class='ipsDataItem_icon ipsPos_top'>
                        {{if ( $topic->posts - 1 ) === 0}}
                            {template="userPhoto" group="global" app="core" params="$topic->author(), 'tiny'"}
                        {{else}}
                            {template="userPhoto" group="global" app="core" params="$topic->lastCommenter(), 'tiny'"}
                        {{endif}}
						</div>
						<div class='ipsDataItem_main'>
							<div class="ipsCommentCount ipsPos_right {{if ( $topic->posts - 1 ) === 0}}ipsFaded{{endif}}" data-ipsTooltip title='{lang="replies_number" pluralize="$topic->posts - 1"}'>{expression="$topic->posts - 1"}</div>
							<a href="{$topic->url()->setQueryString( 'do', 'getNewComment' )}" title='{lang="view_this_topic" sprintf="$topic->title"}' class='ipsDataItem_title ipsType_break'>{wordbreak="$topic->title"}</a>
							{{if $topic->mapped('featured') || $topic->hidden() === -1 || $topic->hidden() === 1}}
								<span>
									{{if $topic->hidden() === -1}}
										<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{$topic->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
									{{elseif $topic->hidden() === 1}}
										<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
									{{endif}}
									{{if $topic->mapped('featured')}}
										<span class="ipsBadge ipsBadge_icon ipsBadge_small ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span>
									{{endif}}
								</span>
							{{endif}}
							<br>
                            {{if ( $topic->posts - 1 ) === 0}}
                                <span class='ipsType_light ipsType_small'>{lang="byline_nodate" htmlsprintf="$topic->author()->link()"} &middot; {lang="topic_started_date" htmlsprintf="\IPS\DateTime::ts( $topic->mapped('date') )->html()"}</span>
                            {{else}}
                                <span class='ipsType_light ipsType_small'>{lang="byline" htmlsprintf="$topic->lastCommenter()->link()"} {datetime="$topic->mapped('last_comment')"}</span>
                            {{endif}}
						</div>
					</li>
				{{endforeach}}
			</ul>
		</div>
	{{else}}
		<div class='ipsWidget_inner'>
			<ul class='ipsDataList'>
				{{foreach $topics as $topic}}
					{template="row" group="global" app="forums" location="front" params="NULL, NULL, $topic, FALSE"}
				{{endforeach}}
			</ul>
		</div>
	{{endif}}
{{endif}}

 

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...