<?php

/* ========================================================================
 *
 */

/**
 *
 */

class ktai_page_fh_good_user_list extends OpenPNE_Action
{
    function execute($requests)
    {
        $u  = $GLOBALS['KTAI_C_MEMBER_ID'];
        $tail = $GLOBALS['KTAI_URL_TAIL'];

        //画面切り替えのために自分の情報を取得する
        $c_member = db_common_c_member4c_member_id($u);
        $this->set('c_member',$c_member);
        //自分のディスプレイを判定する
        $MyDisplayTemplate = getMyDisplay($c_member['mobile_view']);
        $this->set('MyDisplayTemplate',$MyDisplayTemplate['template_foldername']);

        // --- リクエスト変数
        $target_c_diary_id = $requests['target_c_diary_id'];
        // ----------

        //  一覧画面の表示件数
        $page_size = 20;

        $target_c_diary =  db_diary_get_c_diary4id($target_c_diary_id);
        $target_c_member_id = $target_c_diary['c_member_id'];

        if ($target_c_member_id == $u) {
            $type = 'h';

        } else {
            $type = 'f';

            // check public_flag
            if (!pne_check_diary_public_flag($target_c_diary_id, $u)) {
                ktai_display_error('この日記にはアクセスできません');
            }
            // アクセスブロック
            if (p_common_is_access_block($u, $target_c_member_id)) {
                openpne_redirect('ktai', 'page_h_access_block');
            }

        }

        $this->set("page_size", $page_size );
        $this->set("target_diary", $target_c_diary);

       //いいね!
        $good_count = good_count($target_c_diary_id);
        $good_user_list = good_user($target_c_diary_id, $page_size);

        $this->set("good_count", $good_count);
        $this->set("good_user_list", $good_user_list);

        return 'success';
    }

}

?>
