- 注册时间
- 2005-3-18
- 最后登录
- 1970-1-1
|
今天在弄一个网站
被一个问题难住了 特来求助
一个网站 在首页用JavaScript 调用数据库内的新闻标题 以及发布时间 在首页显示出来
index里 调用新闻部分如下- <script src=news.asp?typeid=18&shu=12></script>
复制代码 其中 typeid 是新闻类型 shu 就是显示新闻的数目 12条
现在 显示出来的格式
就是如下 geshi图
现在想要
新闻发布时间在最后面显示 也就是时间靠右显示 让新闻标题 靠左
其中调用 news.asp 里 代码如下- <%
- dim shu,news,bigclassid,smallclassid,specialid,order,time,path,click,title
- bigclassid=checkstr(request.querystring("bigclassid"))
- typeid=checkstr(request.querystring("typeid"))
- smallclassid=checkstr(request.querystring("smallclassid"))
- specialid=checkstr(request.querystring("specialid"))
- shu=checkstr(request.querystring("shu"))
- order=checkstr(request("order"))
- time=checkstr(request.querystring("time"))
- title=checkstr(request.querystring("title"))
- click=checkstr(request.querystring("click"))
- Path = "./"
- if shu<>"" then '显示数目,不加为5
- ss=shu
- else
- ss=10
- end if
- if order="click" then '排序方式,click为按点击率
- oo="click"
- else
- oo="newsid"
- end if
- if time="0" then '显示时间,0为不显示
- tt=0
- else
- tt=1
- end if
- if click="0" then '显示点击数,0为不显示
- cc=0
- else
- cc=1
- end if
- if title<>"" then '显示数目,不加为5
- nn=title
- else
- nn=70
- end if
- if typeid<>"" then
- set rs=conn.execute("SELECT top "&ss&" * FROM news where typeid=cint("&typeid&") and checkked=1 order by "&oo&" desc")
- else
- if bigclassid<>"" then
- set rs=conn.execute("SELECT top "&ss&" * FROM news where bigclassid=cint("&bigclassid&") and checkked=1 order by "&oo&" desc")
- else
- if smallclassid<>"" then
- set rs=conn.execute("SELECT top "&ss&" * FROM news where smallclassid=cint("&smallclassid&") and checkked=1 order by "&oo&" desc")
- else
- if specialid<>"" then
- set rs=conn.execute("SELECT top "&ss&" * FROM news where specialid=cint("&specialid&") and checkked=1 order by "&oo&" desc")
- else
- set rs=conn.execute("SELECT top "&ss&" * FROM news where checkked=1 order by "&oo&" desc")
- end if
- end if
- end if
- end if
- if rs.eof and rs.bof then %>
- document.write('没有');
- <% else
- do while not rs.eof
- title=trim(rs("title"))
- title=replace(title,"
- ","")
- if strcomp(left(title,nn),title)<0 then
- %>
- document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666">[<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>]<% end if %><%if year(rs("updatetime"))=year(date()) and month(rs("updatetime"))=month(date()) and day(rs("updatetime"))=day(date()) then%><img src="images/new.gif"><%end if%></FONT>
- ');
- <%else%>
- document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666">[<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>]<% end if %> <%if year(rs("updatetime"))=year(date()) and month(rs("updatetime"))=month(date()) and day(rs("updatetime"))=day(date()) then%><img src="images/new.gif"><%end if%></FONT>
- ');
- <%
- end if
- rs.movenext
- loop
- end if
- Rs.Close
- set Rs=nothing
- %>
复制代码 关键就是这句- document.write(' · <font class=3><A href="<%=path%>ReadNews.asp?NewsID=<%=rs("NewsID")%>" title="<%=title%>" target="_blank"><%=left(title,nn)%></A><%if tt=1 then%><FONT color="#666666">[<%=month(rs("updatetime"))%>-<%=day(rs("updatetime"))%>]<% end if %><%if year(rs("updatetime"))=year(date()) and month(rs("updatetime"))=month(date()) and day(rs("updatetime"))=day(date()) then%><img src="images/new.gif"><%end if%></FONT>
- ');
复制代码 这句是写标题和时间到屏幕的
updatetime 就是发布时间
我怎么改 才能让时间按靠右显示呢
知道的 告诉我下哈~ |
-
|