Author |
Topic  |
Medic397
New Member

80 Posts |
Posted - 20 July 2002 : 20:43:24
|
Is there any mod that shows if the person in online or offline besides the Active Users mod. Forum member of mine asked if I could put that on the forum. They said is would show in the topic.asp if the member was online instead of having to go to the active users to see who was online. Any Ideas?
|
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 20 July 2002 : 20:47:24
|
You could include the Active Users list to the bottom of your topic.asp maybe ?? ... I've done that on the Active Topics page, so I get Active Topics + Active Users on the one screen.
|
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 20 July 2002 : 21:21:51
|
in topic.asp there is two places you need to enter this SQL:
Find this line:
do until rsReplies.EOF or (mypage = 1 and rec > CInt(strPageSize)) or (mypage > 1 and rec > CInt(strPageSize)) '**
and add this right after it:
strSql ="SELECT " & strTablePrefix & "ONLINE.UserID " strSql = strSql & " FROM " & strTablePrefix & "ONLINE " strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserID = '" & rsReplies("M_NAME") & "'" set rsOnline = Server.CreateObject("ADODB.Recordset") rsOnline.open strSql, my_Conn, 3
and then depending on where you want the indator to be you can add something like this... I put mine right next to the profile icon in the posts:
<% if rsOnline.EOF or rsOnline.BOF then %> <a href="active_users.asp" title="<%=rsReplies("M_NAME")%> is OFFLINE"><img src="icon_offline.gif" border="0" align="absmiddle"></a> <% else %> <% if rsOnline("UserID") = rsReplies("M_NAME") then %> <a href="active_users.asp" title="<%=rsReplies("M_NAME")%> is ONLINE"><img src="icon_online.gif" border="0" align="absmiddle"></a> <% else %> <a href="active_users.asp" title="<%=rsReplies("M_NAME")%> is OFFLINE"><img src="icon_offline.gif" border="0" align="absmiddle"></a> <% end if end if rsOnline.close Set rsOnline = Nothing %>
then you need to do this same for Topics.
find this line:
sub GetFirst()
and add this right after it:
strSql ="SELECT " & strTablePrefix & "ONLINE.UserID " strSql = strSql & " FROM " & strTablePrefix & "ONLINE " strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserID = '" & rsTopic("M_NAME") & "'" set rsOnline = Server.CreateObject("ADODB.Recordset") rsOnline.open strSql, my_Conn, 3
and again, depending on where you want the indicator to show:
<% if rsOnline.EOF or rsOnline.BOF then %> <a href="active_users.asp" title="<%=rsTopic("M_NAME")%> is OFFLINE"><img src="icon_offline.gif" border="0" align="absmiddle"></a> <% else %> <% if rsOnline("UserID") = rsTopic("M_NAME") then %> <a href="active_users.asp" title="<%=rsTopic("M_NAME")%> is ONLINE"><img src="icon_online.gif" border="0" align="absmiddle"></a> <% else %> <a href="active_users.asp" title="<%=rsTopic("M_NAME")%> is OFFLINE"><img src="icon_offline.gif" border="0" align="absmiddle"></a> <% end if end if rsOnline.close Set rsOnline = Nothing %>
If you want to see an example of this you can visit my forum and view some topics. now that I look at the code, it can be streamlined which I will do right now, but this works just fine.
here's the images I use, you may not see it on this forum, but one says online and the other says online (the text is white)
Online Icon

Offline Icon

 http://www.nineinchnailz.com
Edited by - dayve on 20 July 2002 21:24:40 |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 20 July 2002 : 21:58:11
|
you may want to change these lines if rsOnline("UserID") = rsReplies("M_NAME") and if rsOnline("UserID") = rsTopic("M_NAME")
to
if lcase(rsOnline("UserID")) = lcase(rsReplies("M_NAME")) and if lcase(rsOnline("UserID")) = lcase(rsTopic("M_NAME"))
respectively, otherwise it may not correctly flag someone as online.
|
 |
|
Medic397
New Member

80 Posts |
Posted - 21 July 2002 : 11:24:47
|
OK I did all the changes that you both offered. It killed my topic.asp said it could not find FORUM_ONLINE in the database. I have put the topic.asp up so you can see it. What did I do wrong?
http://www.coruscantonline.com/help.html
|
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 21 July 2002 : 12:05:58
|
do you have the active users mod installed ?
if not you will need to install that first
|
 |
|
dayve
Forum Moderator
    
USA
5820 Posts |
Posted - 21 July 2002 : 13:07:28
|
oh yeah, back up your original code first and make sure you have Active Users Mod installed like HuwR stated.
 http://www.nineinchnailz.com |
 |
|
Medic397
New Member

80 Posts |
Posted - 21 July 2002 : 14:41:45
|
Yes I have Active Users installed. Is it missing some code in the topic.asp?
|
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 22 July 2002 : 05:56:31
|
What version of Active Users are you using? The code Dayve supplied will work with version 3 only, if you are using version 4, you'll need to make a few changes as AU4 uses a different table.
c ya in the funny books  MeTV - tvthemetunes.net - forums house of design - graphic design consultants "No one can earn a million dollars honestly." |
 |
|
Medic397
New Member

80 Posts |
Posted - 22 July 2002 : 19:26:36
|
I use AU4 what changes do I need to make?
|
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 23 July 2002 : 08:42:20
|
The code below is an exctract from Crash's Additional Admin Options MOD 3.00 which I have modified to work with AU4. You can dowload the full Mod from http://www.crashsite.nl/
Find the following on or around line 382 of topic.asp
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("M_POSTS") %> Posts</small></font></td> and replace it with this:
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsReplies("M_POSTS") %> Posts</small></font> <% '######### Crash's Additional Admin Options MOD 3.00 ######### '######### modified by MeTV. also moved </td> from two lines above to below this code ######### Dim strUserName strUserName = rsReplies("R_AUTHOR") Set rsOnline = Server.CreateObject("ADODB.Recordset") strOnlineSql ="SELECT MEMBER_ID, AU_LOGINTIME" strOnlineSql = strOnlineSql & " FROM FORUM_ACTIVE_USERS" strOnlineSql = strOnlineSql & " WHERE FORUM_ACTIVE_USERS.MEMBER_ID = " & strUserName strOnlineSql = strOnlineSql & " AND AU_LOGINTIME <> ''" Dim rsOnlineMember Set rsOnlineMember = my_Conn.Execute (strOnlineSql) If rsOnlineMember.EOF Or rsOnlineMember.BOF Then %> <br><br> <font color="#808080" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize%>"> offline </font> <% Else %> <br><br> <font color="#ffffff" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"> <b>online</b> </font> <% End If Set rsOnlineMember = nothing '######### Crash's Additional Admin Options MOD 3.00 ######### %> </td> On or around line 530 find this:
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsTopic("M_POSTS") %> Posts</small></font></td> and replace it with the following:
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% =rsTopic("M_POSTS") %> Posts</small></font> <% '######### Crash's Additional Admin Options MOD 3.00 ######### '######### modified by MeTV. also moved </td> from two lines above to below this code ######### Dim strUserName strUserName = rsTopic("T_AUTHOR") Set rsOnline = Server.CreateObject("ADODB.Recordset") strOnlineSql ="SELECT MEMBER_ID, AU_LOGINTIME" strOnlineSql = strOnlineSql & " FROM FORUM_ACTIVE_USERS" strOnlineSql = strOnlineSql & " WHERE FORUM_ACTIVE_USERS.MEMBER_ID = " & strUserName strOnlineSql = strOnlineSql & " AND AU_LOGINTIME <> ''" Dim rsOnlineMember Set rsOnlineMember = my_Conn.Execute (strOnlineSql) If rsOnlineMember.EOF Or rsOnlineMember.BOF Then %> <br><br> <font color="#808080" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize%>"> offline </font> <% Else %> <br><br> <font color="#ffffff" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"> <b>online</b> </font> <% End If Set rsOnlineMember = nothing '######### Crash's Additional Admin Options MOD 3.00 ######### %> </td>
That should do the trick for you, although you'll probably need to fiddle with the HTML within the code above if you want to use different colours (currently grey for offline and white for online) or if you want to use the images Dayve posted above.
c ya in the funny books  MeTV - tvthemetunes.net - forums house of design - graphic design consultants "No one can earn a million dollars honestly." |
 |
|
Medic397
New Member

80 Posts |
Posted - 23 July 2002 : 21:46:34
|
Thank You MeTV works wonderfully.
|
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 24 July 2002 : 06:57:15
|
You're welcome. :) Always glad to help out.
c ya in the funny books  MeTV - tvthemetunes.net - forums house of design - graphic design consultants "No one can earn a million dollars honestly." |
 |
|
crash
Advanced Member
    
Netherlands
2064 Posts |
Posted - 24 July 2002 : 10:57:18
|
nice!
 Crash's Site | Crash is from 
|
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 24 July 2002 : 12:30:19
|
quote: nice!
Hope you don't mind me butchering your Mod up and reposting it for others, Crash. In fact, if it's OK with you and if nobody's already done so, I was thinking of taking the code above and packaging it up on it's own as a little mini Mod. If that's a problem, no worries, it was just an idea.
c ya in the funny books  MeTV - tvthemetunes.net - forums house of design - graphic design consultants "No one can earn a million dollars honestly." |
 |
|
crash
Advanced Member
    
Netherlands
2064 Posts |
Posted - 24 July 2002 : 18:44:52
|
hey, snitz is free and ought to be kept free!
do whatever you see fit! just as long as you give me some credit for it (add my url in the readme...) 
 Crash's Site | Crash is from 
|
 |
|
Topic  |
|