getDb();
mysql_query("SET NAMES utf8");
$app = set_app_config();
$smarty->assign("app", $app);
// フォームデータの変換
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$param = cnv_formstr($_POST);
} else {
$param = cnv_formstr($_GET);
}
$now=mktime();
//新着1週間
$time=604800 ;
$sql="select * from sb_newslist where id ='$param[id]'";
$rs=mysql_query($sql);
$row=mysql_fetch_array($rs);
//一週間のチェック
if(($row["indate"] + $time ) > $now){
$row["mark"] ="NEW";
}
$newsdata=$row;
$smarty->assign("newsdata", $newsdata);
$sql="select * from sb_newslist where category like '%surf%' order by indate desc";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
mb_language("Japanese");
$str = $row["title"];
$row["title"] = mb_substr($str,0,14,'UTF-8');
//一週間のチェック
if(($row["indate"] + $time ) > $now){
$row["mark"] ="NEW";
}
$list_surf[]=$row;
}
$smarty->assign("list_surf", $list_surf);
$sql="select * from sb_newslist where category like '%sup%' order by indate desc";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
mb_language("Japanese");
$str = $row["title"];
$row["title"] = mb_substr($str,0,14,'UTF-8');
//一週間のチェック
if(($row["indate"] + $time ) > $now){
$row["mark"] ="NEW";
}
$list_sup[]=$row;
}
$smarty->assign("list_sup", $list_sup);
$sql="select * from sb_newslist where category like '%wind%' order by indate desc";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
mb_language("Japanese");
$str = $row["title"];
$row["title"] = mb_substr($str,0,14,'UTF-8');
//一週間のチェック
if(($row["indate"] + $time ) > $now){
$row["mark"] ="NEW";
}
$list_wind[]=$row;
}
$smarty->assign("list_wind", $list_wind);
$sql="select * from sb_newslist where category like '%apparel%' order by indate desc";
$rs=mysql_query($sql);
while($row=mysql_fetch_array($rs)){
mb_language("Japanese");
$str = $row["title"];
$row["title"] = mb_substr($str,0,14,'UTF-8');
//一週間のチェック
if(($row["indate"] + $time ) > $now){
$row["mark"] ="NEW";
}
$list_apparel[]=$row;
}
$smarty->assign("list_apparel", $list_apparel);
$newsurl="/newsdetail.html?id=$param[id]";
$smarty->assign("news_url", $newsurl);
// テンプレートを表示
$smarty->display("news_detail.tpl");
?>