db = cs4_open(); // テンプレート読み込み $template =& loadTemplate( $p ); if(strlen($reject) <= 0 && strlen($show) <= 0){ //- 今日のおかず取得 $okazu_arr = get_csvdata("okazu"); $okazu_list = get_rcpList($this->db, $okazu_arr); //現在時刻を取得 $today = getdate(); $hours = $today[hours]; //22:00以降は翌日のレシピを表示するための処理 if($hours >= 22){ $okazu_list['today'] = $okazu_list['tomorrow']; } $template->setCurrentBlock('__Title__'); if($user_flg == 1){ $template->setVariable('title',"糧無料おすすめレシピ糧"); }else{ $template->setVariable('title',"●おすすめレシピ秊"); } $template->parseCurrentBlock(); //- okazu if(!empty($okazu_list['today'])){ for($i=0;$isetCurrentBlock('__ImageLinkMain'.$i.'__'); $template->setVariable('image'.$i, $okazu_list['today'][$i]['uniq_id']); $template->parseCurrentBlock(); }else{ $template->hideBlock('__ImageLinkMain__'); } $template->setCurrentBlock('__List'.$i.'__'); $template->setVariable('phrase'.$i, $okazu_list['today'][$i]['rcp_exp']); $template->setVariable('rcp_no'.$i, $okazu_list['today'][$i]['uniq_id']); $template->setVariable('rcp_nm'.$i, $okazu_list['today'][$i]['rcp_nm']); $template->parseCurrentBlock(); } } }else{ // 出力したい時間を指定 $time = array("", "hurry", "normal", "slowly"); //DB開放 cs4_close($this->db); //リスト取得 for($q=0; $qsetCurrentBlock('__ImageLinkMain'.$q.'__'); $template->setVariable('image'.$q, $myrecipe_list['main'][$main_index]['rcp_no']); $template->setVariable('phrase'.$q, $myrecipe_list['main'][$main_index]['rcp_exp']); $template->parseCurrentBlock(); } } $template->setCurrentBlock('__List'.$q.'__'); $template->setVariable('phrase'.$q, $myrecipe_list['main'][$main_index]['rcp_exp']); $template->setVariable('rcp_no'.$q, $myrecipe_list['main'][$main_index]['rcp_no']); $template->setVariable('rcp_nm'.$q, $myrecipe_list['main'][$main_index]['rcp_nm']); $template->parseCurrentBlock(); }else{ $template->hideBlock('__Main__'); $template->TouchBlock('__NoMain'.$q.'__'); } } $p['rcp_no'] = ""; //- データ変更用hiddenパラメータセット foreach($terms_arr as $tmp_key => $tmp_val){ foreach($terms_arr[$tmp_key] as $key => $val){ if(1 == $user_data[0][$key]){ $template->setCurrentBlock('__HiddenParam__'); $template->setVariable('name',$key); $template->parseCurrentBlock(); } } } } $template->setCurrentBlock('__SHOW__'); $template->setVariable('show',$show); $template->parseCurrentBlock(); $template->setCurrentBlock('__REJECT__'); $template->setVariable('reject',$reject); $template->parseCurrentBlock(); $template->show(); } okazu_top_new( $p , $user_data); ?>