Author |
Topic |
laser
Advanced Member
Australia
3859 Posts |
Posted - 19 October 2002 : 08:18:34
|
Because I didn`t know what it was or how to use it. (Assuming it's a Snitz function,) is there any documentation on this ? |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 19 October 2002 : 09:38:23
|
Yes! it is snitz function and is in inc_func_common.asp. |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 19 October 2002 : 10:06:30
|
I've got the dates etc working. Thanks.
Another question though...all this info is put into a .txt file, and I have an .asp file which shows all the info (through the admin pages), but because the size will increase quite dramatically, is there a way of having a button or link which will clear the contents of the .txt file? Saves on logging into FTP and uploading a blank file.
Cheers again! |
|
|
al_iguana
Junior Member
138 Posts |
Posted - 19 October 2002 : 12:49:37
|
just make a button that will create a new text file (with the same name). this will overwrite the old one.
could you post up the admin page you made to view the file? |
----
Don't Dream It ~ Be It http://www.peppermintiguana.co.uk/cymrugothic/ |
Edited by - al_iguana on 19 October 2002 12:51:28 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 19 October 2002 : 13:50:40
|
quote: Originally posted by mortioli
I've got the dates etc working. Thanks.
Another question though...all this info is put into a .txt file, and I have an .asp file which shows all the info (through the admin pages), but because the size will increase quite dramatically, is there a way of having a button or link which will clear the contents of the .txt file? Saves on logging into FTP and uploading a blank file.
Cheers again!
You can modify the code to create a new file after a set period of time. |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 20 October 2002 : 10:19:57
|
This admin page wasn't made by me, but by someone called Havvoc...(We are working to add some new features to it - I've just added some code to show the file size of the log file)...
<!--#INCLUDE FILE="config.asp" -->
<% If Session(strCookieURL & "Approval") = "15916941253" Then %>
<!--#INCLUDE file="inc_functions.asp" -->
<!--#INCLUDE file="inc_top.asp" -->
<table border="0" width="100%">
<tr>
<td width="33%" align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<img src="<%= strImageUrl %>icon_folder_open.gif" height=15 width=15 border="0"> <a href="default.asp">All Forums</a><br>
<img src="<%= strImageUrl %>icon_bar.gif" height=15 width=15 border="0"><img src="<%= strImageUrl %>icon_folder_open.gif" height=15 width=15 border="0"> <a href="admin_home.asp">Admin Section</a><br>
<img src="<%= strImageUrl %>icon_blank.gif" height=15 width=15 border="0"><img src="<%= strImageUrl %>icon_bar.gif" height=15 width=15 border="0"><img src="<%= strImageUrl %>icon_folder_open_topic.gif" height=15 width=15 border="0"> Forum Logs<br>
</font></td>
</tr>
</table>
<br><br>
<table border="0" width="100%">
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objTextStream
const strFileName = "C:\blah\blah\logs\forum.txt"
const fsoForReading = 1
Dim iFileSize
iFileSize = objFSO.GetFile(strFileName).Size
Response.Write " <font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """>Log File size (bytes): <b>" & FormatNumber(iFileSize, 0) & _
"</b></font>"
If objFSO.FileExists("C:\blah\blah\logs\forum.txt") then
'The file exists, so open it and output its contents
Set objTextStream = objFSO.OpenTextFile(strFileName, fsoForReading)
Response.Write "<PRE>" & objTextStream.ReadAll & "</PRE>"
objTextStream.Close
Set objTextStream = Nothing
Else
'The file did not exist
Response.Write strFileName & " was not found."
End If
'Clean up
Set objFSO = Nothing
%>
</table>
<br><br>
<!--#INCLUDE file="inc_footer.asp" -->
<%
Else
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=scriptname"
End IF
%>
Just change the red parts to point to your log file. |
|
|
al_iguana
Junior Member
138 Posts |
Posted - 20 October 2002 : 12:20:26
|
thanks for that. i've changed it so that it uses my 3.4.3 headers and servermappath:
Viewlog
is there any way you can get the log creation date (in a similar way that you get the file size)? could then work out how many days since log creation (or since you last cleared it)
then you could have:
Log File Size: 44400 bytes This Log is for the last -12- days Clear logfile? {button}
the button would then create a new (blank) logfile.
yeah... questions... questions. This could turn out to be a VERY useful mod indeed |
----
Don't Dream It ~ Be It http://www.peppermintiguana.co.uk/cymrugothic/ |
Edited by - al_iguana on 20 October 2002 12:39:45 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 October 2002 : 12:59:22
|
quote: Originally posted by al_iguana
is there any way you can get the log creation date (in a similar way that you get the file size)? could then work out how many days since log creation (or since you last cleared it)
Yes! You can. I have to go out and will post when I come back unless ofcourse someone else post it. |
|
|
al_iguana
Junior Member
138 Posts |
Posted - 20 October 2002 : 13:14:44
|
would this do it?
iCreation = objFSO.GetFile(server.mappath("forumlog.txt")).DateCreated
what form would the iCreation variable then take? a long string? ie 20021001081555? how could we format it? and how could we work out the number of days since creation by comparing it to chkdate?
sorry about all the questions. i'm trying to learn something so i won't have to ask them again |
----
Don't Dream It ~ Be It http://www.peppermintiguana.co.uk/cymrugothic/ |
Edited by - al_iguana on 20 October 2002 13:15:28 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 October 2002 : 13:41:53
|
You can use vb function DateDiff Number of days = DateDiff("d", FileCreationDate, strForumTimeAdjust) |
Edited by - GauravBhabu on 20 October 2002 13:42:34 |
|
|
al_iguana
Junior Member
138 Posts |
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 October 2002 : 14:05:23
|
You are welcome . I developed an advanced user log system. Might update it once I am done setting up current version of snitz. |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 20 October 2002 : 16:56:40
|
One thing I need to sort out, is the input for where the log file is.
At the moment, people need to change 3 places within the code, to point to the file (one of which is a virtual, the other 2 are physical). Is there anyway of just having one part, and the others looking at that bit of code.
I'm sorry for sounding thick, but I don't know much ASP |
|
|
mortioli
Average Member
United Kingdom
898 Posts |
Posted - 20 October 2002 : 16:59:18
|
Oh, and could anyone provide me with the "reset/clear file" code please ?
Thanks. |
|
|
al_iguana
Junior Member
138 Posts |
Posted - 20 October 2002 : 17:47:39
|
i'll make an options page for you if you want. option 1 - view the log. option 2 - clear the log.
been trying to figure out how to analyse stats based on this logfile but it is very hard due to the limitations of server objects. if we can get this information into a table in the forum database rather than a text file its much easier to do stuff like that. |
----
Don't Dream It ~ Be It http://www.peppermintiguana.co.uk/cymrugothic/ |
|
|
Topic |
|