📄 online.java
字号:
package com.laoer.bbscs.bbs;import java.sql.*;import java.io.*;import java.util.*;import com.laoer.bbscs.db.*;import com.laoer.bbscs.txthtml.*;import com.laoer.bbscs.admin.BBSConf;/** * <p>Title: BBS-CS</p> * <p>Description: BBS-CS(BBS式虚拟社区系统)</p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: loveroom.com.cn</p> * @author 龚天乙(laoer) * @version 3.0 */public class Online { String SQL = ""; DbTrans DBSQL; DoText myDoText; ResultSet rs = null; BBSConf myBBSConf; public Online() { this.DBSQL = new DbTrans(); this.myDoText = new DoText(); this.myBBSConf = new BBSConf(); } public ResultSet rsUserOline() { SQL = "SELECT ID,name,nick FROM user WHERE (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(logintime))<=180"; ResultSet rsUserOline = null; try { rsUserOline = DBSQL.executeQuery(SQL); } catch (SQLException e){ } return rsUserOline; } public ResultSet rsFriendOline(String strUserID) { SQL = "select user.ID,user.name,user.nick from user,friend where friend.UID="+ strUserID +" and user.ID=friend.FID and (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(user.logintime))<=180"; ResultSet rsGuestOline = null; try { rsGuestOline = DBSQL.executeQuery(SQL); } catch (SQLException e){ } return rsGuestOline; } public String strOline(ResultSet rsOline) { String strOline = ""; strOline += "<TABLE WIDTH=99% BORDER=0 CELLSPACING=2 CELLPADDING=0 ALIGN=center>"; int counter = 0; try { while (rsOline.next()) { if (counter == 0) { counter = 2; strOline += "<tr>\n"; } strOline += "<TD WIDTH=49%><a href='javascript:g(\""+ myDoText.iso2gb(rsOline.getString("name")) +"\")'>"+ myDoText.iso2gb(rsOline.getString("name")) +"</a><FONT COLOR=#666666>["+ myDoText.iso2gb(rsOline.getString("nick")) +"]</FONT></TD>\n"; if (counter == 1) { counter = 0; strOline += "</tr>"; } else { counter = counter - 1; } } rsOline.close(); } catch (SQLException e){ } strOline += "</TABLE>"; return strOline; } public void close() { try { DBSQL.close(); } catch (SQLException e){ } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -