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/Code)
 Statistics Addon: Display members seen within 24 h
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aznknight
Senior Member

USA
1373 Posts

Posted - 24 June 2001 :  14:01:59  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
Right now my statistics mod released here, shows the last 25 members seen. But if instead you want to display members seen within 24 hours like how it's done at iamviet, this will do it.

here's the function for this:


function DisplaySeenToday()
dim rs
set rs = server.CreateObject("adodb.recordset")

strSql = "SELECT MEMBER_ID, M_NAME, M_LASTHEREDATE FROM " & strMemberTablePrefix & "MEMBERS WHERE M_LASTHEREDATE > '" & DateToStr(DateAdd("h",-24,now())) & "' ORDER BY M_LASTHEREDATE DESC"
rs.Open strSql, my_Conn

%>
<table border="0" cellpadding="0" cellspacing="5" width="100%">
<tr>
<td valign=middle width="10%"><b>No.</b></td>
<td valign=middle align=left><b>Member Name</b></td>
<td valign=middle align=center><b>Last Seen within 24 hours</b></td>
</tr>
<%
intCounter = 1
do while not rs.EOF
minutesTotal = datediff("n",strtodate(rs("m_lastheredate")),now())
hoursTotal = int(minutesTotal / 60)
daysSince = int(hoursTotal / 24)
hoursSince = hoursTotal mod 24
minutesSince = minutestotal mod 60
if daysSince < 1 then%>
<tr>
<td ><%= intCounter%>.</td>
<td align=left><a href=pop_profile.asp?mode=display&id=<%=rs("member_id")%>><%= rs("m_name")%></a></td>
<td align=center>
<%

if daysSince = 1 then Response.Write daysSince & " day, "
if daysSince > 1 then Response.Write daysSince & " days, "
if hoursSince > 0 then Response.Write hoursSince & " hours, "
Response.Write minutesSince
%> minutes ago.
</td>
</tr>
<%end if%>
<%
intCounter = intCounter + 1
rs.movenext
loop
rs.Close
%>
</table>
<%
end function


now just replace:
<%=displayLastSeen%>
with
<%=DisplaySeenToday%>

and change the heading accordingly.
Members Last Seen Within 24

- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource



Edited by - aznknight on 24 June 2001 16:33:14

Edited by - aznknight on 26 June 2001 14:36:18

dayve
Forum Moderator

USA
5820 Posts

Posted - 24 June 2001 :  15:02:39  Show Profile  Visit dayve's Homepage
Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/forum/statistics.asp, line 285

so I removed this

<%
end function

function DisplaySeenToday()
dim rs
set rs = server.CreateObject("adodb.recordset")

strSql = "SELECT member_id, m_name, m_lastheredate FROM FORUM_members WHERE M_INVISIBLE = 0 AND M_LASTHEREDATE > " & DateToStr(DateAdd("h",-24,now())) & " ORDER BY M_LASTHEREDATE DESC"
rs.Open strSql, my_Conn
%>

now Last seen shows no one...

Dayve
Go to Top of Page

RDoGG™
Junior Member

USA
329 Posts

Posted - 24 June 2001 :  16:22:32  Show Profile  Visit RDoGG™'s Homepage  Send RDoGG™ an AOL message  Send RDoGG™ a Yahoo! Message
quote:

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/forum/statistics.asp, line 285

so I removed this

<%
end function

function DisplaySeenToday()
dim rs
set rs = server.CreateObject("adodb.recordset")

strSql = "SELECT member_id, m_name, m_lastheredate FROM FORUM_members WHERE M_INVISIBLE = 0 AND M_LASTHEREDATE > " & DateToStr(DateAdd("h",-24,now())) & " ORDER BY M_LASTHEREDATE DESC"
rs.Open strSql, my_Conn
%>

now Last seen shows no one...

Dayve



lol... I AOL IM'ed Alan yesterday about how to get the members seen within 24 hours.

he told me to request it on his test forum

( http://www.calvsa.net/snitz )

so i did. he wrote this function -DisplaySeenToday() - and put it on his site.

i d/l'ed it and got the same error as u...

check out my post at calvsa.net

Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 24 June 2001 :  16:31:07  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
woops, my bad... i took that code straight out from iamviet which has invisible mode for admins tried to whos online mod which you guys don't have.

remove this from the strSql and you will be find:
M_INVISIBLE = 0 AND

I have already did this to the first post on this topic. Good luck

- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 24 June 2001 :  19:33:28  Show Profile  Visit dayve's Homepage
still no workie....

Dayve
Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 24 June 2001 :  20:49:59  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
what's the error you get?

- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource
Go to Top of Page

RDoGG™
Junior Member

USA
329 Posts

Posted - 25 June 2001 :  21:14:05  Show Profile  Visit RDoGG™'s Homepage  Send RDoGG™ an AOL message  Send RDoGG™ a Yahoo! Message
quote:

still no workie....

Dayve



here's the code (alan + me finally figured it out):

go to Alan's test site (www.calvsa.net/snitz) and read our discussion.

this topic

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 26 June 2001 :  00:44:02  Show Profile  Visit dayve's Homepage
I will re-read that topic later but it would be nice to have everything in one posts. I have had too many bad experiences in the past with code being shown in posts with several little changes. This mod sounds good though. It sparked an idea for me to create a mod that allows member to see all the posts made by another member by category.

Dayve
Go to Top of Page

Aznknight
Senior Member

USA
1373 Posts

Posted - 26 June 2001 :  14:42:01  Show Profile  Send Aznknight an AOL message  Send Aznknight an ICQ Message
the code from the first page is updated. should work for you now as rdogg says it works for him.

- Alan
www.iamviet.com
www.calvsa.net
Snitz Resource
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07