エントリー

freoで各記事に設定したフィルター名を表示する

freoにあるフィルター機能では、フィルター設定で表示・非表示の切替をすることができますが、複数のフィルターを設定していると、当該記事のフィルターがどれなのか表示されていないので、それを各記事に表示させる方法です。
ファイル 93-1.jpg

フィルター認証確認プラグインを使用していない場合

1) エントリーの場合

templates/internals/view/default.html の60行目あたりにある

<!--{if $entry_associate.option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->

の下に、

<!--{if $entry_associate.filter}-->
  <p><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br />フィルター:<!--{foreach from=$entry_associate.filter|smarty:nodefaults key='entry_filter' item='entry_filter' name='loop'}-->{$freo.refer.filters[$entry_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->

を追加します。

2) ページの場合

templates/internals/page/default.html の50行目あたりにある

<!--{if $page_associate.option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->

の下に、

<!--{$page_associate.filter}-->
  <p><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br />フィルター:<!--{foreach from=$page_associate.filter|smarty:nodefaults key='page_filter' item='page_filter' name='loop'}-->{$freo.refer.filters[$page_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->

を追加します。

3) 制限された記事を一覧に表示するように設定している場合

templates/internals/default/default.html の135行目あたりにある

<!--{if $entry_associates[$entry.id].option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->

の下に、

<!--{if $entry_associates[$entry.id].filter}-->
  <p><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br />フィルター:<!--{foreach from=$entry_associates[$entry.id].filter|smarty:nodefaults key='entry_filter' item='entry_filter' name='loop'}-->{$freo.refer.filters[$entry_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->

を追加します。
※1)の追加文とは若干異なっているので注意

すると、フィルター設定へのリンクとフィルター名の表示ができます。
ファイル 93-2.jpg

4) メディアの場合 【2015/5/5追記】

templates/internals/file/error.html にある

<h2>エラー</h2>
<p class="attention">{$message}</p>

の下に、

<!--{if $media_associate.filter}-->
  <p><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br />フィルター:<!--{foreach from=$media_associate.filter|smarty:nodefaults key='media_filter' item='media_filter' name='loop'}-->{$freo.refer.filters[$media_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->

を追加します。

フィルター認証確認プラグインを使用している場合

フィルター認証確認プラグイン を利用しているフィルターには、フィルター設定へのリンクを表示しないようにします。
※以下はフィルターIDが「r18」の場合で、既にフィルター認証確認プラグインを導入していることを前提としています。

1) エントリーの場合

templates/internals/view/default.html の60行目あたりにある

<!--{if $entry_associate.option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->
{include file='plugins/filter_confirm/filter_confirm.html'}

の部分を、

<!--{if $entry_associate.option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->
<!--{if $entry_associate.filter}-->
  <p><!--{if !$entry_associate.filter.r18}--><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br /><!--{/if}-->フィルター:<!--{foreach from=$entry_associate.filter|smarty:nodefaults key='entry_filter' item='entry_filter' name='loop'}-->{$freo.refer.filters[$entry_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->
{include file='plugins/filter_confirm/filter_confirm.html'}

に変更(赤字を追加)します。

2) ページの場合

templates/internals/page/default.html の50行目あたりにある

<!--{if $page_associate.option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->
{include file='plugins/filter_confirm/filter_confirm.html'}

の部分を、

<!--{if $page_associate.option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->
<!--{if $page_associate.filter}-->
  <p><!--{if !$page_associate.filter.r18}--><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br /><!--{/if}-->フィルター:<!--{foreach from=$page_associate.filter|smarty:nodefaults key='page_filter' item='page_filter' name='loop'}-->{$freo.refer.filters[$page_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->
{include file='plugins/filter_confirm/filter_confirm.html'}

に変更(赤字を追加)します。

3) 制限された記事を一覧に表示するように設定している場合

templates/internals/default/default.html の135行目あたりにある

<!--{if $entry_associates[$entry.id].option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->
{include file='plugins/filter_confirm/filter_confirm.html'}

の部分を、

<!--{if $entry_associates[$entry.id].option}-->
<dl>
  <!--{foreach from=$freo.refer.options|smarty:nodefaults item='option'}-->
  ~略~
  <!--{/foreach}-->
</dl>
<!--{/if}-->
<!--{if $entry_associates[$entry.id].filter}-->
  <p><!--{if !$entry_associates[$entry.id].filter.r18}--><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br /><!--{/if}-->フィルター:<!--{foreach from=$entry_associates[$entry.id].filter|smarty:nodefaults key='entry_filter' item='entry_filter' name='loop'}-->{$freo.refer.filters[$entry_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->
{include file='plugins/filter_confirm/filter_confirm.html'}

に変更(赤字を追加)します。
※1)の追加文とは若干異なっているので注意

すると、フィルター認証を利用しているフィルターには、フィルター設定へのリンクの代わりに確認文が表示されます。
ファイル 93-3.jpg

4) メディアの場合 【2015/5/5追記】

templates/internals/file/error.html にある

<h2>エラー</h2>
<p class="attention">{$message}</p>
{include file='plugins/filter_confirm/filter_confirm.html'}

の部分を、

<h2>エラー</h2>
<p class="attention">{$message}</p>
<!--{if $media_associate.filter}-->
  <p><!--{if !$media_associate.filter.r18}--><a href="{$freo.core.http_file}/filter">フィルター設定</a>で以下のフィルターを「表示する」に設定してからご覧ください。<br /><!--{/if}-->フィルター:<!--{foreach from=$media_associate.filter|smarty:nodefaults key='media_filter' item='media_filter' name='loop'}-->{$freo.refer.filters[$media_filter].name}<!--{if !$smarty.foreach.loop.last}-->&nbsp;<!--{/if}--><!--{/foreach}--></p>
<!--{/if}-->
{include file='plugins/filter_confirm/filter_confirm.html'}

に変更(赤字を追加)します。

ページ移動

関連エントリー

コメント

  • コメントはまだありません。

コメント登録

  • コメントを入力してください。
  • 一旦登録したコメントは、あとで編集できませんのでご注意下さい。
登録フォーム

基本的には「全体に公開」されますが、内容によっては管理人の方で公開を制限する場合がありますので、その旨ご了承下さい。

ユーティリティ

2024年03月

- - - - - 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31 - - - - - -

キーワード検索

キーワード検索フォーム

ユーザー

  • cccのアバター

新着画像

ブログパーツ

Twitter

Twilogを見る

Feed