|
(2005-03-06) News: The next version of Go4Go.net is ready for public test. Please visit this page for some brief introductions before moving to the new site. This old site will still be active for quite a long time until all functions and data are moved to the new site. This transitional period may take months.
|
Recent Go News
|
This section is obsolete as of March 2005. Please access the latest Go news here
|
<%
db.connect();
StringBuffer sb = new StringBuffer();
sb.append("SELECT * FROM englishnews ");
sb.append("ORDER BY Event_Date DESC, ID DESC LIMIT 5");
ResultSet rs = db.doQuery(sb.toString());
%>
<%
while (rs.next()) {
%>
<%=rs.getString(2)%>
<%=rs.getString(3)%>
<%
String refType = rs.getString("Ref_Type");
String link = null;
if (refType.equals("gameID")) {
link = "sgfview.jsp?id="+rs.getString("Ref_ID");
%>
<%
}
else if(refType.equals("compID")) {
link = "bytournament2.jsp?id="+rs.getString("Ref_ID");
%>
<%
}
// add link to photo
String hasPhoto = rs.getString("hasPhoto");
String photoLink = null;
if (hasPhoto.equals("yes")) {
photoLink = "photonews.jsp?id=" + rs.getString(1);
%>
<%
}
%>
<%
}
%>
News Archive >>
Recent Game Records
|
This section is obsolete as of April 2005. Please access the latest game records here
|
<%
// a list of games commented by Alex
rs = db.doQuery("SELECT ref_ID from commentary where ref_ID IS NOT NULL");
Set ids = new HashSet();
while (rs.next()) {
Integer i = new Integer(rs.getInt(1));
ids.add(i);
}
%>
<%
sb = new StringBuffer();
sb.append("SELECT games.Game_ID, games.Game_Date, games.Description, ");
sb.append("games.Result, p1.English_Name as Black_Name, ");
sb.append("p2.English_Name as White_Name, c.Comp_ID, ");
sb.append("c.English_Name, games.Comp_Number, games.Competition, games.Notes, games.round ");
sb.append("FROM games, players AS p1, players AS p2, competitions AS c WHERE");
sb.append(" games.Black_Player = p1.Player_ID ");
sb.append("and games.White_Player = p2.Player_ID ");
sb.append("and c.Comp_ID = games.Competition order by ");
sb.append("games.Game_Date DESC, Game_ID DESC LIMIT 10");
rs = db.doQuery(sb.toString());
%>
| Game Date and Game Description |
| Black |
White |
Result |
Replay |
Download |
Print |
<%
while (rs.next()) {
String gameNotes = rs.getString(11);
if (rs.wasNull()) gameNotes = "";
int competitionID = rs.getInt(10); // this is '0' for informal and unclassified games
int compNumber = rs.getInt(9);
String roundInfo = rs.getString(12);
if (rs.wasNull()) roundInfo = "";
// generate game info, with complete tournament and round info
String en_gn = null;
if (competitionID == 0) {
en_gn = net.go4go.ResultTranslator.ordinal(compNumber) + " " + gameNotes;
}
else {
en_gn = net.go4go.ResultTranslator.ordinal(compNumber) + " " + rs.getString(8);
}
String id = rs.getString(1);
%>
<%=rs.getString(2)%> <%=en_gn%><%=roundInfo.equals("")?"":","%> <%=roundInfo%>
<%
if (ids.contains(new Integer(id))) {
%>
<%
}
%>
|
| <%=rs.getString(5)%> |
<%=rs.getString(6)%> |
<%=net.go4go.ResultTranslator.translate(rs.getString(4))%> |
 |
 |
 |
<%
} // end while
%>
Complete Game Collection >>
What is this?
|