add(" SELECT id, max( concat(year,if(month>9,month,concat('0',month)),if(day>9,day,concat('0',day)) )) AS m "); $strSql->add(" FROM eventinfo "); $strSql->add(" WHERE concat(year,if(month>9,month,concat('0',month)),if(day>9,day,concat('0',day)) ) <= $today "); # $strSql->add(" and eventname not like '%セミナー%' "); # $strSql->add(" and eventname not like '%seminar%' "); $strSql->add(" GROUP BY id "); $strSql->add(" ORDER BY m DESC,`id` DESC LIMIT 2 "); $str = $strSql->toString(); $db = new DBOperation($inc_DBConect_0); $db->DBConectResult($str); $strSql->Clear(); if($db->getRowNumber() >0){ $id = ""; for($i=0;$item = $db->getItem();$i++){ $id .= $item['id'] . ","; } $id = rtrim($id,","); $strSql = new StringBuffer(); $strSql->add(" SELECT id,eventname,sponsorship,date, "); $strSql->add(" if((length(eventname)/2)<25,eventname,concat(mid(eventname,1,25),'...')) as title, "); $strSql->add(" time,place,contents,capacity,cost,etc,name,tel,fax,email,url,etc2, "); $strSql->add(" concat(year,if(month<10,concat('0',month),month)) as lead "); $strSql->add(" FROM eventinfo "); $strSql->add(" WHERE id in($id) "); $str = $strSql->toString(); $db = new DBOperation($inc_DBConect_0); $db->DBConectResult($str); $strSql->Clear(); if($db->getRowNumber() >0){ for($i=0;$item = $db->getItem();$i++){ $title = $item['title'] . "
\n"; $date = ($item['date']!="")?"期間:" . $item['date'] . "
\n":""; $id = $item['id']; $lead = $item['lead']<10?"0" . $item['lead']:$item['lead']; $htmlShow .= "-------------------------
\n"; $htmlShow .= "\n"; $htmlShow .= "\n"; $htmlShow .= $title; $htmlShow .= $date; $htmlShow .= "\n"; } } $htmlShow .= "-------------------------
\n"; $htmlShow .= "more
\n"; } return $htmlShow; } ?> ",$buffer); if ( $flag == 0 ) { break; } if(strlen($title)>49){ $title = mb_strcut($title, 0, 49, 'EUC-JP'); $title .= "..."; }else{ $title = mb_strcut($title, 0, 49, 'EUC-JP'); } $valueRss[$counter]['np'] = $url; $valueRss[$counter]['url'] = $url; $valueRss[$counter]['title'] = $title; $valueRss[$counter]['now'] = ereg_replace("\.","",$date); $valueRss[$counter]['description'] = $content; $valueRss[$counter]['subject'] = $reference; $counter++; $prev_date = $date; $prev_flag = $flag; $lop++; if($lop >2){ break; } } while (1); fclose ($fp); $now = gmdate("Y-m-d\TH:i:s+09:00"); $htmlShow = ""; $rssTitle = ""; $rssValue = ""; $counter = 0; $htmlShow .= "\r\n"; $htmlShow .= ""; $htmlShow .= "\r\n"; $htmlShow .= "\r\n"; $htmlShow .= "オプトロニクス\r\n"; $htmlShow .= "http://www.optronics.co.jp/"; $htmlShow .= "オプトロニクス社は、1981年に創刊した「月刊オプトロニクス」を活動の軸に、「新規産業の創出に役立つ、フロンティアテクノロジーに関する特長ある情報を商品化し、社会の発展に寄与すること」を企業目標に掲げ、出版および広告とコンピュータを利用したその周辺の事業を展開してきました。 "; $htmlShow .= "ja\n"; $htmlShow .= "\n"; $htmlShow .= "" . $now . "\n"; $rssTitle .= "\r\n"; $rssTitle .= "\r\n"; for($i=0;$i\r\n"; $rssValue .= "\r\n"; $rssValue .= "" . $valueRss[$i]['title'] . "\r\n"; $rssValue .= "" . $valueRss[$i]['url'] . "\r\n"; $rssValue .= "" . gmdate("Y-m-d\TH:i:s+09:00",strtotime($valueRss[$i]['now'])) . "\r\n"; $rssValue .= "" . $valueRss[$i]['description'] . "\r\n"; $rssValue .= "" . $valueRss[$i]['subject'] . "\n"; $rssValue .= " \r\n"; } $rssTitle .= "\r\n"; $rssTitle .= "\r\n"; $rssTitle .= "\r\n"; $htmlShow = $htmlShow . $rssTitle . $rssValue . ""; $fp = fopen($_SERVER['DOCUMENT_ROOT']."/rss/index.rdf","w"); fwrite($fp,mb_convert_encoding($htmlShow,"UTF-8")); fclose($fp); return true; } //ホットニュース function hotnews(){ $fileName = "http://hikari-joho.com/joho/mainte/admin/temp.txt"; $fp = @fopen($fileName,"r"); if(!$fp){ $fileName = "./hotnews/data/j_article.dat"; $fp = fopen($fileName,"r"); } $lop = 0; $prev_date = ""; do { $buffer = fgets($fp, 4096); list( $date, $flag, $title, $url, $content, $reference ) = explode("<>",$buffer); if ( $flag == 0 ) { break; } if(strlen($title)>49){ $title = mb_strcut($title, 0, 49, 'EUC-JP'); $title .= "..."; }else{ $title = mb_strcut($title, 0, 49, 'EUC-JP'); } $url = $url; if ( $flag == 1 ) { echo "\t\t\t\t\t\t\t\t
  • "; } else { echo "\t\t\t\t\t\t\t\t
  • "; } if ( $url == "" ) { echo $title; } else { echo ""; echo $title; echo ""; } echo "
  • \n"; if ( $flag == 1 ) { echo $content; } $prev_date = $date; $prev_flag = $flag; $lop++; if($lop >2){ break; } } while (1); fclose ($fp); } ?> ニュース:OPTRONICS
    ニュース