出来るのだASP Q&A掲示板(過去LOG)
訪問数 52046
昨日 889
今日 776 【PR】 パソコン入門からIT専門書まで幅広く取り揃えています。セブン-イレブン受取り手数料無料のセブンアンドワイ。 |
![]() ![]() ![]() ![]() ![]() |
[4611] Re:ASPでの掲示板作成について |
投稿者:Lightningさん 2004/08/26 12:49:29 |
データの形態を教えてもらえないんで&面倒なのでASPオンリーの奴をage ASP部index.asp <% dim no(100),RootNo(100),Title(100),aDate(100),name(100) OpenNo = Request.QueryString("no") set objFSO = Server.CreateObject("Scripting.FileSystemObject") mappath = Server.Mappath("./data.txt") set objTS = objFSO.OpenTextFile(mappath) i = 0 Do until objTS.AtEndOfStream tmp = split(objTS.ReadLine,",") no(i) = tmp(0) RootNo(i) = tmp(1) Title(i) = tmp(2) aDate(i) = tmp(3) name(i) = tmp(4) i = i +1 loop objTS.close set objTS = nothing set objFSO = nothing EndCount = i - 1 %> <html> <head> <title>test</title> </head> <body> <table> <tr> <th> カテゴリ </th> <th> 件名 </th> <th> 作成日 </th> <th> 作成者 </th> </tr> <% for i = 1 to EndCount %> <% if RootNo(i) = OpenNo or no(i) = 0 then %> <tr> <td> <% if No(i) = 0 then %> <% if RootNo(i) = openNo then %> <a href="./index.asp?no=">▲</a> <% else %> <a href="./index.asp?no=<%=RootNo(i)%>">▼</a> <% end if %> <% else %> <br> <% end if %> </td> <td> <%=title(i)%> </td> <td> <%=aDate(i)%> </td> <td> <%=name(i)%> </td> </tr> <% end if %> <% next %> </table> </body> </html> データ部data.txt NO,ROOTNO,Title,Date,Name 0,0,○○のお知らせ,2004/08/01,テスト タロウ 1,0,○△の通知,2004/07/30,テスト ジロウ 2,0,○◇ニュース,2004/07/27,テスト タロウ 0,1,○○のお知らせ,2004/08/01,テスト タロウ 1,1,○△の通知,2004/07/30,テスト ジロウ 2,1,○◇ニュース,2004/07/27,テスト タロウ RootNoが記事番号でNoが記事の中の番号になります。 あとは、これを見ながら、動作の勉強なりしてください |
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
TreeBBS For ASP V.0.1.3 |