assign('imgnewspath', $dir); $query = "select log_no, title, body, "; $query .= "date_format(view_date,'%Y/%m/%d') as view_date2 "; $query .= "from news "; $query .= "where del_flg = 0 "; $query .= "and hyoji_flg = 1 "; $query .= "and log_no = 1 "; //1:新着情報 $query .= "and date_format(view_start_date,'%Y/%m/%d %H:%m:%s') <= '".NOW_DATE."' "; $query .= "and date_format(view_end_date,'%Y/%m/%d %H:%m:%s') >= '".NOW_DATE."' "; $query .= "order by view_date DESC "; $query .= "limit 10 "; $rs = mysql_query($query,$db); $news = array(); while( $row = mysql_fetch_assoc( $rs ) ){ $news[$row['data_no']] = $row; //本文変換 $news[$row['data_no']]['body2'] = mb_substr(strip_tags($row['body']),0,60,'EUC-JP'); if( mb_strlen( $row['body'],'UTF-8' ) > 60 ){ $news[$row['data_no']]['body2'] .= '…'; } //画像 $file_s = $row['log_no']."_".$row['data_no']."_1.jpg"; $file2_s = $row['log_no']."_".$row['data_no']."_1.gif"; if( file_exists( $dir.$file_s ) ){ $news[$row['data_no']]['img_small'] = $file_s; } elseif( file_exists( $dir.$file2_s ) ){ $news[$row['data_no']]['img_small'] = $file2_s; } else{ $news[$row['data_no']]['img_small'] = ''; } } $smarty->assign('news', $news); /* //---- 大バナー表示 ---- $imagepath = IMG_BANNER_DIR; $dir = ''.$imagepath; $smarty->assign('imgbannerpath', $dir); $query = "select log_no, data_no, title, jump_url "; $query .= "from banner "; $query .= "where del_flg = 0 "; $query .= "and hyoji_flg = 1 "; $query .= "and log_no = 1 "; //1:大バナー $query .= "and date_format(view_start_date,'%Y/%m/%d %H:%m:%s') <= '".NOW_DATE."' "; $query .= "and date_format(view_end_date,'%Y/%m/%d %H:%m:%s') >= '".NOW_DATE."' "; $query .= "order by view_start_date desc, data_no desc "; $query .= "limit 10 "; $rs = mysql_query($query,$db); $banner = array(); while( $row = mysql_fetch_assoc( $rs ) ){ $banner[$row['data_no']] = $row; //画像 $file_s = $row['log_no']."_".$row['data_no'].".jpg"; $file2_s = $row['log_no']."_".$row['data_no'].".gif"; $file3_s = $row['log_no']."_".$row['data_no'].".png"; if( file_exists( $dir.$file_s ) ){ $banner[$row['data_no']]['img_small'] = $file_s; } elseif( file_exists( $dir.$file2_s ) ){ $banner[$row['data_no']]['img_small'] = $file2_s; } elseif( file_exists( $dir.$file3_s ) ){ $banner[$row['data_no']]['img_small'] = $file3_s; } else{ $banner[$row['data_no']]['img_small'] = ''; } } $smarty->assign('banner', $banner); //---- 小バナー表示 ---- $imagepath = IMG_BANNER_DIR; $dir = ''.$imagepath; $smarty->assign('imgbannerpath', $dir); $query = "select log_no, data_no, title, jump_url "; $query .= "from banner "; $query .= "where del_flg = 0 "; $query .= "and hyoji_flg = 1 "; $query .= "and log_no = 2 "; //1:小バナー $query .= "and date_format(view_start_date,'%Y/%m/%d %H:%m:%s') <= '".NOW_DATE."' "; $query .= "and date_format(view_end_date,'%Y/%m/%d %H:%m:%s') >= '".NOW_DATE."' "; $query .= "order by view_start_date desc, data_no desc "; $query .= "limit 10 "; $rs = mysql_query($query,$db); $banner2 = array(); while( $row = mysql_fetch_assoc( $rs ) ){ $banner2[$row['data_no']] = $row; //画像 $file_s = $row['log_no']."_".$row['data_no'].".jpg"; $file2_s = $row['log_no']."_".$row['data_no'].".gif"; $file3_s = $row['log_no']."_".$row['data_no'].".png"; if( file_exists( $dir.$file_s ) ){ $banner2[$row['data_no']]['img_small'] = $file_s; } elseif( file_exists( $dir.$file2_s ) ){ $banner2[$row['data_no']]['img_small'] = $file2_s; } elseif( file_exists( $dir.$file3_s ) ){ $banner2[$row['data_no']]['img_small'] = $file3_s; } else{ $banner2[$row['data_no']]['img_small'] = ''; } } $smarty->assign('banner2', $banner2); */ /* //---- XMLファイルを更新 ---- $limit = 10; //最新10件 $rs =mysql_query("SET NAMES utf8",$db); $query = "select "; $query .= "b.title as space_title, "; $query .= "a.log_no, a.data_no, a.title, "; $query .= "a.body1,a.body2,a.body3,a.body4,a.body5,a.body6,a.body7,a.body8,a.body9,a.body10, "; $query .= "date_format(a.view_start_date,'%Y/%m/%d %H:%i') as view_start_date, "; $query .= "date_format(a.view_end_date,'%Y/%m/%d %H:%i') as view_end_date, "; $query .= "a.view_date as view_date2, "; $query .= "a.order_no, a.hyoji_flg "; $query .= "from news a inner join news_category b "; $query .= "on a.log_no = b.log_no "; $query .= "where a.del_flg = 0 "; $query .= "and b.del_flg = 0 "; $query .= "and a.view_start_date <= '".NOW_DATE."' "; $query .= "and a.view_end_date >= '".NOW_DATE."' "; $query .= "order by a.order_no desc "; $query .= " limit ". $limit ." "; $rs = mysql_query($query,$db); $cnt = 0; while( $row = mysql_fetch_assoc( $rs ) ){ $news[$cnt] = $row; //画像存在チェック $upload_data = array(); $imagepath = IMG_NEWS_DIR; $dir = '../'.$imagepath; for( $m=1; $m<=10; $m++ ){ if( file_exists( $dir.$row['log_no'].'_'.$row['data_no'].'_'.$m.'.jpg' ) ){ $upload_data[$m] = $row['log_no'].'_'.$row['data_no'].'_'.$m.'.jpg'; } } $news[$cnt]['img'] = $upload_data; $cnt++; } $smarty->assign('news', $news); //FLASH呼び出し用XML $output = $smarty->fetch('news_data_tpl.xml'); $f = fopen('../news_data.xml','w'); fwrite($f,$output,strlen($output)); fclose($f); //ローカル動作用XML $output = $smarty->fetch('news_fulldata_tpl.xml'); $f = fopen('../news_fulldata.xml','w'); fwrite($f,$output,strlen($output)); fclose($f); //RSS用XML $output = $smarty->fetch('news_rss_tpl.xml'); $f = fopen('../news_rss.xml','w'); fwrite($f,$output,strlen($output)); fclose($f); */ } //----- 実績ページ ----- elseif( $path == 'mobile.html' || $path == 'web.html' || $path == 'mobileweb.html' || $path == 'stage.html' || $path == 'package.html' || $path == 'mobile_pre.html' || $path == 'web_pre.html' || $path == 'mobileweb_pre.html' || $path == 'stage_pre.html' || $path == 'package_pre.html' ){ //実績表示 $imagepath = IMG_PROJECT_DIR; $dir = ''.$imagepath; $smarty->assign('imgpath', $dir); $query = "select log_no, data_no, title, cliant, tag, body, jump_url "; $query .= "from project "; $query .= "where del_flg = 0 "; $query .= "and hyoji_flg = 1 "; switch ($path) { case 'mobile.html': $query .= "and log_no = 1 "; //1:モバイル break; case 'web.html': $query .= "and log_no = 2 "; //2:WEB break; case 'mobileweb.html': $query .= "and log_no = 5 "; //5:iPhoneホームページ break; case 'stage.html': $query .= "and log_no = 3 "; //3:舞台 break; case 'package.html': $query .= "and log_no = 4 "; //4:パッケージ break; } $query .= "and date_format(view_start_date,'%Y/%m/%d %H:%m:%s') <= '".NOW_DATE."' "; $query .= "and date_format(view_end_date,'%Y/%m/%d %H:%m:%s') >= '".NOW_DATE."' "; $query .= "order by order_no desc "; $rs = mysql_query($query,$db); $project = array(); while( $row = mysql_fetch_assoc( $rs ) ){ $project[$row['data_no']] = $row; //画像 $upload_data = array(); if($dh = opendir($dir)){ while(($file = readdir($dh)) !== false) { $tmp_arr = explode('.',$file); $file_no_arr = explode('_',$tmp_arr[0]); if( !strstr( $row['body'], $file ) && $file_no_arr[0] == $row['log_no'] && $file_no_arr[1] == $row['data_no'] ){ $upload_data[$file_no_arr[2]]['big'] = $file; } } closedir($dh); } //キーの昇順でソート ksort($upload_data); $project[$row['data_no']]['img'] = $upload_data; } $smarty->assign('project', $project); } //----- 画面表示 ----- if( $smarty->template_exists($path) ){ $smarty->display($path); }else{ /* header("HTTP/1.1 404 Not Found"); print("
HTTP 404 - Not Found