新着情報 | NEW ENTRIES
-
$cnt = 0;
foreach ($entries as $entry) {
// 新着かどうか
$newstr = "";
// 24時間以内か
if((time() - $entry["unix_time"]) < 72*60*60) {
$newstr = "";
}
// ブログURL
$blogUrl = $entry["url"];
if(strpos($blogUrl,"yahoo") !== FALSE){
$pos = strrpos($blogUrl, "/");
if($pos !== FALSE){
$blogUrl = substr($blogUrl,0,$pos+1);
}
} else {
$pos = strpos($blogUrl, "/",7);
if($pos !== FALSE){
$blogUrl = substr($blogUrl,0,$pos+1);
}
}
//コード出力処理
printf("
- <%s> ",$blogUrl,$entry["site_title"],$entry["site_title"]); printf("
- %s%s%s ",$entry["day"],$entry["url"],$entry["entry_title"],$entry["entry_title"],$newstr); // カウントインクリメント $cnt++; // if($cnt == 7) break; } ?>
事業告知・事業報告
$cnt = 0; foreach($topicsList as $topics){ $image = $topics->mainImage; $image1 = $image->src; $width = 100; $height = 75; if($image->width > $image->height){ if($image->width > 100){ $width_new = 100; $height_new = (int)( ($image->height/$image->width)*$width_new ); } else { $width_new = $image->width; $height_new = $image->height; } } else { if($image->height > 75){ $height_new = 75; $width_new = (int)( ($image->width/$image->height)*$height_new ); } else { $width_new = $image->width; $height_new = $image->height; if($width_new > 100){ $width_new = 100; $height_new = (int)( ($image->height/$image->width)*$height_new ); } else { $width_new = $image->width; $height_new = $image->height; } } } $contents = strip_tags($topics->description); $contents = nl2br($contents); $contentsRowList = explode("",$contents,2); if(count($contentsRowList) >= 2){ if(($pos = mb_strpos($contentsRowList[1],"
")) != FALSE){ $contentsRowList[1] = mb_substr($contentsRowList[1],0,$pos-1); } } //$contents = implode("
",$contentsRowList); $contents = $contentsRowList[0]; //printf("%s行 %s
",count($contents),$contents); if(($len = mb_strlen($contents)) >= 33){ $contents = mb_substr($contents,0,33,"UTF-8"); $contents .= "..."; } else { $contents .= "..."; } printf("
\n");
printf("
\n");
$cnt++;
//
if($cnt == 4) break;
}
?>
- \n");
printf("
- \n",$topics->link,$image->src,$width_new,$height_new,$topics->title); printf("
- \n");
printf("%s
\n",$topics->link,$topics->title); printf("【日時】%s(%s)
\n",date("Y年n月d日",strtotime($topics->date)),$topics->youbi); printf("【場所】%s
\n",$topics->place); printf("【内容】%s \n",$contents);
printf("