function eventViewer(){
if($_SERVER['SERVER_NAME'] == '192.168.0.77'){
include("c:\mysite\common\dataBase.inc");
$inc_DBConect_0 = "c:\mysite\common\DBConect_0.inc";
$inc_DBConect_online = "c:\mysite\common\DBConect_online.inc";
}else{
include("/home/kir492785/public_html/optronics/common/dataBase.inc");
$inc_DBConect_0 = "/home/kir492785/public_html/optronics/common/DBConect_0.inc";
$inc_DBConect_online = "/home/kir492785/public_html/optronics/common/DBConect_online.inc";
}
$strShow = "";
$htmlShow = "";
$today = date("Ymd ");
$strSql = new StringBuffer();
$strSql->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;
}
?>
//ホットニュースRSS
function hotnewsXML(){
$fileName = "http://hikari-joho.com/joho/mainte/admin/temp.txt";
$fp = @fopen($fileName,"r");
if(!$fp){
return false;
}
$lop = 0;
$prev_date = "";
$counter = 0;
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');
}
$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 .= "