像新闻更新系统?

时间:2022-02-26 09:01:52
文章标题起得不对!
   我接触这方面不是很久! 比较愚昧.
   1: 在CSDN首页面上,鼠标移到每一条新闻或其它标题上,可以看到
   http://www.csdn.net/news/newstopic/7/7827.shtml
   http://www.csdn.net/news/newstopic/7/7904.shtml
   .....
  我认为它是一个静态页面,这些静态页面是事先做好的,放到硬盘上.由程序调出.
  2: 在一些网站上,鼠标移到每一条新闻或其它标题上,可以看到
  http://xxx.xxx.xxx/open.asp?id=6546
  .....
样,点击时最后出现的是...13233.shtml页面.于是我认为这些静态页面也是事先做好的,
将url放到数据库中.文件还在硬盘上.

  但是,我觉得不应当是这样,这样每一个页都根事先做好,哪大型网站岂不是每天要做很多?
  于是我想,这些文件都是以数字开头,是不是先把文章内容以及图片上载到数据库中,然后
数据自动生成文件,再把生成的放到硬盘上.
  但是我又觉得这样很难,如果图片较多,在页面上放的位置可能是上,下,左,中,右.这样一个不可预知的页面怎样才能合理的生成?
  为什么它们都是.shtml而不是.htm呢?
  它们是怎样做的呢? 
  高人指点?


15 个解决方案

#1


:)
找本书看看

#2


不是吧

#3


那是怎样?

#4


对。那些都是静态的。后面的那个也只是为了统计点击数而设置的。统计后直接redirect到实际的静态页面。
shtm和htm不一样,它可以实现某些动态的功能。

#5


是静态页面,但是有的不是事先作好的,而是由程序生成的。自己下个例子看看。

#6


通过fso把数据库里面的文章生成静态的页面,当然,是依据事先定义好的模板生成的,至于图片的位置可以给图片分配一个标记,根据标记决定显示点位置

#7


经常是把数据放到文件或数据库里面,
然后用一个文件把他们调出来。

#8


我想也是模板,但如果有图片,哪图片周围如果有文字,像绕排.好做吗?

#9


shtml normally means SSI (server-side include) file, you can do some things with it, most notably, you can include dynamic contents with <!--#include file="new.asp" -->

I would think those shtml files on CSDN are static files and generated by a program after some editor or uploader inputs some content

#10


to cshadow(影子) :
   例子??  有例子可下?
   请指点!

#11


http://expert.csdn.net/Expert/topic/1103/1103905.xml?temp=.6563684

#12


提交一篇文章后,替换模板里面的关键字,然后用FSO来生成静态文件。

你可以下载一个名叫“新闻小偷”的ASP代码参考一下

#13


<%
  Dim s,h
  Dim objFSO,objFile

  h = chr(13) & chr(10) '回车加换行

  s = "<html>" & h & "<head>" & h & _
  "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & h & _
  "<meta name='author' content='F.R.Huang(meizz梅花雨)//www.meizz.com'>" & h & _
   h & _
  "<style>"& h & _
  "  a, body, div, li, p, span, td {font-size: 12px; cursor: default; color: #000000; text-decoration: none}"& h & _
  "</style>" & h & _
   h & _
  "<body leftmargin=2 topmargin=3 marginwidth=0 marginheight=0>" & h & _
   h & _
  "<table id='table1' width=100% border=0 cellpadding=0 cellspacing=0>" & h & _
  "  <tr><td>" & h

  Set objFSO  = Server.CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(Server.MapPath("meizz.htm"),2,true)
        objFile.write s

%>
  <!-- #include file='mdb.asp' -->
<%
  Dim rs
  Set rs = Server.CreateObject("ADODB.Recordset")

  rs.open "elect mTitle,mText from mHead where mID="& request("mID") &" order by mKind desc",conn
  do while not rs.eof
    objFile.writeline "    <center><span style='font-size: 14px'>"& Rs("mTitle") &"</span></center><br>"
    objFile.writeline "    <p>"& Rs("mText") &"</p>"
    rs.movenext
  loop
  objFile.writeline "  </td></tr>"&h
  rs.close : set rs = nothing : conn.close : set conn = nothing

        objFile.writeline "</table>"&h&h&"</body>"&h&h&"</html>"
    objFile.close : set objFile = nothing 
  Set objFSO = Nothing
%>

#14


内容管理系统么!偶以前就做这个的,用模板套用,一下,需要的时候,点一个按钮,新的静态页面就出来了,很方便的。主要是为了加快网站的访问速度,动态生成页面耗费网络和服务器资源,静态的就节省多了。

#15


谢谢大家了,这使我增加了不少见识.

#1


:)
找本书看看

#2


不是吧

#3


那是怎样?

#4


对。那些都是静态的。后面的那个也只是为了统计点击数而设置的。统计后直接redirect到实际的静态页面。
shtm和htm不一样,它可以实现某些动态的功能。

#5


是静态页面,但是有的不是事先作好的,而是由程序生成的。自己下个例子看看。

#6


通过fso把数据库里面的文章生成静态的页面,当然,是依据事先定义好的模板生成的,至于图片的位置可以给图片分配一个标记,根据标记决定显示点位置

#7


经常是把数据放到文件或数据库里面,
然后用一个文件把他们调出来。

#8


我想也是模板,但如果有图片,哪图片周围如果有文字,像绕排.好做吗?

#9


shtml normally means SSI (server-side include) file, you can do some things with it, most notably, you can include dynamic contents with <!--#include file="new.asp" -->

I would think those shtml files on CSDN are static files and generated by a program after some editor or uploader inputs some content

#10


to cshadow(影子) :
   例子??  有例子可下?
   请指点!

#11


http://expert.csdn.net/Expert/topic/1103/1103905.xml?temp=.6563684

#12


提交一篇文章后,替换模板里面的关键字,然后用FSO来生成静态文件。

你可以下载一个名叫“新闻小偷”的ASP代码参考一下

#13


<%
  Dim s,h
  Dim objFSO,objFile

  h = chr(13) & chr(10) '回车加换行

  s = "<html>" & h & "<head>" & h & _
  "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & h & _
  "<meta name='author' content='F.R.Huang(meizz梅花雨)//www.meizz.com'>" & h & _
   h & _
  "<style>"& h & _
  "  a, body, div, li, p, span, td {font-size: 12px; cursor: default; color: #000000; text-decoration: none}"& h & _
  "</style>" & h & _
   h & _
  "<body leftmargin=2 topmargin=3 marginwidth=0 marginheight=0>" & h & _
   h & _
  "<table id='table1' width=100% border=0 cellpadding=0 cellspacing=0>" & h & _
  "  <tr><td>" & h

  Set objFSO  = Server.CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(Server.MapPath("meizz.htm"),2,true)
        objFile.write s

%>
  <!-- #include file='mdb.asp' -->
<%
  Dim rs
  Set rs = Server.CreateObject("ADODB.Recordset")

  rs.open "elect mTitle,mText from mHead where mID="& request("mID") &" order by mKind desc",conn
  do while not rs.eof
    objFile.writeline "    <center><span style='font-size: 14px'>"& Rs("mTitle") &"</span></center><br>"
    objFile.writeline "    <p>"& Rs("mText") &"</p>"
    rs.movenext
  loop
  objFile.writeline "  </td></tr>"&h
  rs.close : set rs = nothing : conn.close : set conn = nothing

        objFile.writeline "</table>"&h&h&"</body>"&h&h&"</html>"
    objFile.close : set objFile = nothing 
  Set objFSO = Nothing
%>

#14


内容管理系统么!偶以前就做这个的,用模板套用,一下,需要的时候,点一个按钮,新的静态页面就出来了,很方便的。主要是为了加快网站的访问速度,动态生成页面耗费网络和服务器资源,静态的就节省多了。

#15


谢谢大家了,这使我增加了不少见识.