<% '----------------------------------------- ' ZERO ADMINISTRATION GUESTBOOK - Ver 1.20 ' Copyright 2000 by Steven HTUT. All rights reserved. ' scripts@winmyanmar.bizhosting.com ' http://winmyanmar.bizhosting.com/zag.htm ' ' This asp code can be used/distributed free of charge, and ' this copyright notice should not be altered. '----------------------------------------- ' SETUP INSTRUCTIONS ' Pls see at http://winmyanmar.bizhosting.com/zag.htm '----------------------------------------- ' CONFIGURE YOUR GUESTBOOK ' Dim strFile, bDay, strBakFile, strDump, SiteTitle, WelcomeMessage, TextAttribute, LineAttribute, BodyAttribute, StyleDesp SiteTitle = "Libro de Visitas del Cuarto Encuentro" WelcomeMessage = "Gracias por visitar nuestras páginas. Nos gustaría mucho si te sumaras a nuestro libro de visitas. " strFile = Server.MapPath("guestbook.htm") strLog = Server.MapPath("guestbook.log") LineAttribute = "
" 'note the use of single quotes TextAttribute = "" BodyAttribute = "" 'note the use of single quotes StyleDesp = "" '----------------------------------------- ' DON'T EDIT BELOW THIS LINE (except <% response.Write (LineAttribute) Else '### CHECK DATE -- IF ANOTHER MONTH, BACKUP FILE Dim objFSO, objFSOlog Dim objFile, objFileLog '### READ DATE LOG Set objFSOlog = Server.CreateObject("Scripting.FileSystemObject") Set objFileLog = objFSOlog.OpenTextFile(strLog, 1) '### OPEN GUESTBOOK.LOG bDay = objFileLog.ReadAll bDay = Trim(bDay) objFileLog.Close '### IF A MONTH ENDED If Day(Date) < cByte(bDay) then If Month(Date) = 1 then strBakFile = Server.MapPath("" + Trim(CStr(year(date)-1)) +"-"+ "12.htm") else strBakFile = Server.MapPath("" + Trim(CStr(year(date))) +"-"+ Trim(CStr(month(date)-1)) + ".htm") End if response.write (strBakFile & "
") '### DO BACK UP '### READ OLD GUESTBOOK Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strFile, 1) '### OPEN guestbook.htm strDump = objFile.ReadAll objFile.Close Set objFile = Nothing Set objFSO = Nothing '### WRITE TO BAK FILE Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile(strBakFile, true) objFile.write ("") objFile.write (StyleDesp + "") objFile.write (BodyAttribute) objFile.write ("

Libro del año "+ Trim(CStr(year(date))) +", Month "+ Trim(CStr(month(date)-1))+"

") objFile.write (strDump) objFile.write ("") objFile.Close Set objFile = Nothing Set objFSO = Nothing '### INITIATE CURRENT GUESTBOOK Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.CreateTextFile(strFile, true) objFile.write ("
") objFile.Close Set objFile = Nothing Set objFSO = Nothing response.write ("Libro iniciado en un nuevo mes...") End If '### Write the results to file Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strFile, 8, True) objFile.Write (LineAttribute) objFile.Write (TextAttribute) objFile.Write Server.HTMLEncode(Request.Form("comment")) objFile.Write "

" objFile.Write Server.HTMLEncode(Request.Form("name")) objFile.Write ", " objFile.Write Server.HTMLEncode(Request.Form("email")) & "
" objFile.Write now & " - ip address:" objFile.Write (request.servervariables("remote_Addr")) & "

" objFile.Close '### WRITE DATE LOG Set objFileLog = objFSOlog.OpenTextFile(strLog, 2, True) objFileLog.Write Day(Date) objFileLog.Close Set objFile = Nothing Set objFSO = Nothing Set objFileLog = Nothing Set objFSOlog = Nothing %>

Tus comentarios han sido agregados al libro

Volver al Libro de Visitas

<% End If %> Zero Administration Guestbook. código ASP programado por Steven HTUT.