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

📄 friendlist.jsp

📁 这是一个用JSP开发的论坛源 码。。。 按照上在的README可轻松的捅有下JSP论坛
💻 JSP
字号:
<%
/*##################################################################**
**#  程序名称:LyBBS『凌云论坛』                                   #**
**#                                                                #**
**#  程序开发: teddy 『星语凌』                                    #**
**#                                                                #**
**#  版权所有: 凌云创作室 (原流星电脑工作室)                       #**
**#                                                                #**
**#  主页地址: http://www.lybbs.net                                #**
**#  电邮地件: horseye@sina.com                                    #**
**#                                                                #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=GBK" %>
<%
int forumID=0;
String tempSTR="",
       submit="",
       action="";
String friendName="",
       friendEmail="",
       friendIcq="",
       friendQQ="",
       friendHomePage="",
       friendOnline="",
       errorInfo="";
ParameterUtils.setCharacterEncoding(request);

action=ParameterUtils.getString(request,"action");
submit=ParameterUtils.getString(request,"submit");
%>
<%@ include file="include/boardprepare.jsp"%>

<!--//html from here-->
<%@ include file="include/head.jsp"%>
<style>
  .gray {CURSOR:hand;filter:gray}
  INPUT {BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc; PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc}
</style>
<script language="JavaScript">
function openscript2(url, width, height) {
  var Win = window.open(url,"openwindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );
}
</script>
<body <%=lbbody%>>
<p>&nbsp;
<br>
<%
ForumMsgFactory forumMsgFactory=new ForumMsgFactory();
forumMsgFactory.setUserID(Integer.parseInt(cookieID));
forumMsgFactory.setUserName(cookieName);

if(cookieMode.equals("0")) {
  if(submit.equals("登 陆")) {
    forumMsgFactory.setUserLogin(request,response,loginout);
    out.println("<script>this.location.reload();</script>");
  }
  else {
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
 <tr>
  <td>
   <table cellpadding=3 cellspacing=1 border=0 width=100%>
    <form action="friendlist.jsp" method="post">
    <input type=hidden name="action" value="<%=action%>">
    <tr>
     <td bgcolor=<%=miscbacktwo%> colspan=2 align=center>
      <font color=<%=fontcolormisc%>><b>请输入您的用户名、密码登陆</b></font>
     </td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的用户名</font></td>
     <td bgcolor=<%=miscbackone%>><input type=text name="username" value="<%=cookieName%>"></td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的密码</font></td>
     <td bgcolor=<%=miscbackone%>><input type=password name="password"></td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbacktwo%> colspan=2 align=center><input type=submit name="submit" value="登 陆"></td>
    </tr>
    </form>
   </table>
  </td>
 </tr>
</table>
<%
  }
}

else {
  if(action.equals("adduser")) {
    forumMsgFactory.addFriend(request,user);
    errorInfo=forumMsgFactory.getErrorInfo();
  }
  else if(action.equals("deleteuser")) {
    forumMsgFactory.deleteFriend(request,user);
    errorInfo=forumMsgFactory.getErrorInfo();
  }
%>
<table width=<%=tablewidth%> align=center cellspacing=0 cellpadding=1  border=0 bgcolor=<%=tablebordercolor%>>
 <tr>
  <td>
   <table width=100% cellpadding=3 cellspacing=1 border=0>
    <tr>
     <td bgcolor=<%=miscbacktwo%> align=center colspan=7>
      <font color=<%=fontcolormisc%>><b><%=cookieName%> 的好友列表</b></font>
     </td>
    </tr>
<%
  if(action.equals("adduser") || action.equals("deleteuser")) {
%>
    <tr>
     <td bgcolor=<%=miscbacktwo%> align=center colspan=7>
      <font color=<%=fontcolormisc%>><b><%if(errorInfo.equals("")) {out.print("好友"+friendName);if(action.equals("adduser")) out.print("添加");else out.print("删除");out.print("成功!");} else {if(action.equals("adduser")) out.print("添加");else out.print("删除");out.println("好友失败:"+errorInfo);}%></b></font>
     </td>
    </tr>
<%
  }
%>
    <tr>
     <td bgcolor=<%=miscbackone%>><font face="宋体" color=<%=fontcolormisc%>><center><b>姓名</b></center></font></td>
     <td bgcolor=<%=miscbackone%>><font face="宋体" color=<%=fontcolormisc%>><center><b>短消息</b></center></font></td>
     <td bgcolor=<%=miscbackone%>><font face="宋体" color=<%=fontcolormisc%>><center><b>Email</b></center></font></td>
     <td bgcolor=<%=miscbackone%>><font face="宋体" color=<%=fontcolormisc%>><center><b>ICQ</b></center></font></td>
     <td bgcolor=<%=miscbackone%>><font face="宋体" color=<%=fontcolormisc%>><center><b>OICQ</b></center></font></td>
     <td bgcolor=<%=miscbackone%>><font face="宋体" color=<%=fontcolormisc%>><center><b>主页</b></center></font></td>
     <td bgcolor=<%=miscbackone%>><font face="宋体" color=<%=fontcolormisc%>><center><b>删除?</b></center></font></td>
    </tr>
<%
  String friendNameAll=forumMsgFactory.getFriendName();
  if(!friendNameAll.equals("")) {
    String[] friendNameArray=friendNameAll.split(",");
    for(int i=0;i<friendNameArray.length;i++) {
       friendName=friendNameArray[i];
       try {
         user.getFriendStats(friendName);
         friendEmail=user.getEmail();
         friendIcq=user.getIcq();
         friendQQ=user.getQQ();
         friendHomePage=user.getHomePage();
         friendOnline=user.getOnline();
         if(friendHomePage.equals("http://"))
           friendHomePage="";
       }
       catch(Exception e) {
         System.err.println(e);
       }
%>
    <tr>
     <td bgcolor=<%=miscbackone%>><%if(friendOnline.equals("1")) out.println("<IMG SRC=images/online1.gif width=15 height=15 alt=\"该用户目前在线\">");else out.println("<IMG SRC=images/offline1.gif width=15 height=15 alt=\"该用户目前不在线\">");%> <a href="profile.jsp?action=show&member=<%=friendName%>"><%=friendName%></a></td>
     <td bgcolor=<%=miscbackone%>><center><a href="javascript:openScript('messanger.jsp?action=msgsend&toname=<%=friendName%>',600,400)"><img src="images/message.gif" border=0></a></center></td>
     <td bgcolor=<%=miscbackone%>><center><%if(!friendEmail.equals("")) {%><a href="mailto:<%=friendEmail%>"><img border=0 src=images/email.gif></a><%} else out.println("没有");%></center></td>
     <td bgcolor=<%=miscbackone%>><center><%if(!friendIcq.equals("")) {%><a href="javascript:openScript('misc.jsp?action=icq&UIN=<%=friendIcq%>',450,300)"><img src="images/icq.bmp" border=0></a><%} else out.println("没有");%></center></td>
     <td bgcolor=<%=miscbackone%>><center><%if(!friendQQ.equals("")) {%><a href="javascript:openScript('http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=friendQQ%>',450,200)"><img src="images/oicq.gif" border=0></a><%} else out.println("没有");%></center></td>
     <td bgcolor=<%=miscbackone%>><center><%if(!friendHomePage.equals("")) {%><a href="<%=friendHomePage%>" target="_blank"><img src="images/homepage.gif" border=0></a><%} else out.println("没有");%></center></td>
     <td bgcolor=<%=miscbackone%>><center><input type=button value='删除' onClick="location.href='friendlist.jsp?action=deleteuser&friendname=<%=friendName%>'" style="BORDER-RIGHT: #ff9933 1px solid; BORDER-TOP: #ff9933 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #ff9933 1px solid; COLOR: #ff6633; BORDER-BOTTOM: #ff9933 1px solid; FONT-FAMILY: 宋体; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff; CURSOR:hand"></center></td>
    </tr>
<%
    }
  }
%>
    <tr>
     <form action=friendlist.jsp method=post name=adduser>
     <input type=hidden name=action value=adduser>
     <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>好友姓名:</font></td>
     <td bgcolor=<%=miscbackone%> colspan=5><input type=text name=friendname size=30></td>
     <td bgcolor=<%=miscbackone%>><center><input type=submit value='增加' style="BORDER-RIGHT: #ff9933 1px solid; BORDER-TOP: #ff9933 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #ff9933 1px solid; COLOR: #ff6633; BORDER-BOTTOM: #ff9933 1px solid; FONT-FAMILY: 宋体; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff; CURSOR:hand"></center></td>
     </form>
    <tr>
     <td bgcolor=<%=miscbackone%> colspan=7>
      <center><font color=<%=fontcolormisc%>>输入你要想增加的好友姓名,点击增加确认操作!</font></center>
     </td>
    </tr>
    <tr>
     <td bgcolor=<%=miscbackone%> colspan=7>
      <center><font color=<%=fontcolormisc%>><a href=javascript:top.close();>[关闭窗口]</a></font></center>
     </td>
    </tr>
   </table>
  </td>
 </tr>
</table>
<%
}
%>
</body>
</html>

⌨️ 快捷键说明

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