get_exception(); } } /* 出力準備 */ $smarty = new SmartyEx(); $smarty->prepare(); /* マイプロフィール */ include('common/myprofile.inc'); /* Areaクラスインスタンス生成 */ if ($err_str === "") { try { $area = new Area($locomill->get_db4()); $temp = $area->get_data_array('area_master_01_tbl', false); foreach ($temp AS $v) $area_01_array[$v['id']] = array('name' => $v['name']); $temp = $area->get_data_array('area_master_03_tbl', false); foreach ($temp AS $v) $area_03_array[$v['id']] = array('name' => $v['name'], 'area_03_group_id' => $v['area_03_group_id']); $temp = $area->get_data_array('area_tbl', false); foreach ($temp AS $v) $area_04_array[$v['id']] = array('name' => $v['name']); $area_02_flag_array = $area->get_area_02_flag_array(); } catch (AreaError $e) { $err_str .= $e->get_exception(); } } /* Categoryクラスインスタンス生成 */ if ($err_str === "") { try { $category = new Category($locomill->get_db4()); $temp = $category->get_data_array(3, -1, true, true, 1); foreach ($temp AS $v) $category_03_array[$v['id']] = $v['name_01']; $temp = $category->get_data_array(2, -1, true, true, 3); foreach ($temp AS $v) $category_02_array[$v['id']] = $v['name_01']; } catch (CategoryError $e) { $err_str .= $e->get_exception(); } } /* Featureクラスインスタンス生成 */ if ($err_str === "") { try { $feature = new Feature($locomill->get_db4()); $feature->set_media_limit("PC"); } catch (FeatureError $e) { $err_str .= $e->get_exception(); } } /* Spotクラスインスタンス生成 */ if ($err_str === "") { try { $spot = new Spot($locomill->get_db4()); } catch (SpotError $e) { $err_str .= $e->get_exception(); } } /* Eventクラスインスタンス生成 */ if ($err_str === "") { try { $event = new Event($locomill->get_db4()); } catch (EventError $e) { $err_str .= $e->get_exception(); } } /* Hospitalクラスインスタンス生成 */ if ($err_str === "") { try { $hospital = new Hospital($locomill->get_db4()); } catch (HospitalError $e) { $err_str .= $e->get_exception(); } } /* HospitalCategoryクラスインスタンス生成 */ if ($err_str === "") { try { $hospital_category = new HospitalCategory($locomill->get_db4()); } catch (HospitalCategoryError $e) { $err_str .= $e->get_exception(); } } /* CmsCategoryクラスインスタンス生成 */ if ($err_str === "") { try { $cct = new CmsCategory($locomill->get_db4()); // カテゴリ大データ配列取得 $temp = $cct->get_data_array(1, -1, false, false); if (!empty($temp)) foreach ($temp AS $v) $cat_gparent_array[$v['id']] = $v; // カテゴリ中データ配列取得 $temp = $cct->get_data_array(2, -1, false, false); if (!empty($temp)) foreach ($temp AS $v) $cctp_array[$v['id']] = $v; // カテゴリ小データ配列取得 $temp = $cct->get_data_array(3, -1, false, false); if (!empty($temp)) foreach ($temp AS $v) $cct_array[$v['id']] = $v; } catch (CmsCategoryError $e) { $err_str .= $e->get_exception(); } } /* Kuchikomiクラスインスタンス生成 */ if ($err_str === "") { try { $kuchikomi = new Kuchikomi($locomill->get_db4()); } catch (KuchikomiError $e) { $err_str .= $e->get_exception(); } } /* Request値の検証 */ if ($err_str === "") { if (isset($_POST) === true && empty($_POST) === false) { $rq = $_POST; } elseif (isset($_GET) === true && empty($_GET) === false) { $rq = $_GET; } if ($is_ichiuma) { if (!empty($rq['t'])) { $theme_key = $rq['t']; } else { ErrorRedirect(404); } } elseif (isset($rq['id']) && $feature->check_id($rq['id'])) { $feature_id = $rq['id']; } else { ErrorRedirect(404); } } // 特集データ取得 if ($err_str === "") { $now = time(); try { if ($is_ichiuma) { $feature_data = $feature->get_data_by_theme($theme_key); $feature_id = $feature_data['id']; unset($theme_key); } else { $feature_data = $feature->get_data($feature_id); } } catch (FeatureError $e) { ErrorRedirect(404); } if ($page_is_enable && $feature_data['enable'] == 2) { ErrorRedirect(404); } elseif ($page_is_enable && strtotime($feature_data['close_stamp']) < $now) { $template_file = 'feature/common/error.tpl'; $err_str .= $feature_data['title_01'] . 'の掲載は終了しました。'; } elseif ($page_is_enable && $now < strtotime($feature_data['open_stamp'])) { $template_file = 'feature/common/error.tpl'; $err_str .= $feature_data['title_01'] . 'は、
' . "\n"; $err_str .= date('Y/m/d H:i', strtotime($feature_data['open_stamp'])) . '~' . date('Y/m/d H:i', strtotime($feature_data['close_stamp'])) . '
' . "\n"; $err_str .= 'の掲載となります。'; } // 一旨の場合、テーマがあれば専用ディレクトリへ if ($feature_data['type_id'] == 3 && !$is_ichiuma && !empty($feature_data['theme_key'])) { header("HTTP/1.1 301 Moved Permanently"); header('Location: /ichiuma/' . ($page_is_enable? '': 'index_pre.shtml') . '?t=' . $feature_data['theme_key']); exit; } } // 特集データ整形 if ($err_str === "") { try { if ($feature_data['is_login'] == 1 && $is_login != 1) { header("location: /login/?is_keep=1&rdr=/feature/list" . $pv_mode . ".shtml?id=" . $feature_id); exit; } $open_stamp = strtotime($feature_data['open_stamp']); $ssl_open_stamp = mktime(0, 0, 0, 9, 26, 2017); // SSLかけた日 $feature_data = $feature->feature_smarty_format($feature_data); if ($is_ichiuma) { $feature_data['page_url'] = sprintf('https://%s/ichiuma/?t=%s', LOCOMILL_DOMAIN_FQDN, $feature_data['theme_key']); } else { $feature_data['page_url'] = sprintf('%s://%s/feature/list.shtml?id=%d', ($open_stamp < $ssl_open_stamp? 'http':'https'), LOCOMILL_DOMAIN_FQDN, $feature_data['id']); $feature_data['canonical_url'] = sprintf('https://%s/feature/list.shtml?id=%d', LOCOMILL_DOMAIN_FQDN, $feature_data['id']); } } catch (FeatureError $e) { $err_str .= $e->get_exception(); } } // 他記事メニュー作成(左メニュー・前記事・次記事) if ($err_str === "") { try { if (LOCOMILL_HOSTNAME == 'www' && $feature_data['id'] == 885) { $temp = $feature->get_document_array($feature_id, ($page_is_enable? 1: 0), true, false); // ぐっときたクチコミ 記事が多すぎるため軽量化 } else { $temp = $feature->get_document_array($feature_id, ($page_is_enable? 1: 0)); } if (!empty($temp)) { foreach ($temp AS $did => $row) { // ブロックからスポット・イベント・病院IDを抜き出す $spot_id = $event_id = $hospital_id = array(); if (!empty($row['block'])) { foreach ($row['block'] as $k => $v) { if (!empty($v['spot_id'])) $spot_id[] = $v['spot_id']; if (!empty($v['event_id'])) $event_id[] = $v['event_id']; if (!empty($v['hospital_id'])) $hospital_id[] = $v['hospital_id']; } } // 基本情報 $doc = $feature->document_smarty_format($row); // 店舗データ $info_data = array(); if (!empty($row['shop_id']) || !empty($row['event_id']) || !empty($row['hospital_id']) || count($spot_id) == 1 || count($event_id) == 1 || count($hospital_id) == 1) { if (!empty($row['shop_id']) || count($spot_id) == 1) { try { if (!empty($row['shop_id'])) { $info_data = $spot->get_data($row['shop_id'], false, false); } else { $info_data = $spot->get_data($spot_id[0], false, false); } } catch (SpotError $e) { throw new FeatureError('info_spot' . $row['shop_id'] . $e->get_exception()); } if (!empty($info_data) && ($info_data['enable'] == 1 || $page_is_enable === false)) { $doc['spot_type'] = 'SPOT'; $doc['is_closed'] = $info_data['is_closed']; $doc['close_reason'] = $info_data['close_reason']; $doc['shop_category_name'] = $category_03_array[$info_data['category_01_03_id']]; } else { continue; } } elseif (!empty($row['event_id']) || count($event_id) == 1) { try { if (!empty($row['event_id'])) { $info_data = $event->get_data($row['event_id'], false); } else { $info_data = $event->get_data($event_id[0], false); } } catch (EventError $e) { throw new FeatureError('info_event' . $row['event_id'] . $e->get_exception()); } if (!empty($info_data) && ($info_data['enable'] == 1 || $page_is_enable === false)) { $doc['spot_type'] = 'EVENT'; $doc['is_closed'] = 0; $doc['close_reason'] = ''; $doc['shop_category_name'] = $category_02_array[$info_data['category_01_02_id']]; } else { continue; } } elseif (!empty($row['hospital_id']) || count($hospital_id) == 1) { try { if (!empty($row['hospital_id'])) { $info_data = $hospital->get_data($row['hospital_id'], false); } else { $info_data = $hospital->get_data($hospital_id[0], false); } } catch (HospitalError $e) { throw new FeatureError('info_hospital' . $row['hospital_id'] . $e->get_exception()); } if (!empty($info_data) && ($info_data['enable'] == 1 || $page_is_enable === false)) { $doc['spot_type'] = 'HOSPITAL'; $doc['is_closed'] = 0; $doc['close_reason'] = ''; $doc['shop_category_name'] = ''; $cat_id = array_values(array_diff(explode('_', $info_data['category_main_id']), array(''))); if (!empty($cat_id[0])) { $doc['shop_category_name'] = $hospital_category->get_name($cat_id[0]); } unset($cat_id); } else { continue; } } $doc['shop_id'] = $info_data['id']; $doc['shop_name'] = $info_data['name_01']; $doc['prefect_name'] = $area_01_array[$info_data['area_01_id']]['name']; $doc['town_name'] = $area_03_array[$info_data['area_03_id']]['name']; $doc['local_name'] = $area_04_array[$info_data['area_id']]['name']; $doc['prefect_area_id'] = $area_03_array[$info_data['area_03_id']]['area_03_group_id']; $doc['prefect_area_name'] = $area_02_flag_array[$doc['prefect_area_id']]; } unset($info_data); if (!$is_ichiuma) { $doc['search_01_id'] = $row['search_01']; $doc['search_01_name'] = (!empty($row['search_01']))? $cct_array[$row['search_01']]['name_01']: ''; $doc['search_02_id'] = $row['search_02']; $doc['search_02_name'] = (!empty($row['search_02']))? $cct_array[$row['search_02']]['name_01']: ''; $doc['search_03_id'] = $row['search_03']; $doc['search_03_name'] = (!empty($row['search_03']))? $cct_array[$row['search_03']]['name_01']: ''; } $doc_array[$did] = $doc; } } else { $err_str .= "・記事が登録されていません。"; } unset($temp, $did, $row, $doc, $spot_id, $event_id, $hospital_id); } catch (FeatureError $e) { $err_str .= $e->get_exception(); } } /* 変数の準備 */ // 特集基本データ $smarty->assign("CURRENT_FEATURE_DATA", $feature_data); // 特集の最新記事取得 $latest_array = array(); if ($err_str === "" && !$is_ichiuma) { try { $temp = $feature->get_latest_feature_document($feature_id, 5); foreach ($temp AS $did => $ddata) { if (!empty($doc_array[$did])) { $doc_array[$did]['state'] = ''; if (time() - strtotime($ddata['public_date']) < (86400)) { $doc_array[$did]['state'] = 'NEW'; } elseif (time() - $ddata['update_stamp'] < (86400)) { $doc_array[$did]['state'] = 'UP'; } $latest_array[$did] = $doc_array[$did]; } } } catch (FeatureError $e) { $err_str .= $e->get_exception(); } } $smarty->assign("LOCAL_LATEST_DOCUMENT_LIST", $latest_array); unset($latest_array); // 全体の最新記事取得 $latest_array = array(); if ($err_str === "") { try { $temp = $feature->get_latest_document(4); foreach ($temp AS $row) { // 基本情報 $doc = $feature->document_smarty_format($row); $doc['feature_title_01'] = $row['feature_title_01']; if (!empty($doc['theme_key'])) { $doc['link'] = '/ichiuma/?t=' . $doc['theme_key'] . '&d=' . date('j', strtotime($doc['public_date_origin'])); } else { $doc['link'] = '/feature/home.shtml?id=' . $doc['id']; } // 店舗データ $info_data = array(); if (!empty($row['shop_id']) || !empty($row['event_id']) || !empty($row['hospital_id'])) { if (!empty($row['shop_id'])) { try { $info_data = $spot->get_data($row['shop_id'], false, false); } catch (SpotError $e) { throw new FeatureError('info_spot' . $row['shop_id'] . $e->get_exception()); } if (!empty($info_data) && ($info_data['enable'] == 1 || $page_is_enable === false)) { $doc['spot_type'] = 'SPOT'; } else { continue; } } elseif (!empty($row['event_id'])) { try { $info_data = $event->get_data($row['event_id'], false); } catch (EventError $e) { throw new FeatureError('info_event' . $row['event_id'] . $e->get_exception()); } if (!empty($info_data) && ($info_data['enable'] == 1 || $page_is_enable === false)) { $doc['spot_type'] = 'EVENT'; } else { continue; } } elseif (!empty($row['hospital_id'])) { try { $info_data = $hospital->get_data($row['hospital_id'], false); } catch (HospitalError $e) { throw new FeatureError('info_hospital' . $row['hospital_id'] . $e->get_exception()); } if (!empty($info_data) && ($info_data['enable'] == 1 || $page_is_enable === false)) { $doc['spot_type'] = 'HOSPITAL'; } else { continue; } } } unset($info_data); $latest_array[$row['id']] = $doc; } } catch (FeatureError $e) { $err_str .= $e->get_exception(); } } $smarty->assign("GLOBAL_LATEST_DOCUMENT_LIST", $latest_array); unset($latest_array); // 関連特集取得 $tag_feature_array = array(); if ($err_str === "") { try { $tags = array_diff(explode(',', $feature_data['tag']), array('')); if (!empty($tags)) { $type_conf = 0; $enable_conf = 1; $tag_feature_array = $feature->get_tags_features($tags, $type_conf, $enable_conf, $feature_id); } } catch (FeatureError $e) { $err_str .= $e->get_exception(); } } $smarty->assign("RELATED_FEATURE_LIST", $tag_feature_array); unset($tag_feature_array); // 特集タイプ別処理 if ($err_str === "") { if ($is_ichiuma) { $template_file = 'ichiuma/list.tpl'; } else { $template_file = 'feature/list.tpl'; } switch ($feature_data['type_id']) { case 1: // 大特集 $sea_array = $feature->get_search_array($feature_id); $smarty->assign("SEARCH_LIST", $sea_array); if ($feature_data['is_area_search_02'] == 1) { $area2_array = $feature->get_area_array($feature_id, 2); $smarty->assign("AREA_02_LIST", $area2_array); } if ($feature_data['is_area_search_01'] == 1 || $feature_data['is_area_search_03'] == 1) { $area3_array = $feature->get_area_array($feature_id, 3); $smarty->assign("AREA_03_LIST", $area3_array); } if ($feature_data['is_area_search_01'] == 1) { $area1_array = array(); if (!empty($area3_array)) { foreach ($area3_array AS $k => $v) { if (!isset($area1_array[$v['area_03_group_id']])) { $area1_array[$temp['id']] = array('id' => $v['area_03_group_id'], 'name' => $area_02_flag_array[$v['area_03_group_id']]); } } ksort($area1_array); } $smarty->assign("AREA_01_LIST", $area1_array); } // ピックアップ対象一覧 $pickup_id_array = array(); $pic_list = array(); if (!empty($doc_array)) { foreach ($doc_array AS $did => $row) { if ($row['pickup'] == 1 && $row['pickup_start_stamp'] <= date('Y-m-d H:i:s') && date('Y-m-d H:i:s') <= $row['pickup_end_stamp']) { $pickup_id_array[] = $row['id']; } } if (!empty($pickup_id_array)) { if ($feature_data['pickup_type'] == 1) { // ランダム $t = $pickup_id_array[array_rand($pickup_id_array)]; $pic_list[$t] = $doc_array[$t]; } elseif ($feature_data['pickup_type'] == 2) { // 固定(全て foreach ($pickup_id_array AS $t) { $pic_list[$t] = $doc_array[$t]; } } } } $smarty->assign("PICKUP_DOCUMENT_LIST", $pic_list); break; case 2: // 小特集 $area_doc_array = array(); $sea_doc_array = array(); $sea_sort1 = array(); $sea_sort2 = array(); $pickup_id_array = array(); $pic_list = array(); if (!empty($doc_array)) { foreach ($doc_array AS $did => $row) { // ピックアップ対象一覧 if ($row['pickup'] == 1) { $pickup_id_array[] = $row['id']; } // エリア別一覧を生成 if (!isset($area_doc_array[$row['prefect_area_id']])) { $area_doc_array[$row['prefect_area_id']] = array('name' => $row['prefect_area_name'], 'doc' => array()); } $area_doc_array[$row['prefect_area_id']]['doc'][] = $row; // サーチ別一覧を生成 for ($i = 1; $i <= 5; $i++) { if (!empty($cct_array[$row[sprintf('search_%02d', $i)]])) { $cc = $cct_array[$row[sprintf('search_%02d', $i)]]; $ccp = $cctp_array[$cc['parent_id']]; if (!isset($sea_doc_array[$cc['parent_id']])) { $sea_doc_array[$cc['parent_id']] = array('id' => $ccp['id'], 'name' => $ccp['name_01'], 'child' => array()); $sea_sort2[$cc['parent_id']] = $ccp['sort']; $sea_sort1[$cc['parent_id']] = $cat_gparent_array[$ccp['parent_id']]['sort']; } $sea_doc_array[$cc['parent_id']]['child'][$row['id']] = $row; } } } ksort($area_doc_array); array_multisort($sea_sort1, SORT_NUMERIC, $sea_sort2, SORT_NUMERIC, $sea_doc_array); // ピックアップ if (!empty($pickup_id_array)) { if ($feature_data['pickup_type'] == 1) { // ランダム $t = $pickup_id_array[array_rand($pickup_id_array)]; $pic_list[$t] = $doc_array[$t]; } elseif ($feature_data['pickup_type'] == 2) { // 固定(全て foreach ($pickup_id_array AS $t) { $pic_list[$t] = $doc_array[$t]; } } } } $smarty->assign("AREA_DOCUMENT_LIST", $area_doc_array); $smarty->assign("SEARCH_DOCUMENT_LIST", $sea_doc_array); $smarty->assign("PICKUP_DOCUMENT_LIST", $pic_list); break; case 3: // デイリー if ($is_ichiuma) { // 特集月日 $wk = array('日', '月', '火', '水', '木', '金', '土', '日'); $mkt = strtotime($feature_data['public_date_origin']); list($yy, $mm, $dd, $ww, $tt) = explode('-', date('Y-m-d-w-t', $mkt)); $smarty->assign("FEATURE_YEAR", $yy); $smarty->assign("FEATURE_MONTH", $mm); // 祝日取得 try { $holiday = new Holiday($locomill->get_db4()); $holiday_array = $holiday->get_term_holiday(date('Y-m-1', $mkt), date('Y-m-t', $mkt), 1); } catch (HolidayError $e) { $err_str .= $e->get_exception(); } // 記事一覧カレンダー生成 $ichiuma_latest_doc = $ichiuma_doc_list = $ichiuma_title_doc = array(); for ($i = $tt; $i >= 1; $i--) { $w = date('w', mktime(0, 0, 0, $mm, $i, $yy)); $dd = sprintf('%04d/%02d/%02d', $yy, $mm, $i); $ddh = sprintf('%04d-%02d-%02d', $yy, $mm, $i); if ((empty($holiday_array[$ddh]) && 0 < $w && $w < 6) || sprintf('%02d-%02d', $mm, $i) == '01-01') { $dobj = array(); if (!empty($doc_array)) { foreach ($doc_array AS $did => $ddata) { if ($ddata['public_date'] == $dd) { $dobj = $ddata; break; } } } if (!empty($dobj)) { $dobj['link'] = sprintf('/ichiuma/%s?t=%s&d=%d', $pv_url, $feature_data['theme_key'], date('j', strtotime($dobj['public_date_origin']))); $dobj['public_date_str2'] = sprintf('%s(%s)', date('n月j日', strtotime($dobj['public_date_origin'])), $wk[date('w', strtotime($dobj['public_date_origin']))]); $dobj['kuchikomi_str'] = ''; if (!empty($dobj['shop_id']) && ($yy != date('Y') || $mm != date('m'))) { $sql = $kuchikomi->get_id_query(1, $dobj['shop_id'], true, array('is_comment' => 1, 'limit' => 1)); $result = $locomill->get_db3()->query($sql); if ($result !== false) { $kuchikomi_num = $locomill->get_db3()->num($result); if ($kuchikomi_num > 0) { $row = $locomill->get_db3()->fetch_array($result); $temp = $kuchikomi->adjust($row['id'], $login_user_id); $dobj['kuchikomi_str'] = $temp['COMMENT']; } } } if ($dobj['is_image_01'] == 1) { $ichiuma_title_doc = $dobj; } if (empty($ichiuma_latest_doc) && $yy == date('Y') && $mm == date('m')) { $ichiuma_latest_doc = $dobj; } else { $ichiuma_doc_list[$did] = $dobj; } } } } $smarty->assign("ICHIUMA_LATEST_DOCUMENT", $ichiuma_latest_doc); $smarty->assign("ICHIUMA_DOCUMENT_LIST", $ichiuma_doc_list); $smarty->assign("ICHIUMA_TITLE_DOC", $ichiuma_title_doc); unset($doc_array); // 関連ID取得 try { $daily_links = $feature->get_daily_theme_links(0, $feature_id, true, ($page_is_enable? true: false)); } catch (FeatureError $e) { $daily_links = array(); } if (!empty($daily_links['month'])) { foreach ($daily_links['month'] AS $k => $v) { $temp = $feature->get_document($v['first'], 0, true, false); $temp = $feature->document_smarty_format($temp); $daily_links['month'][$k]['image_01_src'] = $temp['image_01_src']; } unset($temp); } $smarty->assign("DAILY_LINK_DATA", $daily_links); } else { $ddata = $feature->get_last_date_doc($feature_id); // 最新の記事へリダイレクト if (!empty($doc_array)) { header("location: home" . $pv_mode . ".shtml?id=" . $ddata['id']); exit; } } break; case 4: // マンスリー // 公開年度 $smarty->assign("FEATURE_YEAR", date('Y', strtotime($feature_data['public_date_origin']))); // マンスリーコンフィグデータ取得 $temp = $feature->get_extra_conf($feature_id); $extra_conf = array(); if (!empty($temp)) { for ($i = 1; $i <= 12; $i++) { $extra_conf['month'][$i]['caption'] = $temp[sprintf('caption_%02d_01', $i)]; } for ($i = 1; $i <= 3; $i++) { if (!empty($temp[sprintf('image_01_%02d', $i)]['up_name'])) { $extra_conf[sprintf('is_image_%02d', $i)] = 1; $extra_conf[sprintf('image_%02d_src', $i)] = '/img' . LOCOMILL_UPIMG_FEATURE_EXTRA_PATH . '/' . $temp[sprintf('image_01_%02d', $i)]['up_name']; } else { $extra_conf[sprintf('is_image_%02d', $i)] = 0; $extra_conf[sprintf('image_%02d_src', $i)] = ''; } } // 次の記事 $extra_conf['next_feature_id'] = ''; $extra_conf['next_feature_year'] = ''; if (!empty($temp['next_feature_id'])) { try { $ndata = $feature->get_data($temp['next_feature_id'], 4, ($page_is_enable? 1: 0)); } catch (FeatureError $e) { $ndata = array(); } if (!empty($ndata)) { $extra_conf['next_feature_id'] = $ndata['id']; $extra_conf['next_feature_year'] = date('Y', strtotime($ndata['public_date'])); } } // 前の記事 $extra_conf['prev_feature_id'] = ''; $extra_conf['prev_feature_year'] = ''; if (!empty($temp['prev_feature_id'])) { try { $ndata = $feature->get_data($temp['prev_feature_id'], 4, ($page_is_enable? 1: 0)); } catch (FeatureError $e) { $ndata = array(); } if (!empty($ndata)) { $extra_conf['prev_feature_id'] = $ndata['id']; $extra_conf['prev_feature_year'] = date('Y', strtotime($ndata['public_date'])); } } } $smarty->assign("EXTRA_CONFIG", $extra_conf); // 記事一覧を月別振り分け $month_doc_array = array(); if (!empty($doc_array)) { foreach ($doc_array AS $did => $ddata) { $ind = date('n', strtotime($ddata['public_date'])); $month_doc_array[$ind][$did] = $ddata; } } krsort($month_doc_array); $smarty->assign("MONTHLY_DOCUMENT_LIST", $month_doc_array); break; case 5: // タイアップ // ピックアップ対象一覧 $smarty->assign("PICKUP_DOCUMENT_LIST", $doc_array); break; default: // 判別不可 $template_file = 'feature/common/error.tpl'; $err_str .= "・不明な特集です。"; break; } } // カスタムテンプレートファイルの適用 if (!empty($feature_data['template_file'])) { $template_file = 'feature/custom/' . $feature_data['template_file']; } // プレビューモード用GET値 $smarty->assign("PV_MODE_GET_VALUE", (($page_is_enable)? 0: 1)); $smarty->assign("PV_MODE", $pv_mode); $smarty->assign("PV_URL", $pv_url); $smarty->assign("PREVIEW", $preview); // イマココ $imakoko = getTopicsPath('feature'); if ($err_str === "") { if ($is_ichiuma) { $imakoko[] = array(sprintf('/ichiuma/?t=%s', $feature_data['theme_key']), mb_strimwidth(strip_tags($feature_data['title_01']), 0, 30, '…')); } else { $imakoko[] = array(sprintf('/feature/list.shtml?id=%d', $feature_data['id']), mb_strimwidth(strip_tags($feature_data['title_01']), 0, 30, '…')); } } $smarty->assign("IMAKOKO_ARRAY", $imakoko); // 最新情報 include('common/whatsnew.inc'); /* AccessDailyクラスインスタンス生成 */ if ($err_str === "" && $page_is_enable) { try { $access = new AccessDaily($locomill->get_db()); $params = array("corner_type" => 3, "terminal" => 1, "corner_id" => $feature_data['id'], "page" => $_SERVER['PHP_SELF'], "title" => "特集情報:" . $feature_data['title_01'], "refer_url" => (isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER']: ''), "refer_name" => "", "keyword" => "", "file_name" => $_SERVER['REQUEST_URI'], "member_data" => (isset($locomill->session->sess_data['member_data'])? $locomill->session->sess_data['member_data']: array())); $access->do_logging($params); } catch (AccessDailyError $e) { $access->output_error($e->get_exception()); } } /* 広告系 */ switch ($feature_data['type_id']) { case 1: $the_corner_id = 1; break; // 大特集 case 2: $the_corner_id = 2; break; // 小特集 case 3: $the_corner_id = 3; break; // デイリー特集 case 4: $the_corner_id = 4; break; // マンスリー特集 case 5: $the_corner_id = 0; break; // タイアップ特集 // IDがない default: $the_corner_id = 27; break; // 判別不能 } $adver_param = array("terminal_type" => 1, "corner_id" => $the_corner_id, "feature_id" => $feature_id); $adver_b_type = ($feature_data['type_id'] == 5)? array(1, 7): array(1, 2, 7); include('common/banners.inc'); // エラー文字列 $smarty->assign("ERR_STR", $err_str); if (!empty($err_str)) { header("HTTP/1.0 404 Not Found"); } // Smarty Cache if ($err_str === "" && $page_is_enable) { // $smarty = getSmartyCache($smarty); } /* 出力 */ $smarty->display($template_file, getSmartyCacheId(array($feature_id)));