function execute() { $context = $this->getContext(); $controller = $context->getController(); $request = $context->getRequest(); $user = $context->getUser(); $community_id = $request->getParameter('community_id'); $view_mode = $request->getParameter('mode'); $acs_user_info_row = $user->getAttribute('acs_user_info_row'); $community_row = ACSCommunity::get_community_profile_row($community_id); $is_permitted = false; /* アクセス権チェック */ // 閲覧可能かチェックする // 削除フラグ、全体の公開範囲をチェック /* 写真表示 */ // ファイル情報取得 $image_file_id = $community_row['file_id']; if ($image_file_id) { $file_obj = ACSFile::get_file_info_instance($image_file_id); $ret = $file_obj->view_image($view_mode); } else { $image_url = ACSCommunity::get_default_image_url($view_mode); header("Location: {$image_url}"); } }
/** * image_urlを加工する * * @param community_id * @param view_mode 表示モード : NULL, thumb, rss */ static function get_image_url($community_id, $view_mode = '') { $file_id = ACSCommunityImageFileModel::get_file_id($community_id); if ($file_id != '') { $image_url = SCRIPT_PATH . '?'; $image_url .= MODULE_ACCESSOR . '=Community'; $image_url .= '&' . ACTION_ACCESSOR . '=CommunityImage'; $image_url .= '&community_id=' . $community_id; $image_url .= '&mode=' . $view_mode; } else { $image_url = ACSCommunity::get_default_image_url($view_mode); } return $image_url; }