include_once("../common/common.inc");
include_once("../common/err.inc");
include_once("../common/preference.inc");
$list_max = 10;
//WHERE句・limit句
if (ereg('^[0-9]{4}$',$_GET['year']))
{
$year = $_GET['year'];
$where = 'AND YEAR(odate)='.$year;
$limit = '';
}
else
{
$where = '';
$limit = 'LIMIT '.$list_max;
}
//ORDER BY句
if ($_GET['sort'] == 2)
{
$order = 'class ASC,odate DESC,oid DESC';
$sort_select[2] = 'selected';
}
else
{
$order = 'odate DESC,oid DESC';
$sort_select[1] = 'selected';
}
$db = db_connect('latin');
$kuwashiku = '
';
//問い合わせ
$sql = "SELECT * FROM oshirase WHERE pubo=1 AND {$public} {$where} ORDER BY {$order} {$limit}";
$result = mysql_query($sql,$db) or err_msg('DBエラー',$sql.mysql_error());
while ($row = mysql_fetch_assoc($result))
{
extract($row);
$odate = ymd($odate,5);
//画像
if ($thumbnail)
{
$file_name = '../images/'.$oid.'/'.$thumbnail;
if (file_exists($file_name))
{
$image = '

| {$term} {$comment} {$links} |
|
||||||||||||||||