Php + js Code for implementing Sina sliding Course

Source: Internet
Author: User

<% @ LANGUAGE = "VBSCRIPT" CODEPAGE = "936" %>
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN"

Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<Style type = "text/css">
<! --

# Header1 {
Background-color: # ffffff;
Height: 200px;
Width: 500px;
Margin: 0px;
Padding: 0px;
Border: 0px;
Font-family: "";
Font-size: 12px;
Line-height: 150%;
}
# Menu1 {
Margin: 0px;
Padding: 0px;
List-style-type: none;
}
# Menu1 li {
Display: block;
Width: 100px;
Text-align: center;
Float: left;
Margin: 0px;
Padding-top: 0.2em;
Padding-right: 0px;
Padding-bottom: 0.2em;
Padding-left: 0px;
Cursor: hand;


}
# Main1 li
{
List-style-type: none;

}
. Sec1 {background-color: # FFFFCC ;}
. Sec2 {background-color: # FEB97A ;}
. Block {display: block ;}
. Unblock {display: none ;}
A: link {COLOR: #000000; TEXT-DECORATION: none}
A: visited {COLOR: #000000; TEXT-DECORATION: none}
A: active {COLOR: #000000; TEXT-DECORATION: none}
A: hover {RIGHT: 0px; COLOR: # ff0000; POSITION: relative; TOP: 1px; TEXT-DECORATION:

Underline}
-->
</Style>
<%
Function InterceptString (txt, length) 'intercepts characters based on different Chinese and English characters
Txt = trim (txt)
X = len (txt)
Y = 0
If x> = 1 then
For ii = 1 to x
If asc (mid (txt, ii, 1) <0 or asc (mid (txt, ii, 1)> 255 then' if it is a Chinese character
Y = y + 2
Else
Y = y + 1
End if
If y> = length then
Txt = left (trim (txt), ii) 'string length limit
Exit
End if
Next
InterceptString = txt
Else
InterceptString = ""
End if

End Function

Dim

Conn, rs1, type1, MM_conn_STRING, rs2, type2, SQL1, SQL2, SQL3, SQL4, SQL5, rs3, rs4, rs5, type3, type4, t

Ype5
MM_conn_STRING = "Driver = {SQL

Server}; database = sanxt; server = localhost; uid = sanxt; pwd = sanxt ;"
Set conn = Server. Createobject ("ADODB. Connection ")
Conn. open MM_conn_STRING
Set rs1 = Server. CreateObject ("ADODB. recordset ")
Type1 = "Art News"
SQL1 = "SELECT top 7 id, caption, content, puttime FROM ccnews where classid = '" & Trim (type1 )&"'

Order by id desc"
Rs1.open SQL1, conn, 1, 3

%>
</Head>
<Body>
<Script language = javascript>
Function secBoard1 (n)

{

For (I = 0; I <menu1.childNodes. length; I ++)
Menu1.childNodes. className = "sec1 ";
Menu1.childNodes [n]. className = "sec2 ";

For (I = 0; I <main1.childNodes. length; I ++)
Main1.childNodes. style. display = "none ";
Main1.childNodes [n]. style. display = "block ";

}

</Script>

<Div id = "header1">
<Ul id = "menu1">
<Li onMouseOver = "secBoard1 (0)" class = "sec2"> Art News </li>
<Li onMouseOver = "secBoard1 (1)" class = "sec1"> Tibetan exchanges </li>
<Li onMouseOver = "secBoard1 (2)" class = "sec1"> archaeological discoveries </li>
<Li onMouseOver = "secBoard1 (3)" class = "sec1"> special news </li>
<Li onMouseOver = "secBoard1 (4)" class = "sec1"> San Xitang news </li>
</Ul>

<! -- Content display area -->

<Ul id = "main1">
<Li class = "block">
<%
Do while not rs1.eof
%>
· <A href = "../zxzx/shownews. asp? Id = <% = rs1 ("id") %> "target = _ blank> <% = InterceptString (rs1

("Caption ") &"...................................... .... ", 48) %

> </A> <% = FormatDateTime (rs1 ("puttime"), "2") %>
<Br/> <% rs1.movenext
Loop
%> </Li> <%
Rs1.close
Set rs1 = nothing
%>

<Li class = "unblock"> <%
Set rs2 = Server. CreateObject ("ADODB. recordset ")
Type2 = "Tibetan exchanges"
SQL2 = "SELECT top 7 id, caption, content, puttime FROM ccnews where classid = '" & Trim

(Type2) & "'order by id desc"
Rs2.open SQL2, conn, 1, 3
Do while not rs2.eof %> · <a href = "../zxzx/shownews. asp? Id = <% = rs2 ("id") %>"

Target = _ blank> <% = InterceptString (rs2 ("caption ")

&"...................................... .... ", 48) %> </a> <%

= FormatDateTime (rs2 ("puttime"), "2") %> <br/>
<% Rs2.movenext
Loop %> </li>
<% Rs2.close
Set rs2 = nothing
%>

<Li class = "unblock"> <%
Set rs3 = Server. CreateObject ("ADODB. recordset ")
Type3 = "Archaeological Discoveries"
SQL3 = "SELECT top 7 id, caption, content, puttime FROM ccnews where classid = '" & Trim

(Type3) & "'order by id desc"
Rs3.open SQL3, conn, 1, 3
Do while not rs3.eof %> · <a href = "../zxzx/shownews. asp? Id = <% = rs3 ("id") %>"

Target = _ blank> <% = InterceptString (rs3 ("caption ")

&"...................................... .... ", 48) %> </a> <%

= FormatDateTime (rs3 ("puttime"), "2") %> <br/> <% rs3.movenext
Loop %> </li>
<% Rs3.close
Set rs3 = nothing
%>


<Li class = "unblock"> <%
Set rs4 = Server. CreateObject ("ADODB. recordset ")
Type4 = "website announcement"
SQL4 = "SELECT top 7 id, caption, content, puttime FROM ccnews where classid = '" & Trim

(Type4) & "'order by id desc"
Rs4.open SQL4, conn, 1, 3
Do while not rs4.eof %> · <a href = "../zxzx/shownews. asp? Id = <% = rs4 ("id") %>"

Target = _ blank> <% = InterceptString (rs4 ("caption ")

&"...................................... .... ", 48) %> </a> <%

= FormatDateTime (rs4 ("puttime"), "2") %> <br/> <% rs4.movenext
Loop %> </li>
<% Rs4.close
Set rs4 = nothing
%>

 

<Li class = "unblock"> <%
Set rs5 = Server. CreateObject ("ADODB. recordset ")
Type5 = "special news"
SQL5 = "SELECT top 7 id, caption, content, puttime FROM ccnews where classid = '" & Trim

(Type5) & "'order by id desc"
Rs5.open SQL5, conn, 1, 3
Do while not rs5.eof %> · <a href = "../zxzx/shownews. asp? Id = <% = rs5 ("id") %>"

Target = _ blank> <% = InterceptString (rs5 ("caption ")

&"...................................... .... ", 48) %> </a> <%

= FormatDateTime (rs5 ("puttime"), "2") %> <br/> <% rs5.movenext
Loop %> </li>
<% Rs5.close
Set rs5 = nothing
%>
</Ul>
<! -- Content display area -->
</Div>

</Body>
</Html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.