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

📄 newpost.asp

📁 这是ASP的OA
💻 ASP
字号:
<!-- #include file="const.asp" -->
<%
call opendb()
dim sql,rs,i,id,psize,forumid,uploadfile,filepath,fileext
forumid=request.QueryString("forumid")
if forumid<>"" then
	if not IsNumeric(forumid) then
		response.Write("非法参数!")
	end if
end if
psize=30
position "查看论坛新帖",0
%>
<html>
<head>
<title><%=sitename%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="refresh" content="180;url=newpost.asp">
<link href="images/css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="10" align="center" valign="top"> <!-- #include file="topbar.asp" --> </td>
  </tr>
  <tr> 
    <td align="center" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="12" bgcolor="#ECE9D9">&nbsp;</td>
          <td width="1" bgcolor="#E8BC3C"></td>
          <td width="10">&nbsp;</td>
          <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
              <tr> 
                <td width="100%" height="26"><span class="v8"><img src="images/btn_face.gif" width="10" height="7"> 
                  <a href="index.asp"><%=sitename%></a> <FONT face=Webdings color="#660000">8</FONT> 
                  </span><span class="v7b">论坛新帖</span></td>
              </tr>
              <tr> 
                <td height="1" bgcolor="#ECE9D9"></td>
              </tr>
            </table>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="12"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="130" height="12" bgcolor="#990000">&nbsp;<span class="v8b">&nbsp;<img src="images/fang-1.gif" align="absmiddle"> 
                        </span><span class="v7"><font color="#FFFFFF">最新<%=psize%>帖</font></span></td>
                      <td height="12" nowrap bgcolor="#CCCCCC" class="v8b">&nbsp;</td>
                    </tr>
                  </table>
                  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                    <tr bgcolor="#FFFFFF"> 
                      <td valign="top" class="v7"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#DCD6BA">
                          <tr> 
                            <td width="32" background="images/bg4.gif" bgcolor="#ECE9D9">&nbsp;</td>
                            <td width="401" background="images/bg4.gif" bgcolor="#ECE9D9">主题</td>
                            <td width="86" align="center" background="images/bg4.gif" bgcolor="#ECE9D9">作者</td>
                            <td width="122" align="center" background="images/bg4.gif" bgcolor="#ECE9D9">所在论坛</td>
                            <td width="130" align="center" background="images/bg4.gif" bgcolor="#ECE9D9">发表时间</td>
                          </tr>
<%
	if forumid<>"" then
		sql="select top "&cstr(psize)&" bbs.topic,bbs.uploadfile,bbs.filepath,bbs.name,bbs.face,bbs.FID,bbs.addtime,bbs.id,forum.ftitle from m3_bbs as bbs,m3_forum as forum where ((bbs.valid=1) and (forum.FID=bbs.FID) and bbs.FID="&forumid&" and bbs.valid=1) order by bbs.addtime desc"
	else
		sql="select top "&cstr(psize)&" bbs.topic,bbs.uploadfile,bbs.filepath,bbs.name,bbs.face,bbs.FID,bbs.addtime,bbs.id,forum.ftitle from m3_bbs as bbs,m3_forum as forum where ((bbs.valid=1) and (forum.FID=bbs.FID) and (bbs.valid=1)) order by bbs.addtime desc"
	end if
	set rs=server.CreateObject("ADODB.RecordSet")
	rs.open sql,conn,1,1
	if not (rs.bof and rs.eof) then
		i=0
		do while (not rs.eof) and (i<psize)
			i=i+1
			id=rs("ID")
			uploadfile=trim(rs("uploadfile"))
			filepath=trim(rs("filepath"))
	%>
                          <tr bgcolor="#FFFFFF" height="20"> 
                            <td height="24" align="center"> <a href="treelist.asp?id=<%=id%>" target="_blank" title="新开窗口阅读此帖!"><img src="images/f<%=trim(rs("face"))%>.gif" border="0"></a></td>
                            <td height="24">&nbsp;
							<%
							if  uploadfile<>"" and filepath<>"" then
								fileext=getext(uploadfile)
								if fileext="jpg" or fileext="gif" or fileext="jpeg" or fileext="bmp" then
									response.write("<a href='ViewBigImage.asp?url="&filepath&"' target=_blank><img src='images/"&fileext&".gif' border=0 align=absmiddle alt=按此在新窗口浏览图片></a>")
								else
									response.write("<a href='DownLoadFile.asp?id="&trim(filepath)&"' target=_blank><img src='images/"&fileext&".gif' border=0 align=absmiddle alt=按此下载该帖子附件></a>")
								end if
							end if
							%>
							<a href="treelist.asp?id=<%=id%>"><%=rs("topic")%></a></td>
                            <td height="24" align="center" bgcolor="#F1F3D6"> 
                              <a href='profile.asp?name=<%=rs("name")%>' target="_blank"><%=rs("name")%></a></td>
                            <td height="24" align="center" bgcolor="#FFFFFF"><a href="list.asp?forumid=<%=rs("FID")%>"><%=rs("ftitle")%></a></td>
                            <td height="24" align="center" bgcolor="#FFFFFF"> 
                              <%=rs("addtime")%></td>
                          </tr>
                          <%
			rs.movenext
		loop
	else
		response.Write("<tr><td colspan=5 bgcolor=#FFFFFF height=30>&nbsp;&nbsp;暂时没有任何新帖  ... </td></tr>")
	end if
	rs.close
	set rs=nothing
%>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="2" bgcolor="#ECE9D9"></td>
                    </tr>
                  </table></td>
              </tr>
            </table>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td><img src="images/blank.gif" width="1" height="2"></td>
              </tr>
            </table>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td> <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
                    <tr bgcolor="#FFFFFF"> 
                      <td valign="top" class="v7"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F1F0E4">
                          <form name="pageform" method="post" action="search.asp">
                            <tr> 
                              <td width="33%" nowrap><font color="#666666">&nbsp;· 
                                本页面每3分钟自动刷新一次</font></td>
                              <td width="67%" align="right">&nbsp;+ 跳转论坛至:</font> <select name="where3" class="select" id="where3" onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
                                  <%
					  dim tmprs1,tmprs2,tmpcid,tmpsql
					  tmpsql="select * from m3_category where CValid=1 order by CIndex asc"
					  set tmprs1=server.CreateObject("adodb.recordset")
					  set tmprs2=server.CreateObject("adodb.recordset")
					  tmprs1.open tmpsql,conn,1,1
					  do while not tmprs1.eof
					  		response.write("<option value=""category.asp?cid="&tmprs1("CID")&""">"&tmprs1("CTitle")&"</option>")
							tmpsql="select FID,FTitle from m3_forum where CID="&tmprs1("CID")&" and FValid=1 order by FIndex asc"
							tmprs2.open tmpsql,conn,1,1
							do while not tmprs2.eof
								response.write("<option value=""list.asp?forumid="&tmprs2("FID")&""">&nbsp;&nbsp;- "&tmprs2("FTitle")&"</option>")
								tmprs2.movenext
							loop
							tmprs2.close
							tmprs1.movenext
					  loop
					  tmprs1.close
					  set tmprs1=nothing
					  set tmprs2=nothing
						%>
                                </select> &nbsp;</td>
                            </tr>
                          </form>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="2" bgcolor="#ECE9D9"></td>
                    </tr>
                  </table></td>
              </tr>
            </table>
            <br> <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr> 
                <td height="12"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td width="130" height="16" bgcolor="#A0AB6D">&nbsp;<span class="v8b">&nbsp;<img src="images/fang-1.gif" align="absmiddle"> 
                        </span><span class="v7"><font color="#FFFFFF">帖子搜索</font></span></td>
                      <td height="16" nowrap bgcolor="#CCCCCC" class="v8b">&nbsp;</td>
                    </tr>
                  </table>
                  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
                    <tr bgcolor="#FFFFFF"> 
                      <td valign="top" class="v7"><table border="0" cellspacing="0" cellpadding="0" width=400>
                          <form name="schform" method="post" action="search.asp">
                            <tr> 
                              <td nowrap> 关键词: 
                                <input name="keyword" type="text" class=input1 id="keyword" size="10" maxlength="30"> 
                                &nbsp;&nbsp;类别: 
                                <select name="type" id="type" class="input1">
                                  <option value="1">标题</option>
                                  <option value="2">作者</option>
                                </select> &nbsp;&nbsp;范围: 
                                <select name="where" class="select" id="where">
                                  <%
					  tmpsql="select * from m3_category where CValid=1 order by CIndex asc"
					  set tmprs1=server.CreateObject("adodb.recordset")
					  set tmprs2=server.CreateObject("adodb.recordset")
					  tmprs1.open tmpsql,conn,1,1
					  do while not tmprs1.eof
					  		response.write("<option value="""&tmprs1("CID")&""">"&tmprs1("CTitle")&"</option>")
							tmpsql="select FID,FTitle from m3_forum where CID="&tmprs1("CID")&" and FValid=1 order by FIndex asc"
							tmprs2.open tmpsql,conn,1,1
							do while not tmprs2.eof
								response.write("<option value="""&tmprs2("FID")&""">&nbsp;&nbsp;- "&tmprs2("FTitle")&"</option>")
								tmprs2.movenext
							loop
							tmprs2.close
							tmprs1.movenext
					  loop
					  tmprs1.close
					  set tmprs1=nothing
					  set tmprs2=nothing
					  call closedb()
						%>
                                </select> <input name="imageField" type="image" src="images/sch1.gif" align="middle" width="16" height="14" border="0"> 
                                &nbsp; </td>
                            </tr>
                          </form>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="2" bgcolor="#ECE9D9"></td>
                    </tr>
                  </table></td>
              </tr>
            </table> </td>
          <td width="10">&nbsp;</td>
          <td width="1" bgcolor="#E8BC3C"></td>
          <td width="100" bgcolor="#ECE9D9" valign="top">  
            <!-- #include file="right.asp" -->
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td height="10" align="center" valign="bottom"> 
      <!-- #include file="bottombar.asp" -->
    </td>
  </tr>
</table>
</body>
</html>
<%
function getext(filename)
	if isnull(filename) then exit function
	if instr(filename,".")>0 then
		getext=lcase(mid(filename,instrRev(filename,".")+1))
	else
		getext=""
	end if
end function
%>

⌨️ 快捷键说明

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