THE WELBECK GALLERY

CONTROLHOMETHE WELBECK GALLERYDIARYPRODUCTSSHOPPINGMAPCONTACT



'; $calendar = new calendar($year,$month,$date); print $calendar->make_calendar(); print '

最近のTWG PHOTO

'; $sql = "SELECT bl_id,bl_date FROM blog ORDER BY bl_date DESC"; $result = $db->query($sql); $c = 0; while($row = $result->fetchrow()) { $bl_id = $row[0]; $bl_date = $row[1]; $dy = substr($bl_date,0,4); $dm = substr($bl_date,4,2); $dd = substr($bl_date,6,2); $imagefile = "blog_img/".$bl_id.".jpg"; if (file_exists($imagefile)) { $size = GetImageSize($imagefile); $width = $size[0]; $height = $size[1]; if ($width > 180) { $height = (int)(180 / $width * $height); $width = 180; } $d = date("w" , mktime(0,0,0,$dm,$dd,$dy)); if ($d == "0") { $dk = "日"; } if ($d == "1") { $dk = "月"; } if ($d == "2") { $dk = "火"; } if ($d == "3") { $dk = "水"; } if ($d == "4") { $dk = "木"; } if ($d == "5") { $dk = "金"; } if ($d == "6") { $dk = "土"; } $date = $dm."月".$dd."日(".$dk.")"; print '
'.$date.'


'; $c ++; } if ($c == 3) { break; } } print '
DIARY LIBRARY

'; // ランダム5件表示 $sql = "SELECT bl_id,bl_title FROM blog ORDER BY RANDOM() LIMIT 5"; $result = $db->query($sql); while($row = $result->fetchrow()) { print ' '; } print '
'.$row[1].'

'; // 指定月のblog表示 $sql = "SELECT * FROM blog WHERE bl_date LIKE '$ym%' AND bl_ct_id = '$ct_id' ORDER BY bl_date DESC"; $result = $db->query($sql); while($row = $result->fetchrow()) { $bl_id = $row[0]; $imagefile = "blog_img/".$bl_id.".jpg"; $imghtml = ''; $bl_layout = $row[1]; $bl_ct_id = $row[2]; $sql = "SELECT ct_name FROM category WHERE ct_id = '$bl_ct_id'"; $result2 = $db->query($sql); $row2 = $result2->fetchrow(); $ct_name = $row2[0]; $bl_title = $row[5]; $bl_text = $row[6]; $bl_date = $row[7]; $dy = substr($bl_date,0,4); $dm = substr($bl_date,4,2); $dd = substr($bl_date,6,2); if (file_exists($imagefile)) { if ($bl_layout == "top") { $imghtml = '

'; } else { $imghtml = ''; } } if ($ct_name == "PRODUCTS") { $catlink = '../products/'; } else { $catlink = 'cat.php?ct_id='.$bl_ct_id; } print '

'.$dm.'/'.$dd.'
'.date("D" , mktime(0,0,0,$dm,$dd,$dy)).'

'.$bl_title.'
CATEGORY:'.$ct_name.'

'.$imghtml.ereg_replace("\r\n|\r|\n" , "
" , $bl_text); print '


'; } print '
'; ?>