Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - how i do that , ?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how i do that , ?

 Post Reply Post Reply Page  <12
Author
Norrad View Drop Down
Newbie
Newbie


Joined: 08 September 2002
Location: South Africa
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote Norrad Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2003 at 2:40pm
Try This, you will have to enable active users in your control panel to use it

<%
'Declaration of variables
Dim rsUserOnline
Dim rsActiveUsers

If NOT strUsername = "Guest" Then
     Set rsUserOnline = Server.CreateObject("ADODB.Recordset")
     Set rsActiveUsers = Server.CreateObject("ADODB.Recordset")

     'Initalise the strSQL variable with an SQL statement to query the database
     strSQL = "SELECT " & strDbTable & "activeUser.* FROM " & strDbTable & "ActiveUser WHERE " & strDbTable & "ActiveUser.Author_ID=" & lngUserID

     rsUserOnline.Open strSQL, strCon
     rsActiveUsers.Open strSQL, strCon   

     If NOT rsUserOnline.EOF Then blnHideActiveUser = CBool(rsActiveUsers("Hide"))

     If rsUserOnline.EOF Then
          Response.Write "<center>Offline</center>"

     ElseIf blnHideactiveUser = True Then
          
                  'display the user as an annoy
                  Response.Write("<center>Offline</center>")
       
     Else
          Response.Write "<center>Online</center>"
     End If

     rsUserOnline.Close
     Set rsUserOnline = Nothing
     rsActiveUsers.Close
     Set rsActiveUsers = Nothing
End If
%>
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2003 at 2:56pm
why two recorsets?
Back to Top
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2003 at 10:31pm

Enter this at line 804 in the forum_posts.asp in ver. 7.0

strSQL = "SELECT * from tblActiveUser where Author_ID = " & lngUserID
rsCommon.open strSQL, adoCon

if rsCommon.eof or rsCommon.bof then
Response.write("<BR><BR><BR><B><FONT COLOR=""#FF0000"">Offline</FONT></B>")
else
Response.write("<BR><BR><BR><B><FONT COLOR=""#0000FF"">Online</FONT></B>")
end if


rsCommon.close

Nice mod I have been looking for a way to do this

Back to Top
zadax View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 19 January 2003
Location: Israel
Status: Offline
Points: 433
Post Options Post Options   Thanks (0) Thanks(0)   Quote zadax Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2003 at 11:20pm
vdub
 did u made it ?  .... i am Stuck ... plz help me ... if u know how to do it plz Pm
Back to Top
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2003 at 11:49pm

All I did is mod the OG code.

The first reply had some code that would error all I did is change the line in blue.

strSQL = "SELECT * from tblActiveUser where Author_ID = " & lngUserID
rsCommon.open strSQL, adoCon

if rsCommon.eof or rsCommon.bof then
Response.write("<BR><BR><BR><B><FONT COLOR=""#FF0000"">Offline</FONT></B>")
else
Response.write("<BR><BR><BR><B><FONT COLOR=""#0000FF"">Online</FONT></B>")
end if


rsCommon.close



Edited by vdub
Back to Top
Allan_Young View Drop Down
Newbie
Newbie


Joined: 18 May 2003
Location: United Kingdom
Status: Offline
Points: 24
Post Options Post Options   Thanks (0) Thanks(0)   Quote Allan_Young Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2003 at 8:35am

Message deleted by Allan_Young (cos I'm stupid and didn't read the full thread!)

Sorry



Edited by Allan_Young
Back to Top
vdub View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 February 2003
Location: United States
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote vdub Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2003 at 10:11am
Originally posted by vdub vdub wrote:

Enter this at line 804 in the forum_posts.asp in ver. 7.0

strSQL = "SELECT * from tblActiveUser where Author_ID = " & lngUserID
rsCommon.open strSQL, adoCon

if rsCommon.eof or rsCommon.bof then
Response.write("<BR><BR><BR><B><FONT COLOR=""#FF0000"">Offline</FONT></B>")
else
Response.write("<BR><BR><BR><B><FONT COLOR=""#0000FF"">Online</FONT></B>")
end if


rsCommon.close

Nice mod I have been looking for a way to do this

Read the whole post.

Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.