END;
/* --- タイトルの表示 -------------------------------------------------------------------------------- */
$num = ($_GET['n']) ? $_GET['n'] : count($r->getItems());
for ($i=0; $i<$num; $i++) {
$val = $r->getItems();
$title = mb_convert_encoding(strip_tags($val[$i]['title']), $code, "UTF-8,EUC-JP,SJIS");
//タイトルの処理 長い文字列を制限する
//if ( mb_strwidth($title , $code) > $maxlength * 2 ) { $over = "..."; } else { $over = ""; }
//$title = mb_substr($title, 0, $maxlength , $code);
//$title = $title.$over;
$title = mb_strimwidth($title, 0, $maxlength * 2 , "...", $code);
$cat = mb_convert_encoding(strip_tags($val[$i]['category']), $code, "UTF-8,EUC-JP,SJIS");
$desc = "".mb_convert_encoding(strip_tags($val[$i]['description']), $code, "UTF-8,EUC-JP,SJIS");
if ( $_GET['d'] == "" ) {
$desc = "";
$more = "news.php?u=".$rdf;
} else {
//$desc.="
";
$more = "";
}
$link = htmlspecialchars($val[$i]['link']);
$date = $val[$i]['dc:date']; //RSS 日付 2008-10-20JST09:23:33+09:00
$pubdate = $val[$i]['pubdate'];
$date = str_replace('+09:00','',$date); //日付原型 2008-10-20JST09:23:33
$dcdate = str_replace('T',' ',$date); // 2008-10-20JS 09:23:33
$dcdate = str_replace('JS','',$dcdate); // 2008-10-20 09:23:33
$dcdate = str_replace('-','/',$dcdate); // 2008/10/20 09:23:33
//RSS2.0(XML)の場合の日付処理
if ( $version == "2" ) {
$date = date( "Y/m/d", strtotime($pubdate) );
$dcdate = date( "Y/m/d", strtotime($pubdate) );
$more2 ="&v=2";
} else {
$more2 ="";
}
//$date2 = date( "Y/m/d", strtotime($dcdate) ); //整形済日付 2008年10月20日
$date2 = date("Y",strtotime($dcdate))."年".date("m月d日",strtotime($dcdate) );
$now = date("Y/m/d H:i:s"); //現在日時
$md5date = md5( $date );
if ( $dcdate < $now ) {
if ( $_GET['k'] == "" || $_GET['k'] == $date ) {
// 内容
print "
| {$date2} | {$title}";
print " ";
print " |
\n";
}
} else {
//未来は表示しない
//print "非表示".$dcdate." ".$now." ".$title."
";
//件数を調整
if ( $_GET['n'] != "" ) { $num++; }
}
$date2 = "";
}
print "