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

📄 magazine.asp

📁 一个不错的企业网站源代码!
💻 ASP
字号:
<%@ Language=VBScript%>
<%
Response.Buffer=false
Response.Expires=0
%>
<!-- #include file="dsnroot.asp" -->
<!-- #include file="links.asp" -->
<%
set cn=Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs=server.CreateObject("ADODB.Recordset")
pid=Request.QueryString ("pid")
id=Request.QueryString ("id")
pgno=Request.QueryString ("pgno")
if pid="" then
		pid=0
	else
		pid=cint(pid)
end if
if id="" then
		id=0
	else
		id=cint(id)
end if		
if pid=0 then
		sqltext="select top 1 id from danwei where enable=1 and pid=3 order by pl desc"		
		rs.Open sqltext,cn,1,1
		if not rs.EOF then
				pid=rs("id")
		end if
		rs.Close 
end if
if id=0 then
		sqltext="select top 1 id from cdanwei where enable=1 and ppid=3 and pid="&pid&" order by pl"
		rs.Open sqltext,cn,1,1
		if not rs.EOF then
				id=rs("id")
		end if
		rs.Close 
end if	
%>
<html>
<head>
<title>大连海昌集团有限公司</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="FONT.CSS" type="text/css">
</head>

<body bgcolor="#663300" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="778" border="0" cellspacing="0" cellpadding="0" bgcolor="#663300">
  <tr> 
    <td width="355" rowspan="2"><img src="images/magazine/magazine_r1_c1.jpg" width="355" height="106"></td>
    <td rowspan="2">&nbsp;</td>
    <td width="275"><img src="images/magazine/magazine_r1_c3.jpg" width="275" height="80"></td>
    <td rowspan="2" background="images/magazine/shadow_right.jpg" width="8"></td>
  </tr>
  <tr> 
    <td> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td>&nbsp;</td>
          <td class="font2" width="100">
             <select name="select2" class=input3 onChange="Javascript:load(this)">
                    <%sqltext="select id,name from danwei where enable=1 and pid=3 order by pl desc"
                      rs.Open sqltext,cn,1,1
                      do while not rs.EOF 
                          if pid=rs("id") then
								ptitle=trim(rs("name"))%>
								<option value="<%=linkmagazine%>?pid=<%=rs("id")%>"  target=_top selected><%=trim(rs("name"))%></option>
						  <%else%>		
								<option value="<%=linkmagazine%>?pid=<%=rs("id")%>"  target=_top><%=trim(rs("name"))%></option>
                          <%end if%>
							
					<%rs.MoveNext 
					  loop
					  rs.Close %>		
             </select>&nbsp;&nbsp;&nbsp;&nbsp;
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table width="778" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" height="100%">
  <tr>
    <td width="200" valign="top" align="center"> 
      <table width="190" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="center"><img src="images/magazine/tp_list.gif" width="190" height="18"></td>
        </tr>
      </table>
      <%sqltext="select * from cdanwei where enable=1 and pid="&pid&" and ppid=3 order by pl"
        rs.Open sqltext,cn,1,1
        do while not rs.EOF 
        if id=rs("id") then
				fontcolor="#663300"
				title=trim(rs("name"))
				dateenable=rs("dateenable")
				creatdate=rs("creatdate")
				title1=trim(rs("name2"))
				content=checkstr(trim(rs("body")))&"<br>"
			else
				fontcolor="#000000"	
        end if
        %>
      <table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr> 
          <td colspan="2" height="10"></td>
        </tr>
        <tr> 
          <td width="15" class="font3" valign="top">※</td>
          <td><a href="<%=linkmagazine%>?id=<%=rs("id")%>&pid=<%=pid%>" class="nav2"><font color="<%=fontcolor%>"><%=trim(rs("name"))%></font></a></td>
        </tr>
      </table>
      <%rs.MoveNext 
        loop
        rs.Close %>
    </td>
    <td background="images/magazine/shadow_1.jpg" width="10">&nbsp;</td>
    <td background="images/magazine/shadow_2.jpg" width="16">&nbsp;</td>
    <td background="images/magazine/bg.jpg" style="background-repeat: repeat-y; background-position: right" valign="top"> 
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td align="center"><b><font color="#663300"><%=title%></font></b></td>
        </tr>
        <%if title1<>"" then%>
        <tr height=30>
          <td align="center" class=font1><%=title1%></td>
        </tr>
        <%end if%>
        <%if dateenable=1 then%>
        <tr>
          <td align="right" class=font1><%=creatdate%></td>
        </tr>
        <%end if%>
      </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="10"></td>
        </tr>
        <tr> 
          <td background="images/magazine/line_h2.gif" height="1"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="font1">
                            <%
               if content<>"" then
                            if pgno="" or pgno=0 then pgno=1
                            x=0  '总段数
                            star=1
                            z=0 '显示的段数
                            pgno=cint(pgno)  '页数
                            tot=25  '每页显示的段数
                            do while instr(star,content,"<br>")>0 
								x=x+1
								star=instr(star,content,"<br>")+1
                            loop
                             if x mod tot=0 then
								pgs=x/tot
							else
								pgs=cint(x/tot)+1
							end if	
							pgs=pgs-1
							if pgs=0 then
									pgs=1
							end if
							if x=0 then x=1
                            a=1
                            pgtext=""
							for y=1 to x
								z=instr(a,content,"<br>")
								if y>=tot*pgno-tot+1 and y<=tot*pgno then
										if pgno>1 then
												pgtext=pgtext&mid(content,a-1,z-a+1)
											else
												pgtext=pgtext&mid(content,a,z-a+1)
										end if
												
								end if
							a=z+1
							next
							if pgno=1 then
								pgtext=mid(pgtext,1,len(pgtext)-1)
							end if	
                            Response.Write pgtext
                 end if
                            %>          
          </td>
        </tr>
      </table>
    </td>
    <td background="images/magazine/shadow_right.jpg" width="8">&nbsp;</td>
  </tr>
</table>
<table width="778" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" height="10%">
  <tr> 
    <td width="200" valign="top" align="center">
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td>&nbsp;</td>
        </tr>
        <tr> 
          <td background="images/magazine/line_h2.gif" height="1"></td>
        </tr>
        <tr> 
          <td height="30" class=font1><%=ptitle%></td>
        </tr>
      </table>
    </td>
    <td background="images/magazine/shadow_1.jpg" width="10">&nbsp;</td>
    <td background="images/magazine/shadow_2.jpg" width="16">&nbsp;</td>
    <td background="images/magazine/bg.jpg" style="background-repeat: repeat-y; background-position: right" valign="top"> 
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td colspan="3">&nbsp;</td>
        </tr>
        <tr> 
          <td background="images/magazine/line_h2.gif" height="1" colspan="3"></td>
        </tr>
        <tr> 
          <td height="30" width="350" class=font1><%=pgno%>/<%=pgs%>页&nbsp;&nbsp;&nbsp;&nbsp;
          <%if pgno>1 then%>
               <a href="<%=linkmagazine%>?id=<%=id%>&pid=<%=pid%>&pgno=<%=pgno-1%>" class="nav2">上一页&gt;&gt;</a>&nbsp;&nbsp;
          <%end if%>
          <%if pgno < pgs then%>
               <a href="<%=linkmagazine%>?id=<%=id%>&pid=<%=pid%>&pgno=<%=pgno+1%>" class="nav2">下一页&gt;&gt;</a>
          <%end if%>
          </td>
          <td height="30">&nbsp;</td>
          <td height="30" width="100" align="right"><a href="#top"><img src="images/magazine/bt_top2.gif" width="50" height="18" border="0"></a></td>
        </tr>
      </table>
    </td>
    <td background="images/magazine/shadow_right.jpg" width="8">&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
function checkstr(str)
    dim re
    Set re=new RegExp
    re.IgnoreCase =true
    re.Global=True

    re.Pattern="(script)"
    str=re.Replace(str,"sc ript")
    re.Pattern="(>"+chr(13)+")"
    str=re.Replace(str,">")
    re.Pattern="(> "+chr(13)+")"
    str=re.Replace(str,">")
    re.Pattern="(>  "+chr(13)+")"
    str=re.Replace(str,">")

    re.Pattern="("+chr(13)+")"
    str=re.Replace(str,"<br>&nbsp;&nbsp;")

	str="&nbsp;&nbsp;&nbsp;"+str
	checkstr=str
end function	
%>
<%
function checktitle(str,cd)
		a=len(str)
		if a>cd then
				checktitle=left(str,cd)+"...."
			else
				checktitle=str
		end if
end function
%>
<%
function checkstr1(str)
    dim re
    Set re=new RegExp
    re.IgnoreCase =true
    re.Global=True

    re.Pattern="(script)"
    str=re.Replace(str,"sc ript")
    re.Pattern="(>"+chr(13)+")"
    str=re.Replace(str,">")
    re.Pattern="(> "+chr(13)+")"
    str=re.Replace(str,">")
    re.Pattern="(>  "+chr(13)+")"
    str=re.Replace(str,">")

    re.Pattern="("+chr(13)+")"
    str=re.Replace(str,"<br>")

	checkstr1=str
end function	
%>
<script language=Javascript>
	function load(sel) {
		var url = sel.options[sel.selectedIndex].value;
		if (url != ""){
			if (typeof(sel.options[sel.selectedIndex].target)!="undefined"){
				open(url, sel.options[sel.selectedIndex].target);
			}else{
				eval(sel.options[sel.selectedIndex].value)
			}
			sel.selectedIndex=0
		}
		else{
					
		}				
		return false;
	}
</script>

⌨️ 快捷键说明

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