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

📄 videolist.jsp

📁 一个练习JAVA的例子程序 一个练习JAVA的例子程序
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" %><%@ page isThreadSafe="false" %><%@ page import="jasp.buildin.*, jasp.vbs.*, jasp.util.*" %><%@ page extends="jasp.servlet.JspBase" %><%  try {    jspinit(request,response,application,out,"jasp0");%><%     Session.setCodePage(936);    String sql = "";    int maxperpage = 0;    jasp.adodb.Recordset rs = null;    int totalput = 0;        //得到总页数    int n = 0;    int m = 0;    int i = 0;    variant a = new variant();     /* initialize variables. */     username = new variant();    groupid = new variant();    currentpage = 0;    mpage = 0;     /* initialize variable end */ %><%@ include file="../include/connect.jsp" %><%    username.set(checkstr(new variant(Request.QueryString("username"))));    if (username.equals(new variant(""))) {        Response.Redirect("../default.jsp");    }%><html><head><META http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK href="../CSS/Hompy/hompy.css" type=text/css rel=stylesheet><title></title><script language="JavaScript" type="text/JavaScript"><!--function winOpen(Url,width,height,scrollbar,resize){ow = width;oh = height;os = scrollbar;or = resize;var xposition=0; var yposition=0;if ((parseInt(navigator.appVersion) >= 4 ))  {    xposition = (screen.width - width) / 2;    yposition = (screen.height - height-25) / 2;  }  window.open (Url,"","width ="+ow+",height="+oh+",scrollbars = "+os+",resizable="+or+",left="+xposition+",top="+yposition );}//--></script><script language="JavaScript"><!--function showPersonacon(persona_view_id) {	var span_name = "persona"+persona_view_id;	var open = document.getElementById(span_name).style.display;	if(open == "none") {		document.getElementById(span_name).style.display = '';	}	else {		document.getElementById(span_name).style.display = 'none';	}}function setPersona(frmName, cid, rid, pid, pimg) {	var srcName = "personasrc" + cid;	var span_name = "persona" + cid;	document.getElementById(srcName).src = pimg;	document.forms[frmName].personaconid.value = pid;	if(document.getElementById(span_name).style.display == "") {		document.getElementById(span_name).style.display = 'none';	}}function formcheck(frmName) {    if(frmName.comment.value.length ==0)	{	alert("评论不能为空!");	frmName.comment.focus();	return false;	}}//--></script><script language="JavaScript"><!--//图片按比例缩放var flag=false;function DrawImage(ImgD,iwidth,iheight){    //参数(图片,允许的宽度,允许的高度)    var image=new Image();    image.src=ImgD.src;    if(image.width>0 && image.height>0){    flag=true;    if(image.width/image.height>= iwidth/iheight){        if(image.width>iwidth){          ImgD.width=iwidth;        ImgD.height=(image.height*iwidth)/image.width;        }else{        ImgD.width=image.width;          ImgD.height=image.height;        }        ImgD.alt=image.width+"×"+image.height+"点击察看原始尺寸";        }    else{        if(image.height>iheight){          ImgD.height=iheight;        ImgD.width=(image.width*iheight)/image.height;                }else{        ImgD.width=image.width;          ImgD.height=image.height;        }        ImgD.alt=image.width+"×"+image.height+"点击察看原始尺寸";        }    }} //--></script></head><body  oncontextmenu="window.event.returnValue=false" onselectstart="return false"><TABLE cellSpacing=0 cellPadding=0 width=473 border=0>  <TBODY>    <TR>       <TD height=29 align="center"><table width="97%" border="0" cellspacing="0" cellpadding="0">          <tr>             <td width="13%" class="orange2_b">我的视频</td>            <td width="51%" style="PADDING-RIGHT: 10px">&nbsp; </td><%    if (Session.getItem("username").equals(username)) {%>             <td width="36%" align="right"><a href="upload_video.jsp?username=<%= username %>"><img src="../Images/Hompy/w_upvideo.gif" border="0"></a>               <a href="javascript:;" onClick="javascript:winOpen('rvideo.jsp?username=<%= username %>', 620, 400, 'no','no')"><img src="../Images/Hompy/w_video.gif" width="82" height="19" border="0"></a></td><%    }%> 		  </tr>        </table> </TD>    </TR>    <TR>       <TD height=24><div align="center"><%    groupid.set(Request.QueryString("groupid").getValue());    if (groupid.equals(new variant(""))) {        sql = "select * from iisALLVideo where Username='" + username + "' and audit=1 ORDER BY VideoID DESC";    } else {        sql = "select * from iisALLVideo where Username='" + username + "' and GroupID=" + groupid + " and audit=1 ORDER BY VideoID DESC";    }    if (!(vb.IsEmpty(Request.getItem("page")))) {        currentpage = vb.CInt(Request.getItem("page"));    } else {        currentpage = 1;    }    maxperpage = 6;    rs = new jasp.adodb.Recordset();    sql = "" + sql + "";    rs.Open(sql, cn, 1, 1);    if (rs.getEOF() || rs.getBOF()) {%><table width="97%" border="0" cellpadding="0" cellspacing="0">  <tr>     <td style="HEIGHT: 3px;BORDER-TOP: #cecfce 1px solid; BORDER-BOTTOM: #cecfce 1px dotted; BACKGROUND-COLOR: #f7f7f7"><img src="" width="3" height="3" alt=""></td>  </tr>  <tr>     <td></td>  </tr>  <tr>               <td height="108" align="center">暂无视频!</td>  </tr>  <tr>     <td height="1" style="BORDER-BOTTOM: #cecfce 1px solid;"><img name="" src="" width="1" height="1" alt=""> </td>  </tr></table><table width="39%" height="45" border="0" cellpadding="0" cellspacing="0">            <tr>    <td><TABLE width="206">                <TBODY>                <FORM name=form onSubmit="return false;" method=get target=_self>                  <TR>                     <TD><SELECT name=selsearchType>                        <option value="wpname">标题</option>                        <option value="title">内容</option>                      </SELECT> <INPUT  maxLength=35 size=15 name=searchTxt> <img src="../Images/Hompy/search_b.gif" align="absmiddle"></TD>                  </TR>                </FORM>              </TABLE></td>  </tr></table><%        Response.End();    } else {        totalput = rs.getRecordCount();        rs.Move((currentpage - 1) * maxperpage);        rs.setPageSize(maxperpage);        mpage = rs.getPageCount();        n = 1;        m = 3;%>          <table width="97%" border="0" align="center" cellpadding="2" cellspacing="2">            <tr><%        i = 0;        while(!(rs.getEOF() || i >= maxperpage)) {%><td><TABLE cellSpacing=0 cellPadding=0 width=151 border=0>              <TBODY>              <TR>                      <TD width=7 height=7><IMG height=7 src="../Images/Hompy/box_top01.gif"                   width=7></TD>                      <TD width=137 background=../Images/Hompy/box_top03.gif height=7></TD>                      <TD width=7 height=7><IMG height=7 src="../Images/Hompy/box_top02.gif"                   width=7></TD>                    </TR>              <TR>                      <TD width=7 background=../Images/Hompy/box_left.gif height=122></TD>                      <TD vAlign=top width=137 height=122>                         <TABLE cellSpacing=0 cellPadding=0 width=137 border=0>                    <TBODY>                    <TR>                      <TD height=102>                        <TABLE cellSpacing=1 cellPadding=0 width=137                         bgColor=#e9e9e9 border=0>                          <TBODY>                          <TR>                                      <TD bgColor=#ffffff height=100 align="center"><a href="videoplay.jsp?videoid=<%= rs.getItem("VideoID").getValue() %>&username=<%= rs.getItem("Username").getValue() %>&groupid=<%= rs.getItem("GroupID").getValue() %>"><img src="../Videoimage/<%= rs.getItem("Filename").getValue() %>.jpg" width="133" height="100" border="0" align="absmiddle" alt=<%= rs.getItem("Topic").getValue() %>></a></TD>                                    </TR></TBODY></TABLE></TD></TR>                    <TR>                              <TD vAlign=bottom align=middle                         height=20><a href="videoplay.jsp?videoid=<%= rs.getItem("VideoID").getValue() %>&username=<%= rs.getItem("Username").getValue() %>&groupid=<%= rs.getItem("GroupID").getValue() %>" title="<%= rs.getItem("Topic").getValue() %>"><%            a.set(rs.getItem("Topic").getValue());            if (vb.Len(a) > 8) {                a.set(vb.Left(a.toString(), 8.0) + "..");            }            Response.Write("" + a + "");%></a></TD>                            </TR></TBODY></TABLE></TD>                      <TD width=7 background=../Images/Hompy/box_right.gif height=122></TD>                    </TR>              <TR>                      <TD width=7 height=7><IMG height=7                   src="../Images/Hompy/box_bottom01.gif" width=7></TD>                      <TD width=137 background=../Images/Hompy/box_bottom03.gif height=7></TD>                      <TD width=7 background=../Images/Hompy/box_bottom02.gif               height=7></TD>                    </TR></TBODY></TABLE></td><%            if (n == m) {                Response.Write("</tr><tr>");                n = 1;            } else {                n = n + 1;            }            rs.MoveNext();            i = i + 1;        }        rs.Close();        rs = (jasp.adodb.Recordset)null;    }%></tr></table><table width="100%"  border="0" cellspacing="0" cellpadding="0">  <TR>    <TD height=5></TD></TR>  <TR>  <tr>      <td height="27" align="center" style="FONT-SIZE: 11px"> <%    Page();%>	</td>  </tr></table>          <table width="40%" height="45" border="0" cellpadding="0" cellspacing="0">            <tr>    <td><TABLE width="206">              <TBODY>              <FORM name=form onSubmit="return false;" method=get target=_self>                <INPUT   type=hidden value=0 name=boardNo>                <INPUT type=hidden value=傈眉焊扁 name=boardNm>                <INPUT type=hidden name=boardSeq>                <INPUT type=hidden value=9356721 name=fpnum>                <INPUT type=hidden value=??? name=fpname>                <INPUT type=hidden value=?????   name=fpid>                <INPUT type=hidden name=delseq>                <INPUT type=hidden value=4   name=degrees>                <INPUT type=hidden name=mode>                <INPUT type=hidden value=1   name=page>                <INPUT type=hidden name=sortType>                <INPUT type=hidden   name=searchType>                <INPUT type=hidden name=searchStr>                <INPUT type=hidden   value=10 name=listLine>                <INPUT type=hidden value=7 name=totalRow>                <TBODY>                  <TR>                     <TD><SELECT name=selsearchType>                        <option value="wpname">标题</option>                        <option value="title">内容</option>                      </SELECT> <INPUT  maxLength=35 size=15 name=searchTxt>                        <img src="../Images/Hompy/search_b.gif" align="absmiddle"></TD>                  </TR>              </FORM>            </TABLE></td>  </tr></table>        </div></TD>    </TR>  </TBODY></TABLE></body></html><%!     variant username;    variant groupid;    int currentpage;        //得到每页数    int mpage;    public void Page() throws Exception {        int pageno = 0;        variant viewmode = new variant();        int pp = 0;        int pno = 0;        int p = 0;        pageno = currentpage;        if (vb.IsEmpty(pageno) || vb.CInt(pageno) < 1 || vb.CInt(pageno) > mpage) {            pageno = 1;        }        Response.Write(" ");        if (vb.CInt(pageno) > 1) {            Response.Write("<a href=videolist.jsp?username=");            Response.Write(username);            Response.Write("&viewmode=");            Response.Write(viewmode);            Response.Write("&groupid=");            Response.Write(groupid);            Response.Write("&page=");            Response.Write(pageno - 1);            Response.Write(">");        }        Response.Write("<img src=\"../Images/Hompy/K_play_middle_pre.gif\" border=\"0\" align=\"absmiddle\">&nbsp;</a> ");        pp = vb.CInt(pageno) - 3;        if (pp < 1) {            pp = 1;        }        for(pno = pp; pno <= mpage; pno += 1){            p = p + 1;            if (pno == vb.CInt(pageno)) {                Response.Write("&nbsp;<strong><font color=\"#FF0000\">");                Response.Write(pno);                Response.Write("</font></strong>&nbsp;");            } else {                Response.Write("&nbsp;<a href=videolist.jsp?username=");                Response.Write(username);                Response.Write("&viewmode=");                Response.Write(viewmode);                Response.Write("&groupid=");                Response.Write(groupid);                Response.Write("&page=");                Response.Write(pno);                Response.Write("><u>");                Response.Write(pno);                Response.Write("</u></a>&nbsp;");            }            Response.Write("                    ");            if (p >= 7) {                if(true) break;            }        }        Response.Write("&nbsp;");        if (vb.CInt(pageno) < mpage) {            Response.Write("<a href=videolist.jsp?username=");            Response.Write(username);            Response.Write("&viewmode=");            Response.Write(viewmode);            Response.Write("&groupid=");            Response.Write(groupid);            Response.Write("&page=");            Response.Write(pageno + 1);            Response.Write(">");        }        Response.Write("<img src=\"../Images/Hompy/K_play_middle_next.gif\" border=\"0\" align=\"absmiddle\"></a> <a href=videolist.jsp?username=");        Response.Write(username);        Response.Write("&viewmode=");        Response.Write(viewmode);        Response.Write("&groupid=");        Response.Write(groupid);        Response.Write("&page=");        Response.Write(mpage);        Response.Write(">\n");        Response.Write("</a> ");    }%> <%    End();    } catch(Exception ex) {         printStackTrace(ex);    } %>

⌨️ 快捷键说明

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