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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Online Offline
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Medic397
New Member

80 Posts

Posted - 20 July 2002 :  20:43:24  Show Profile  Visit Medic397's Homepage  Send Medic397 an AOL message  Send Medic397 a Yahoo! Message
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  Show Profile
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.

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 20 July 2002 :  21:21:51  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 20 July 2002 :  21:58:11  Show Profile  Visit HuwR's Homepage
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.

Go to Top of Page

Medic397
New Member

80 Posts

Posted - 21 July 2002 :  11:24:47  Show Profile  Visit Medic397's Homepage  Send Medic397 an AOL message  Send Medic397 a Yahoo! Message
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

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 21 July 2002 :  12:05:58  Show Profile  Visit HuwR's Homepage
do you have the active users mod installed ?

if not you will need to install that first

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 21 July 2002 :  13:07:28  Show Profile  Visit dayve's Homepage
oh yeah, back up your original code first and make sure you have Active Users Mod installed like HuwR stated.


http://www.nineinchnailz.com
Go to Top of Page

Medic397
New Member

80 Posts

Posted - 21 July 2002 :  14:41:45  Show Profile  Visit Medic397's Homepage  Send Medic397 an AOL message  Send Medic397 a Yahoo! Message
Yes I have Active Users installed. Is it missing some code in the topic.asp?

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 22 July 2002 :  05:56:31  Show Profile
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."
Go to Top of Page

Medic397
New Member

80 Posts

Posted - 22 July 2002 :  19:26:36  Show Profile  Visit Medic397's Homepage  Send Medic397 an AOL message  Send Medic397 a Yahoo! Message
I use AU4 what changes do I need to make?

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 23 July 2002 :  08:42:20  Show Profile
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."
Go to Top of Page

Medic397
New Member

80 Posts

Posted - 23 July 2002 :  21:46:34  Show Profile  Visit Medic397's Homepage  Send Medic397 an AOL message  Send Medic397 a Yahoo! Message
Thank You MeTV works wonderfully.

Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 July 2002 :  06:57:15  Show Profile
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."
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 24 July 2002 :  10:57:18  Show Profile  Visit crash's Homepage
nice!



Crash's Site | Crash is from
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 24 July 2002 :  12:30:19  Show Profile
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."
Go to Top of Page

crash
Advanced Member

Netherlands
2064 Posts

Posted - 24 July 2002 :  18:44:52  Show Profile  Visit crash's Homepage
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
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
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.57 seconds. Powered By: Snitz Forums 2000 Version 3.4.07