エントリーやページへの投稿ユーザー名の表示について

概要

テンプレートを編集すれば、エントリーやページに投稿ユーザー名を表示することができます。複数のユーザーで投稿を行う場合は、表示しておくといいかもしれません。

広告

詳細

エントリーに投稿ユーザー名を表示するには、一例ですが templates/internals/default/default.html の90行目あたりと templates/internals/view/default.html の15行目あたりにある

<!--{if $entry_tags[$entry.id]}-->
<li>タグ:<!--{foreach from=$entry_tags[$entry.id]|smarty:nodefaults item='entry_tag' name='loop'}--><a href="{$freo.core.http_file}/entry?tag={$entry_tag|smarty:nodefaults|escape:'url'}">{$entry_tag}</a><!--{if !$smarty.foreach.loop.last}-->, <!--{/if}--><!--{/foreach}--></li>
<!--{/if}-->

この直後に以下のコードを追加します。

<li>投稿者:<a href="{$freo.core.http_file}/profile/{$entry.user_id}">{$freo.refer.users[$entry.user_id].name}</a></li>

これでエントリーごとに投稿者名が表示され、クリックするとプロフィールが表示されます。

同様に、ページに投稿ユーザー名を表示するには、一例ですが templates/internals/page/default.html の45行目あたりにある

<!--{if $page_tags}-->
<p>タグ:<!--{foreach from=$page_tags|smarty:nodefaults item='page_tag' name='loop'}--><a href="{$freo.core.http_file}/page?tag={$page_tag|smarty:nodefaults|escape:'url'}">{$page_tag}</a><!--{if !$smarty.foreach.loop.last}-->, <!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->

この直後に以下のコードを追加します。

<p>投稿者:<a href="{$freo.core.http_file}/profile/{$page.user_id}">{$freo.refer.users[$page.user_id].name}</a></p>

これでページごとに投稿者名が表示され、クリックするとプロフィールが表示されます。