⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userpoption.java

📁 BBS虚拟社区
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
          return false;      }  }  public boolean delShuQian(String strUserID, String sq_ID) {      SQL = "delete from shuqian where ID="+ sq_ID +" and UID="+ strUserID;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e) {          return false;      }  }    public String getYdy(String strUserID,String BID,String tablecolor, String pages,String fileName,int inpages) {      String strYdy = "";      PageBreak myPageBreak = new PageBreak();      ShowDoc myShowDoc = new ShowDoc();      String strCountSQL = "";      String strSQL = "";      strCountSQL = "select count(*) as total from dy where UID="+ strUserID +" and BID="+ BID;      strSQL = "select * from dy where UID="+ strUserID +" and BID="+ BID;      rs = myPageBreak.getPageBreak(pages,strCountSQL,strSQL,inpages);      try {          while (rs.next()) {              strYdy += "<tr bgcolor="+tablecolor+">\n<td width=328>\n";              strYdy += myDoText.iso2gb(myShowDoc.getForumTitle(rs.getString("RID")))+"</td>\n<td width=62>\n";              strYdy += "<div align=center>";              if (rs.getInt("email_inform")==1) {                  strYdy += "邮件[<a href='ydy.jsp?pages="+pages+"&RID="+rs.getString("RID")+"&BID="+BID+"&email_inform=0'>取消</a>]";              }              else {                  strYdy += "--";              }              strYdy += "</div>\n</td>\n<td width=61>\n";              strYdy += "<div align=center>";              if (rs.getInt("msg_inform") ==1) {                  strYdy += "留言[<a href='ydy.jsp?pages="+pages+"&RID="+rs.getString("RID")+"&BID="+BID+"&msg_inform=0'>取消</a>]";              }              else {                  strYdy += "--";              }              strYdy += "</div>\n</td>\n<td width=36>\n";              strYdy += "<div align=center><a href='ydy.jsp?pages="+pages+"&RID="+rs.getString("RID")+"&BID="+BID+"&del=1'>删除</a></div>\n";              strYdy += "</td>\n</tr>\n";          }      }      catch (SQLException e){      }      strYdy += "<td colspan=4>"+ myPageBreak.listPageBreak(fileName) +"</td>\n";      return strYdy;  }  public boolean setUpEmForm(String strUserID, String RID) {      SQL = "update dy set email_inform=0 where RID="+ RID +" and UID="+ strUserID;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e){          return false;      }  }  public boolean setUpMsgForm(String strUserID, String RID) {      SQL = "update dy set msg_inform=0 where RID="+ RID +" and UID="+ strUserID;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e){          return false;      }  }  public boolean delEmMegForm(String strUserID, String RID) {      SQL = "delete from dy where RID="+ RID +" and UID="+ strUserID;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e){          return false;      }  }  public boolean setUpdatePassWD(String strUserID,String strUserName,String newpasswd1,String newpasswd2) {      MD5 myMD5 = new MD5();      SQL = "update user set passwd='"+ newpasswd1 +"',passwd1='"+ myMD5.getMD5ofStr(newpasswd2) +"' where ID="+ strUserID +" and name='"+ strUserName +"'";      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e){          return false;      }  }  public boolean isInPhoto(String strUserID) {      int numInPhoto = 0;      SQL = "select count(*) as numInPhoto from photo where UID = "+strUserID;      try {          rs = DBSQL.executeQuery(SQL);          if (rs.next()) {              numInPhoto = rs.getInt("numInPhoto");          }          rs.close();      }      catch (SQLException e) {      }      if (numInPhoto != 0) {          return true;      }      else {          return false;      }  }  public String getPhotoName(String strUID) {      String strPhotoName = "";      SQL = "select picname from photo where UID="+strUID;      try {          rs = DBSQL.executeQuery(SQL);          if (rs.next()) {              strPhotoName = rs.getString("picname");          }          rs.close();      }      catch (SQLException e) {      }      return strPhotoName;  }  public boolean setDelPhoto(String strUserID) {      SQL = "delete from photo where UID="+strUserID;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e) {          return false;      }  }  public boolean setInPhoto(String strUserID, String strUserName, String strPicnName) {      if (isInPhoto(strUserID)) {          SQL = "update photo set picname = '"+ strPicnName +"' where UID = "+strUserID;          try {              DBSQL.executeUpdate(SQL);              return true;          }          catch (SQLException e) {              return false;          }      }      else {          SQL = "insert into photo (UID,Uname,picname) values ('"+strUserID+"','"+ strUserName +"','"+ strPicnName +"')";          try {              DBSQL.executeUpdate(SQL);              return true;          }          catch (SQLException e) {              return false;          }      }  }  public String getListPhoto(String pages,boolean isSuper) {      String strListPhoto = "";      PageBreak myPageBreak = new PageBreak();      //BBSConf myBBSConf = new BBSConf();      String strCountSQL = "";      String strSQL = "";      strCountSQL = "SELECT count(*) as total FROM photo order by UID";      strSQL = "SELECT * FROM photo order by UID ";      rs = myPageBreak.getPageBreak(pages,strCountSQL,strSQL,9);      int counter = 0;      try {          while (rs.next()) {              if (counter == 0) {                  counter = 3;                  strListPhoto += "<tr>\n";              }              strListPhoto += "<TD WIDTH=33%><CENTER><a href='userinfo.jsp?UID="+rs.getInt("UID")+"'><img src='upload/"+rs.getString("picname")+"' width=200 height=150 border=0></a><BR><a href='userinfo.jsp?UID="+rs.getInt("UID")+"'>看资料</a>";              if (isSuper) {                  strListPhoto +=  " <a href='delphoto.jsp?UID="+rs.getInt("UID")+"'>删除</a> <INPUT TYPE=radio NAME=setstar value='"+ rs.getInt("UID")+"'";                  if (rs.getInt("isstart")==1) {                  strListPhoto += "checked";                  }                  strListPhoto += ">设为明星";              }              strListPhoto += "</CENTER></TD>\n";              if (counter == 1) {                  counter = 0;                  strListPhoto += "</tr>\n";              }              else {                  counter = counter - 1;              }          }          rs.close();      }      catch (SQLException e) {      }      myPageBreak.close();      return strListPhoto;  }  public boolean setStar(String strUserID) {      SQL = "update photo set isstart = 0 where isstart = 1";      try {          DBSQL.executeUpdate(SQL);      }      catch (SQLException e) {          return false;      }      SQL = "update photo set isstart = 1 where UID="+strUserID;      try {          DBSQL.executeUpdate(SQL);          return true;      }      catch (SQLException e) {          return false;      }  }  public void close() {      try {          DBSQL.close();      }      catch (SQLException e) {      }  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -