Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Chat Room
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Chat Room

 Post Reply Post Reply Page  <12345 12>
Author
Imperator View Drop Down
Newbie
Newbie


Joined: 02 October 2004
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote Imperator Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2006 at 5:42pm
I'm getting this error when there's someone logged in. I think it's because I'm placing the chat script on the forum_topics.asp instead of the default.asp. How should I modify the code so that it work on forum_topic.asp?

Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'intArrayPass'

EDIT: Nevermind. It turns out you just need to add "Dim intArrayPass" to the page.


Edited by Imperator - 03 July 2006 at 6:03pm
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2006 at 12:03am
I never thought to put it at the top of every page using forum_topic.asp, Nice work
 
Please show the code placement in forum_topic.asp that you sucessfully added so others can see where you put it.
 
Just show a few lines above and below so people can see where to put it
 
 
MORE:
 
Also maybe you could dress it up with this code to change. This is the replacement inside Maddog's MOD.
 
BACKUP YOUR FILE FIRST BEFORE ATTEMPTING CHANGES
 
--------------------------------------------------------%>--------------------------------------------
<%
If lngLoggedInUserID <> 0 AND lngLoggedInUserID <> 2 Then 'Hides this from anyone not logged in
'##########################################################################################
'##########################################################################################
'######################### START MADDOG MOD HERE ##########################################
'###################### Edited by JCKRUGER 04/07/2006 #####################################
'##########################################################################################
'Copyright 2005 - Drew Gauderman - http://www.iportalx.net - http://www.aspinvision.comDim saryActiveChatUsers
Dim blnAdminInChat
CONST ApplicationUsers = "ChatUsers"
Const strDefaultChatroom = "General Chit Chat"
blnAdminInChat = False
'Get the array
If IsArray(Application(ApplicationUsers)) Then
 saryActiveChatUsers = Application(ApplicationUsers)
Else
 ReDim saryActiveChatUsers(9, 0)
End If
'Remove inactive users first
If UBound(saryActiveChatUsers, 2) <> 0 Then
 Application.Lock
 'Iterate through the array to remove old entires
 For intArrayPass = 1 To UBound(saryActiveChatUsers, 2)
  'Check the last checked date. If user wasnt updated 15 seconds ago then they must be gone
  If CDate(saryActiveChatUsers(3, intArrayPass)) < CDate(CDbl(DateAdd("s", -60, Now()))) Then
   'Swap this array postion with the last in the array
   saryActiveChatUsers(0, intArrayPass) = saryActiveChatUsers(0, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(1, intArrayPass) = saryActiveChatUsers(1, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(2, intArrayPass) = saryActiveChatUsers(2, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(3, intArrayPass) = saryActiveChatUsers(3, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(4, intArrayPass) = saryActiveChatUsers(4, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(5, intArrayPass) = saryActiveChatUsers(5, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(6, intArrayPass) = saryActiveChatUsers(6, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(7, intArrayPass) = saryActiveChatUsers(7, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(8, intArrayPass) = saryActiveChatUsers(8, UBound(saryActiveChatUsers, 2))
   saryActiveChatUsers(9, intArrayPass) = saryActiveChatUsers(9, UBound(saryActiveChatUsers, 2))
   'Remove the last array position as it is no-longer needed
   ReDim Preserve saryActiveChatUsers(9, UBound(saryActiveChatUsers, 2) - 1)
   'Exit for loop to prevent errors
   Exit For
  End If
 Next
 Application(ApplicationUsers) = saryActiveChatUsers
 Application.UnLock
End If
const strChatTableHeading = "Currently in Chat "
%>
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td colspan="2"><%=strChatTableHeading%> - [<%=UBound(saryActiveChatUsers, 2)%>]</td>
</tr>
<tr class="tableRow">
<td width="96%">
<br />
<%
If UBound(saryActiveChatUsers, 2) = 0 Then
 Response.Write(vbCrLf & "No one is currently in the chatroom.")
Else
 For intArrayPass = 1 To UBound(saryActiveChatUsers, 2)
  If saryActiveChatUsers(0, intArrayPass) = True Then blnAdminInChat = True
  Response.Write(vbCrLf & saryActiveChatUsers(1, intArrayPass))
  If NOT UBound(saryActiveChatUsers, 2) = intArrayPass Then Response.Write(", ")
 Next
End If
Response.Write(vbCrLf & "  <br><br>")
Response.Write(vbCrLf & "  [ <a href=""#"" onclick=""javascript:window.open('chat/chatroom.asp?txtUsername=" & strLoggedInUsername & "&Room=" & strDefaultChatroom & "','ChatRoom','toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=590,height=500')"">Launch Chat</a> ]")
Response.Write(vbCrLf & "  </td>")
Response.Write(vbCrLf & " </tr>")
End If 'Additional End IF for above "If lngLoggedInUserID <> 0 AND lngLoggedInUserID <> 2 Then" Statement
'Copyright 2005 - Drew Gauderman - http://www.iportalx.net - http://www.aspinvision.com
'##########################################################################################
'##########################################################################################
'########################### END MADDOG MOD HERE ##########################################
'####################### Edited by JCKRUGER 04/07/2006 ####################################
'##########################################################################################
%>
--------------------------------------------------------%>--------------------------------------------
 
Hopefully it works also in forum_topic.asp
 
Cheers
 
Justin


Edited by jckruger - 04 July 2006 at 12:24am
Back to Top
Imperator View Drop Down
Newbie
Newbie


Joined: 02 October 2004
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote Imperator Quote  Post ReplyReply Direct Link To This Post Posted: 04 July 2006 at 6:16am
Code can be placed anywhere in the forum_topics, as long as you add "Dim intArrayPass" somewhere to the page. More specifically, you can also place the chat on specific chat forum sections. Example of a chat room in a specific forum section in code in the forum_topics, placed above the subforum comment:



If strForumName = "[SPECIFIC FORUM NAME]" Then

Dim intArrayPass   

(HERE YOU PLACE THE MADDOG CODE)

End If

'******************************************
'***          Display Sub Forums    ***
'******************************************
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2006 at 3:13am
I have since found out that it all works but when someone goes to a new page on the forum the chat window says that you have just entered the chat again and again as pages are viewed or refreshed.
So I have made a bit more of a change as follows. I have included a few lines above and below so you can see where it goes.
 
Top of default.asp. intArrayPass statement is quoted out.
 
-------------------------------------------------------------------------------------------------------------------------------------%>--------------------------------------------------------------------------
Dim lngSubForumNumberOfTopics 'Holds the number of topics in the subforum
Dim intTotalRecords  'Holds the number of records
Dim intCurrentRecord  'Holds the current record position
Dim intTempRecord  'Holds a temporary record position for looping through records for any checks
Dim blnSubRead   'Holds if the user has entry to the sub forum
Dim lngNoOfMembers  'Holds the number of forum members
'Dim intArrayPass  'Active users array counter ########## Removed to make my chat work correctly. DIM Statement is now in navigation_buttons_inc.asp ###########
Dim strBirthdays  'String containing all those with birtdays today
Dim dtmNow   'Now date with off-set
Dim intBirtdayLoopCounter 'Holds the bitrhday loop counter
Dim intLastForumEntryID  'Holds the last forum ID for the last entry for link in forum stats
Dim intTotalViewingForum 'Holds the number of people viewing the forum, including sub forums
 

'Initialise variables
-------------------------------------------------------------------------------------------------------------------------------------%>--------------------------------------------------------------------------
 
Same with member_profile.asp
 
-------------------------------------------------------------------------------------------------------------------------------------%>--------------------------------------------------------------------------
Dim strSignature  'Holds the signature
Dim strSkypeName  'Holds the users Skype Name
'Dim intArrayPass  'Active users array counter ########## Removed to make my chat work correctly. DIM Statement is now in navigation_buttons_inc.asp ###########
Dim intAge   'Holds the age of the user
Dim strAdminNotes  'Holds the admin notes on the user
Dim blnAccSuspended  'Holds if the user account is suspended
-------------------------------------------------------------------------------------------------------------------------------------%>--------------------------------------------------------------------------
 
Further down still in default.asp
 
-------------------------------------------------------------------------------------------------------------------------------------%>--------------------------------------------------------------------------
<!-- #include file="includes/header.asp" -->
<!-- #include file="includes/navigation_buttons_inc.asp" -->
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td colspan="2">Current Details</td>
</tr>
<tr class="tableRow">
<td width="96%">
<%
    Response.Write(strTxtTheTimeNowIs & " " & TimeFormat(now()) & "<br />")
    Response.Write("<br>Your IP Address: " & Request.ServerVariables("REMOTE_ADDR") & vbCrLf & "<br>")
    If strLoggedInUsername = "Guest" then
    Response.Write("<br><center><BIG><B><p style=""color:red;font-size:120%"">***** Only Authorised users can log into this forum *****</p></B></BIG></center><br>")
    Else
    Response.Write("Welcome: " & strLoggedInUsername & "<br>")
    End If
    If strLoggedInUsername <> "Guest" then
 Response.Write(vbCrLf & "Email Address:" & " " & strLoggedInEmail & "<br><br>")
 End If
'If this is not the first time the user has visted the site display the last visit time and date
If IsDate(Request.Cookies(strCookieName)("LV")) Then
 If dtmLastVisitDate < CDate(Request.Cookies(strCookieName)("LV")) Then
     Response.Write(strTxtYouLastVisitedOn & " " & DateFormat(dtmLastVisitDate) & " " & strTxtAt & " " & TimeFormat(dtmLastVisitDate))
 End If
End If
%>
</table>
<table class="basicTable" cellspacing="1" cellpadding="3" align="center">
 <tr>
<%
  
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 07 July 2006 at 3:16am
I have since tested it and it works on my Dev box and now have it on my live forum and have had great responses from my members.
 
Only a few glitches in the chat code now but I'll figure them out soon.
 
Justin
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 09 July 2006 at 10:56am
Also comment out Dim intArrayPass in:
 
active_users.asp
member_profile.asp.
Back to Top
chorn View Drop Down
Newbie
Newbie


Joined: 21 June 2006
Location: United States
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote chorn Quote  Post ReplyReply Direct Link To This Post Posted: 09 July 2006 at 6:08pm
Anyone here able to share a complete working default.asp for 8.03 ?
 
I have been screwing with this forever and cant seem to get it working properly
 
Thanks if someone can do that
Back to Top
jckruger View Drop Down
Groupie
Groupie
Avatar

Joined: 18 April 2006
Location: Australia
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jckruger Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2006 at 12:36am
chorn,
 
I can't as I have a lot of other mods specific to my forum and wish to keep them to myself. The above coding from me has worked for myself and another that has tried it.
 
Maybe someone else can provide the entire files if you have made my work.
Back to Top
 Post Reply Post Reply Page  <12345 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.