Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Has anyone written any TRACKING code?
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

laser
Advanced Member

Australia
3859 Posts

Posted - 19 October 2002 :  08:18:34  Show Profile
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 ?
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 19 October 2002 :  09:38:23  Show Profile
Yes! it is snitz function and is in inc_func_common.asp.
Go to Top of Page

mortioli
Average Member

United Kingdom
898 Posts

Posted - 19 October 2002 :  10:06:30  Show Profile  Visit mortioli's Homepage  Send mortioli an AOL message  Send mortioli a Yahoo! Message
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!
Go to Top of Page

al_iguana
Junior Member

138 Posts

Posted - 19 October 2002 :  12:49:37  Show Profile  Visit al_iguana's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 19 October 2002 :  13:50:40  Show Profile
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.
Go to Top of Page

mortioli
Average Member

United Kingdom
898 Posts

Posted - 20 October 2002 :  10:19:57  Show Profile  Visit mortioli's Homepage  Send mortioli an AOL message  Send mortioli a Yahoo! Message
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.
Go to Top of Page

al_iguana
Junior Member

138 Posts

Posted - 20 October 2002 :  12:20:26  Show Profile  Visit al_iguana's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 October 2002 :  12:59:22  Show Profile
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.
Go to Top of Page

al_iguana
Junior Member

138 Posts

Posted - 20 October 2002 :  13:14:44  Show Profile  Visit al_iguana's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 October 2002 :  13:41:53  Show Profile
You can use vb function DateDiff
Number of days = DateDiff("d", FileCreationDate, strForumTimeAdjust)

Edited by - GauravBhabu on 20 October 2002 13:42:34
Go to Top of Page

al_iguana
Junior Member

138 Posts

Posted - 20 October 2002 :  13:59:51  Show Profile  Visit al_iguana's Homepage
brilliant, thanks!

this now displays the number of days since the log was created or cleared:

Viewlog

----

Don't Dream It ~ Be It
http://www.peppermintiguana.co.uk/cymrugothic/

Edited by - al_iguana on 20 October 2002 14:01:12
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 October 2002 :  14:05:23  Show Profile
You are welcome . I developed an advanced user log system. Might update it once I am done setting up current version of snitz.
Go to Top of Page

mortioli
Average Member

United Kingdom
898 Posts

Posted - 20 October 2002 :  16:56:40  Show Profile  Visit mortioli's Homepage  Send mortioli an AOL message  Send mortioli a Yahoo! Message
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
Go to Top of Page

mortioli
Average Member

United Kingdom
898 Posts

Posted - 20 October 2002 :  16:59:18  Show Profile  Visit mortioli's Homepage  Send mortioli an AOL message  Send mortioli a Yahoo! Message
Oh, and could anyone provide me with the "reset/clear file" code please ?

Thanks.
Go to Top of Page

al_iguana
Junior Member

138 Posts

Posted - 20 October 2002 :  17:47:39  Show Profile  Visit al_iguana's Homepage
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/
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07