• 虹色ミツバチ
  • freoカスタマイズメモ、テンプレート・プラグイン配布/officeTIPS
検索プラグイン
虹色ミツバチ

> Entry >freo>freoTips>プラグイン系TIPS> アルバムプラグインでフィルタリング利用時にフィルター認証確認プラグインをアルバムでも使用する方法

【freo】【freoTips】【プラグイン系TIPS】アルバムプラグインでフィルタリング利用時にフィルター認証確認プラグインをアルバムでも使用する方法

フィルター認証確認プラグインは、freo公式サイトで配布されている、フィルターを認証するか確認するためのメッセージを表示するプラグインです。
アルバムプラグインでフィルタリング利用時に、フィルターを認証するか確認するメッセージを表示するには、下記のとおりにして下さい。

  1. アルバムプラグイン(ver.3_0_5以上)を実装する。
  2. フィルター認証確認プラグインを実装する。
  3. [freo/libs/freo/plugins/page.filter_comfirm.php]の21~24行目を下記のように変更する
        //入力データ確認
        if (empty($_GET['filter_id']) or (empty($_GET['entry_id']) and empty($_GET['page_id']) and empty($_GET['media_path']) and empty($_GET['album_id']))) {
            freo_redirect('filter/default?error=1', true);
        }
    
  4. [freo/libs/freo/plugins/page.filter_comfirm.php]の39~46行目を下記のように変更する
        //元の記事へ移動
        if (!empty($_GET['entry_id'])) {
            freo_redirect('view/' . $_GET['entry_id']);
        } elseif (!empty($_GET['page_id'])) {
            freo_redirect('page/' . $_GET['page_id']);
        } elseif (!empty($_GET['media_path'])) {
            freo_redirect('file/media/' . $_GET['media_path']);
        } elseif (!empty($_GET['album_id'])) {
            freo_redirect('album/view/' . $_GET['album_id']);
        }
    
  5. [freo/templates/plugins/filter_confirm/filter_confirm.html]を下記のように変更する
    <!--{if ($entry_filters[$entry.id] and $entry_associates[$entry.id].filter.r18) or ($page_filters[$page.id] and $page_associates[$page.id].filter.r18) or ($entry_filter and $entry_associate.filter.r18) or ($page_filter and $page_associate.filter.r18) or $media_associate.filter.r18 or $plugin_album_filters[$plugin_album.id] or $plugin_album_filter}-->
    <div class="filter_confirm">
        <h4>年齢確認</h4>
        <p>この記事には年齢制限が設けられています。あなたは18歳以上ですか?</p>
        <ul>
            <li><a href="{$freo.core.http_file}/filter_confirm?freo%5Btoken%5D={$token}&amp;media_path={$smarty.get.path}&amp;entry_id={$entry.id}&amp;page_id={$page.id}&amp;album_id={$plugin_album.id}&amp;filter_id=r18">はい</a></li>
            <li><a href="{$freo.core.http_file}">いいえ</a></li>
        </ul>
    </div>
    <!--{/if}-->
    
  6. [freo/templates/plugins/album/default.html]と[freo/templates/plugins/album/view.html]のフィルター認証確認を表示したい箇所に下記の通り加筆する
    {include file='plugins/filter_confirm/filter_confirm.html'}
    

ページ移動

関連記事

ページ上部へ