Ik zit met het volgende probleem...
Ik wil voor HotTopic een Active Topics in XML maken.... Zoals je kan zien het het topic is het mij reeds gelukt...
Er is echter een klein probleem.
Als ik nu gewoon de pagina opvraag, krijg ik alleen de inhoud van de tags te zien, maar niet de XML pagina als zodanig...
zie:
Weet iemand wat ik fout doe of wat ik eraan moet doen om het wel op de juiste manier weergegeven te krijgen...
Ik wil voor HotTopic een Active Topics in XML maken.... Zoals je kan zien het het topic is het mij reeds gelukt...
PHP:
1
| <?<!--#INCLUDE FILE="config.asp" --><%dim fso, bestand, refreshtijd, xfiledim my_ConnResponse.ContentType = "text/xml"set my_Conn = Server.CreateObject("ADODB.Connection")my_Conn.Open strConnString bestand = "cache.xml" refreshtijd = 15 Set fso = Server.CreateObject("Scripting.FileSystemObject") if fso.FileExists(Server.MapPath(bestand)) Then dim leeftijd, fo set fo = fso.getFile(Server.MapPath(bestand)) leeftijd = datediff("s",fo.DateLastModified, now()) if(leeftijd < refreshtijd) then set fo = fo.OpenAsTextStream response.write(fo.readall) response.end end if end if strSQL = "SELECT T.TOPIC_ID, " & _ "T.T_SUBJECT, " & _ "T.FORUM_ID, " & _ "F.F_ABBREVIATION, " & _ "T.T_DATE, " & _ "T.T_LAST_POST, " & _ "M.M_NAME, " & _ "T.T_AUTHOR, " & _ "T.T_REPLIES, " & _ "M1.M_NAME AS REPLIER, " & _ "T.T_LAST_POST_AUTHOR " & _ "FROM MEMBERS AS M, " & _ " TOPICS AS T, " & _ " FORUM AS F, " & _ " MEMBERS AS M1 " & _ "WHERE T.T_LAST_POST_AUTHOR = M1.MEMBER_ID " & _ " AND T.FORUM_ID = F.FORUM_ID " & _ " AND M.MEMBER_ID = T.T_AUTHOR " & _ "ORDER BY T.T_LAST_POST DESC;" Set rs = Server.CreateObject("ADODB.Recordset") rs.open strSQL, my_Conn xfile = "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>" & vbNewline & _ "<activetopics>" & vbNewline Do While NOT rs.EOF xfile = xfile & "<topic>" & vbNewline & _ " <id>" & rs("TOPIC_ID") & "</id>" & vbNewline & _ " <titel>" & rs("T_SUBJECT") & "</titel>" & vbNewline & _ " <forum>" & rs("FORUM_ID") & "</forum>" & vbNewline & _ " <forumafkorting>" & RS("F_ABBREVIATION") & "</forumafkorting>" & vbNewline & _ " <startts>" & rs("T_DATE") & "</startts>" & vbNewline & _ " <lastts>" & rs("T_LAST_POST") & "</lastts>" & vbNewline & _ " <topicstarter>" & rs("M_NAME") & "</topicstarter>" & vbNewline & _ " <starterid>" & rs("T_AUTHOR") & "</starterid>" & vbNewline & _ " <replies>" & rs("T_REPLIES") & "</replies>" & vbNewline & _ " <last_replier>" & rs("REPLIER") & "</last_replier>" & vbNewline & _ " <replierid>" & rs("T_LAST_POST_AUTHOR") & "</replierid>" & vbNewline & _ " <messageid>" & rs("TOPIC_ID") & "</messageid>" & vbNewline & _ "</topic>" & vbNewline rs.movenext loop rs.close set rs = nothing xfile = xfile & " <fileinfo>" & vbNewline xfile = xfile & " <timestamp>"& now() & "</timestamp>" & vbNewline xfile = xfile & " <info>build 162, (Copyright Woudloper)</info>" & vbNewline xfile = xfile & " </fileinfo>" & vbNewline xfile = xfile & "</activetopics>" & vbNewline set file_open = fso.CreateTextFile(Server.MapPath(bestand)) file_open.write(xfile) file_open.close set file_open = Nothing set fso = nothing response.write xfile my_Conn.Close set my_Conn = nothing %> ?> |
Er is echter een klein probleem.
Als ik nu gewoon de pagina opvraag, krijg ik alleen de inhoud van de tags te zien, maar niet de XML pagina als zodanig...
zie:
Het vreemde is als ik het cache.xml opvraag het wel gewoon goed gaat4 fe 1 20020403191330 20020403191330 Admin 1 0 Admin 1 4 3 dfasdfasdf 1 20020403190418 20020403190418 Admin 1 0 Admin 1 3 2 [Discussion] How do you find the forum? 1 20020329072313 20020403190123 Admin 1 2 Admin 1 2 1 Welcome to Snitz Forums 2000 1 20010725010000 20010725010000 Admin 1 0 Admin 1 1 5/2/2002 5:14:11 PM build 162, (Copyright Woudloper)
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
| <?xml version="1.0" encoding="ISO-8859-1" ?> - <activetopics> - <topic> <id>4</id> <titel>fe</titel> <forum>1</forum> <forumafkorting /> <startts>20020403191330</startts> <lastts>20020403191330</lastts> <topicstarter>Admin</topicstarter> <starterid>1</starterid> <replies>0</replies> <last_replier>Admin</last_replier> <replierid>1</replierid> <messageid>4</messageid> </topic> - <topic> <id>3</id> <titel>dfasdfasdf</titel> <forum>1</forum> <forumafkorting /> <startts>20020403190418</startts> <lastts>20020403190418</lastts> <topicstarter>Admin</topicstarter> <starterid>1</starterid> <replies>0</replies> <last_replier>Admin</last_replier> <replierid>1</replierid> <messageid>3</messageid> </topic> - <topic> <id>2</id> <titel>[Discussion] How do you find the forum?</titel> <forum>1</forum> <forumafkorting /> <startts>20020329072313</startts> <lastts>20020403190123</lastts> <topicstarter>Admin</topicstarter> <starterid>1</starterid> <replies>2</replies> <last_replier>Admin</last_replier> <replierid>1</replierid> <messageid>2</messageid> </topic> - <topic> <id>1</id> <titel>Welcome to Snitz Forums 2000</titel> <forum>1</forum> <forumafkorting /> <startts>20010725010000</startts> <lastts>20010725010000</lastts> <topicstarter>Admin</topicstarter> <starterid>1</starterid> <replies>0</replies> <last_replier>Admin</last_replier> <replierid>1</replierid> <messageid>1</messageid> </topic> - <fileinfo> <timestamp>5/2/2002 5:14:11 PM</timestamp> <info>build 162, (Copyright Woudloper)</info> </fileinfo> </activetopics> |
Weet iemand wat ik fout doe of wat ik eraan moet doen om het wel op de juiste manier weergegeven te krijgen...
[ Voor 0% gewijzigd door Woudloper op 09-04-2015 13:51 . Reden: naamaanpassing ]