Author |
Topic |
RDoGG™
Junior Member
USA
329 Posts |
Posted - 29 June 2001 : 17:07:02
|
This is my first mod, which I coded after I saw it on Dayve's website.
i don't think anyone coded this yet but Alan (AZNknight) commented about it.
This mod shows whether certain users are online or offline.
You can implement it in users profiles or posts (topic.asp).
Download:
- icon_offline.gif
- icon_online.gif
now, where you want to show whether the user is online or offline, add this code:
<%
dim strUserName strUserName = rs("M_NAME")
set rsOnline = Server.CreateObject("ADODB.Recordset") strOnlineSql ="SELECT *" strOnlineSql = strOnlineSql & " FROM FORUM_ONLINE" strOnlineSql = strOnlineSql & " WHERE FORUM_ONLINE.UserID = '" & strUserName & "'" dim rsOnlineMember set rsOnlineMember = my_Conn.Execute (strOnlineSql) If rsOnlineMember.EOF or rsOnlineMember.BOF then %>
<img src="icon_offline.gif" width="42" height="16">
<% Else %>
<img src="icon_online.gif" width="42" height="16"> <% end if %> <% set rsOnlineMember = nothing %>
you can place links to the PM mod if you want to.
any comments are appreciated.
Edited by - RDoGG™ on 29 June 2001 17:18:37 |
|
Freeman II
Junior Member
232 Posts |
Posted - 29 June 2001 : 17:16:17
|
you forgot to set rsOnlineMember =nothing
|
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 29 June 2001 : 17:19:24
|
quote:
you forgot to set rsOnlineMember =nothing
fixed.
|
|
|
Ribkick
Junior Member
USA
296 Posts |
Posted - 29 June 2001 : 18:00:01
|
This is odd, I'm getting a missing end statement but for the life of me, I don't see where. Thought I'd see how this works but it doesn't like this LOL.
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/topic.asp, line 651
dim strUserNamestrUserName = rs("M_NAME")set rsOnline = Server.CreateObject("ADODB.Recordset")strOnlineSql ="SELECT *"strOnlineSql = strOnlineSql & " FROM FORUM_ONLINE"strOnlineSql = strOnlineSql & " WHERE FORUM_ONLINE.UserID = '" & strUserName & "'" dim rsOnlineMemberset rsOnlineMember = my_Conn.Execute (strOnlineSql)If rsOnlineMember.EOF or rsOnlineMember.BOF then ---------------------------^
|
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 29 June 2001 : 19:20:33
|
quote:
This is odd, I'm getting a missing end statement but for the life of me, I don't see where. Thought I'd see how this works but it doesn't like this LOL.
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/topic.asp, line 651
dim strUserNamestrUserName = rs("M_NAME")set rsOnline = Server.CreateObject("ADODB.Recordset")strOnlineSql ="SELECT *"strOnlineSql = strOnlineSql & " FROM FORUM_ONLINE"strOnlineSql = strOnlineSql & " WHERE FORUM_ONLINE.UserID = '" & strUserName & "'" dim rsOnlineMemberset rsOnlineMember = my_Conn.Execute (strOnlineSql)If rsOnlineMember.EOF or rsOnlineMember.BOF then ---------------------------^
did u "separate" the code?
can u put the statement in [code] and [/code] statements?
i got errors, too, with other mods when i did this.
|
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 29 June 2001 : 19:33:52
|
quote:
quote:
This is odd, I'm getting a missing end statement but for the life of me, I don't see where. Thought I'd see how this works but it doesn't like this LOL.
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/topic.asp, line 651
dim strUserNamestrUserName = rs("M_NAME")set rsOnline = Server.CreateObject("ADODB.Recordset")strOnlineSql ="SELECT *"strOnlineSql = strOnlineSql & " FROM FORUM_ONLINE"strOnlineSql = strOnlineSql & " WHERE FORUM_ONLINE.UserID = '" & strUserName & "'" dim rsOnlineMemberset rsOnlineMember = my_Conn.Execute (strOnlineSql)If rsOnlineMember.EOF or rsOnlineMember.BOF then ---------------------------^
did u "separate" the code?
can u put the statement in [code] and [/code] statements?
i got errors, too, with other mods when i did this.
ok...it looks like the error is in the first line.
without line breaks, the code looks like:
dim strUserNamestrUserName =
it should be:
dim strUserName strUserName =
of course, when you dim, you can't put an equal sign.
i found this out when i put [code] brackets around the code.
it returned:
dim strUserNamestrUserName = rs("M_NAME") ---------------------------^
|
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 29 June 2001 : 19:35:31
|
I recommend you copy my code into an editor like WordPad and then copy that over to Notepad.
If you copy the code directly into Notepad, the spacing gets messed up.
|
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
|
Ribkick
Junior Member
USA
296 Posts |
Posted - 30 June 2001 : 00:02:32
|
That must have been the trick, putting it in wordpad rather than notepad. Works with no errors now but only on the first post in every thread. Not showing on any replies in the threads.
|
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 30 June 2001 : 07:57:43
|
quote:
That must have been the trick, putting it in wordpad rather than notepad. Works with no errors now but only on the first post in every thread. Not showing on any replies in the threads.
you'd have to change the variable to have it work with all the users.
on each entry, change this variable:
strUserName
to the user's name
try also deleting:
set rsOnlineMember = nothing
and putting that at the end (after the topic loop)
|
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 30 June 2001 : 18:48:44
|
quote:
I've actually had this on my forum (http://kinser.121host.net/v31sr4/default.asp) for awhile and it was included in the forumcode I've had for download.
oh...ok...
i didn't see it in the download of 3.1 SR4 though.
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 30 June 2001 : 23:41:44
|
I actually saw this at another forum and used my coding based on the active users mod to get mine to work with topic.asp. I don't really think I can take credit for anything...
Dayve |
|
|
Memorom
Starting Member
24 Posts |
Posted - 10 July 2001 : 13:21:14
|
quote:
quote:
I've actually had this on my forum (http://kinser.121host.net/v31sr4/default.asp) for awhile and it was included in the forumcode I've had for download.
oh...ok...
i didn't see it in the download of 3.1 SR4 though.
Where was this included for download?
Edited by - Memorom on 10 July 2001 13:21:58
Edited by - Memorom on 10 July 2001 13:44:58 |
|
|
RDoGG™
Junior Member
USA
329 Posts |
Posted - 10 July 2001 : 17:53:51
|
quote:
quote:
quote:
I've actually had this on my forum (http://kinser.121host.net/v31sr4/default.asp) for awhile and it was included in the forumcode I've had for download.
oh...ok...
i didn't see it in the download of 3.1 SR4 though.
Where was this included for download?
Edited by - Memorom on 10 July 2001 13:21:58
Edited by - Memorom on 10 July 2001 13:44:58
look for TOPIC2.ASP on Richard Kinser's test site - http://kinser.121host.net/v31sr4/default.asp
RDoGG™ |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 12 July 2001 : 10:02:51
|
Shows me offline all the time.
I am logged in but the sign just shows Admin is offline.
gauravbhabu
There is only one miracle...That is LIFE! |
|
|
big9erfan
Average Member
540 Posts |
Posted - 12 July 2001 : 11:05:47
|
I don't see the on-line / off-line mod on your forums.
Do you have a test site they are immplemented on?
http://www.ugfl.net/forums |
|
|
Topic |
|