loadTemplatefile("member.xml", true, true);
$tpl->setCurrentBlock("MAIN");
$tpl->setVariable("RSS_TITLE","the Gryphon Members");
$tpl->setVariable("RSS_URL","http://www.gryphon.to/member/view.cgi");
$tpl->setVariable("RSS_DESCRIPTION",mb_convert_encoding("the Gryphon メンバーリスト","UTF-8","euc-jp"));
$tpl->parseCurrentBlock("MAIN");
$SQL="SELECT m.member_id,m.handle_name,m.comment,m.modify,to_char(m.modify,'Dy, DD Mon YYYY HH24:MI:SS +0900') as last_modify,to_char(m.modify,'YYYYmmddhh24miss') as modi,to_char(m.modify,'YYYY-mm-ddThh24:mi:ss') as mdate,s.grade,s.year,s.color,s.comment as s_comment,m.area1 FROM MEMBER as m LEFT JOIN soarer as s ON m.member_id=s.member_id order by modify desc limit 10;";
/*
member_id | bigint | not null
grade | text | not null
grade_pri | integer |
year | text |
year2 | text |
color | text |
mission | text |
photo | text |
modify | timestamp without time zone | not null
regist | timestamp without time zone | not null
comment_type | integer |
comment | text |
*/
$res=@pg_query($SQL);
if($res){
for($i=0;$isetCurrentBlock("MAIN2");
$tpl->setVariable("NUM1",$rows[$i]["member_id"]);
$tpl->setVariable("NOWX",$rows[$i]["mdate"]);
$tpl->parseCurrentBlock("MAIN2");
}
for($i=0;$i",$row["comment"]);
$comment1=str_replace("\r","",$comment1);
$comment1=str_replace("[","[",$comment1);
$comment1=str_replace("]","]",$comment1);
$comment2=str_replace("\n","
",$row["s_comment"]);
$comment2=str_replace("\r","",$comment2);
$comment2=str_replace("[","[",$comment2);
$comment2=str_replace("]","]",$comment2);
$tpl->setCurrentBlock("SUB");
$tpl->setVariable("HANDLE_NAME",mb_convert_encoding($row["handle_name"],"UTF-8","euc-jp"));
$tpl->setVariable("COMMENT1",mb_convert_encoding($comment1,"UTF-8","euc-jp"));
$tpl->setVariable("COMMENT2",mb_convert_encoding($comment2,"UTF-8","euc-jp"));
$tpl->setVariable("GRADE",mb_convert_encoding($row["grade"],"UTF-8","euc-jp"));
$tpl->setVariable("YEAR",mb_convert_encoding($row["year"],"UTF-8","euc-jp"));
$tpl->setVariable("COLOR",mb_convert_encoding($row["color"],"UTF-8","euc-jp"));
$tpl->setVariable("AREA",mb_convert_encoding($row["area1"],"UTF-8","euc-jp"));
$tpl->setVariable("NUMBER",$row["member_id"]);
$tpl->setVariable("MODIFY_DATE",$row["last_modify"]);
$tpl->setVariable("NOW",$row["modi"]);
$tpl->setVariable("NOW2",$row["mdate"]);
$tpl->setVariable("NOWY",$row["mdate"]);
$tpl->parseCurrentBlock("SUB");
}
}
$tpl->show();
pg_close($conn);
exit;
?>