'ホーム' ); $alert = ""; // アラートメッセージ $hierarchical = "./"; $cont = "top"; global $_Setting; global $_Action; ###################################################### /** * データベース接続 */ ###################################################### if (dbConnect() === false){ $msg = "データベース接続エラー"; writeLog(C_LOG_ERROR, __FILE__, __LINE__, $msg); $act = ACTION_ERROR; } ###################################################### /** * 初期処理 */ ###################################################### $Smarty = new MySmarty(); ###################################################### /** * 新着情報(一覧)の取得 */ ###################################################### $Smarty->assign("infomations",F_InfoList()); ###################################################### /** * 新着情報の最新の日付を取得 */ ###################################################### $Smarty->assign("new_info_date",F_NewInfoDate()); ###################################################### /** * Smartyの共通処理 */ ###################################################### require_once 'func/output_smarty.php'; // テンプレートファイル $Smarty->assign("actionTpl","top/detail.tpl"); $Smarty->display(BASE_TEMPLATE); /* * 新着情報一覧の取得 */ function F_InfoList(){ $sql = "SELECT * FROM infomations WHERE status = 1 ORDER BY view_date DESC"; $info = F_GetList($sql,""); return $info['list']; } /* * 最新のインフォメーション情報を取得 */ function F_NewInfoDate(){ $sql = "SELECT view_date FROM infomations"; $sql .= " WHERE view_date = (SELECT MAX(view_date) FROM infomations)"; $sql .= " AND status = 1"; $date = dbGetFields($sql, 'view_date'); return $date['view_date']; } ?>