Author |
Topic |
|
Aznknight
Senior Member
USA
1373 Posts |
Posted - 24 June 2001 : 14:01:59
|
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
|
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 |
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 24 June 2001 : 16:22:32
|
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
|
|
|
Aznknight
Senior Member
USA
1373 Posts |
Posted - 24 June 2001 : 16:31:07
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 24 June 2001 : 19:33:28
|
still no workie....
Dayve |
|
|
Aznknight
Senior Member
USA
1373 Posts |
Posted - 24 June 2001 : 20:49:59
|
what's the error you get?
- Alan www.iamviet.com www.calvsa.net Snitz Resource |
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 25 June 2001 : 21:14:05
|
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
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 26 June 2001 : 00:44:02
|
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 |
|
|
Aznknight
Senior Member
USA
1373 Posts |
Posted - 26 June 2001 : 14:42:01
|
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 |
|
|
|
Topic |
|