<% Response.buffer=True %> <% if Len(Session("UserID"))=0 then Response.Redirect "error1.asp" %> <% 'Response.write (Session("UserID")) If (Session("UserID"))="" Then Response.Redirect "../login.asp?error=1" ElseIf session("userID")<>"" then Dim pduser set pduser = CreateObject("Adodb.Recordset") pduser.open "select * from members where ID=" & session("userID") & " and paid=true", objconn, 3, 3 if pduser.eof then Response.Redirect "../paynow.asp?msg=chat" end if End If %> [an error occurred while processing this directive] <% Dim MyPWD Dim Conn Dim connStr Dim Sql Dim RS Dim Rows Dim sRoom Dim gName Dim gCnt Dim PWD Dim Views Dim RefreshRate Dim RoomArray() Dim SetCnt Dim Chat_List() Dim Chat_Rooms() Dim i Dim x Dim Loggout Dim ChatCnt Dim Ncnt Dim Notify() Dim rsuser,errmsg Ncnt = 0 Session("Loggout")= False Set conn = Server.CreateObject("ADODB.Connection") 'connStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(MyCon) 'Conn.Open connStr Conn.Open("dsn=tantraco-tantra") If Len(Application("User_Cnt")) = 0 Then Application("User_Cnt") = 0 End If '// Check the Application("Notify") array for null entries If IsArray(Application("Notify")) Then For i = 0 to Ubound(Application("Notify")) If Len(Trim(Application("Notify")(i))) > 0 Then Ncnt=Ncnt + 1 End If next If Ncnt > 0 Then ReDim Notify(Ncnt-1) For i = 0 to Ubound(Application("Notify")) If Len(Trim(Application("Notify")(i))) > 0 Then Notify(i) = Application("Notify")(i) End If next Else Redim Notify(-1) End If Application.Lock Application("Notify")=Notify Application.UnLock End If '///////////////////////////////////////////////////////////// '// use these to clear the appliation variables for testing // '///////////////////////////////////////////////////////////// Application("Rooms_Cnt")=0 'Application("Chat_List")="" 'Application("User_Cnt") = 0 'Application("Notify")="" If Len(Application("Rooms_Cnt"))= 0 Then Application("Rooms_Cnt") = 0 End If Set rsuser=Server.CreateObject("Adodb.recordset") rsuser.activeconnection=Conn rsuser.locktype=2 if Len(Session("UserID"))>0 then rsuser.open("Select * from Members where ID="&Session("UserID")) if not rsuser.eof then gName=rsuser("nickname") MyPWD=rsuser("Password") response.cookies("Chat") ("User") = gName response.cookies("Chat") ("PWD") = MyPWD Response.Cookies("Chat").Expires = Date + 365 else errmsg="Unauthorized Access." response.redirect"error.asp?Error="&errmsg&"" end if rsuser.close else response.redirect "error1.asp" end if If Application("Rooms_Cnt") = 0 Then '////////////////////////////////////////////// '// Update Application("Chat_Rooms") Variable // '// from the database. // '////////////////////////////////////////////// Sql="SELECT * From Rooms Order By Room;" Set RS=Server.CreateObject("ADODB.Recordset") RS.Open Sql, Conn, 3, 3 Rows=RS.RecordCount Application("Rooms_Cnt")= Rows ReDim RoomArray((Rows-1),3) SetCnt = 0 Do While Not RS.EOF RoomArray((SetCnt),(0)) = RS("Room") RoomArray((SetCnt),(1)) = RS("MaxUser") RoomArray((SetCnt),(2)) = RS("Catagory") RoomArray((SetCnt),(3)) = "0" SetCnt=SetCnt + 1 RS.MoveNext Loop Application.Lock Application("Chat_Rooms")= RoomArray Application.UnLock RS.Close Conn.Close Set RS=Nothing Set Conn=Nothing Else '/////////////////////////////////////////////// '// Check for error in chatroom user count // '// of the application("Chat_Rooms") variable // '// This function is just incase there was a // '// problem when a user left the room // '/////////////////////////////////////////////// ReDim Chat_Rooms(Ubound(Application("Chat_Rooms")),3) for i = 0 to Ubound(Chat_Rooms) ChatCnt = 0 Chat_Rooms(i,0) = Application("Chat_Rooms")(i,0) Chat_Rooms(i,1) = Application("Chat_Rooms")(i,1) Chat_Rooms(i,2) = Application("Chat_Rooms")(i,2) If Len(Application("User_Cnt")) > 0 And Application("User_Cnt") > 0 Then for x = 0 to Ubound(application("Chat_List")) If Trim(Application("Chat_List")(x,3)) = Trim(Application("Chat_Rooms")(i,0)) Then If DateValue(Application("Chat_List")(x,4)) = Date() Then ChatCnt = ChatCnt + 1 End If End If next End If Chat_Rooms(i,3) = ChatCnt Next Application.Lock Application("Chat_Rooms")="" Application("Chat_Rooms")=Chat_Rooms Application.UnLock End If '///////////////////////////////////////////////////////// '// If there is no chat rooms available show ths message// '///////////////////////////////////////////////////////// If Application("Rooms_Cnt")=0 Then Response.write"

" & vbcrlf Response.write" " & vbcrlf Response.write"

" & vbcrlf Response.write" " & vbcrlf Response.write"

" & vbcrlf Response.write"

" & vbcrlf Response.write"No Chat rooms in session, please check back" & vbcrlf Response.write"

" & vbcrlf Response.write"Back" & vbcrlf Response.write"

" & vbcrlf Response.end End If '/////////////////////////////////////////////////////////// '// If there is only 1 chat room send user directly there // '// and update the Application("Chat_List") and the // '// Application("Chat_Rooms") variables. // '/////////////////////////////////////////////////////////// If Application("Rooms_Cnt") = 1 Then Application.Lock Session("User")=gName Session("PWD")=MyPWD Session("Email")=Request.form("nickname") Session("Room")=Application("Chat_Rooms")(0,0) ReDim Chat_Rooms(UBound(Application("Chat_Rooms")),3) for x = 0 to UBound(Chat_Rooms) Chat_Rooms(x,0) = Application("Chat_Rooms")(x,0) Chat_Rooms(x,1) = Application("Chat_Rooms")(x,1) Chat_Rooms(x,2) = Application("Chat_Rooms")(x,2) If Application("Chat_Rooms")(x,0)=Session("Room") Then Chat_rooms(x,3)= Application("Chat_Rooms")(x,3) + 1 Else Chat_rooms(x,3)= Application("Chat_Rooms")(x,3) End If Next Application("Chat_Rooms")= Chat_Rooms Session("Catagory")=Application("Chat_Rooms")(0,2) Session("Views")= 10 Session("RefreshRate")=5 '***************************************************** '** Create/Update the chat users cookie information ** '***************************************************** If Len(Trim(Request.Cookies("ChatUser")("User"))) = 0 Then Response.Cookies("ChatUser")("User") = gName Response.Cookies("ChatUser")("PWD") = MyPWD Response.Cookies("ChatUser")("Email") = Request.form("Email") Response.Cookies("ChatUser")("Views") = 10 Response.Cookies("ChatUser")("RefreshRate") = 5 Response.Cookies("ChatUser")("rOrder") = "Desc" Response.Cookies("ChatUser")("Face") = "" End If Response.Cookies("ChatUser")("Room") = Application("Chat_Rooms")(0,0) Response.Cookies("ChatUser")("Catagory") = Application("Chat_Rooms")(0,2) Response.Cookies("ChatUser").expires = Date + 365 '// Check to see if the user is currently in the Application("Chat_List") Array '// If so don't add them again StrDontAdd = False If IsArray(Application("Chat_List")) Then For i = 0 to Ubound(Application("Chat_List")) If (Trim(Application("Chat_List")(i,0)) = Trim(gName)) And (Trim(Application("Chat_List")(i,1)) = Trim(MyPWD)) Then StrDontAdd = True Exit For Else StrDontAdd = False End If next End If If StrDontAdd = False Then If Not IsArray(Application("Chat_List")) Then Redim Chat_List(0,4) Chat_List(0,0)= gName Chat_List(0,1)= MyPWD Chat_List(0,2)= Request.form("Email") Chat_List(0,3)= Application("Chat_Rooms")(0,0) Chat_List(0,4)= Now() Else ReDim Chat_List((Ubound(Application("Chat_List"))+1),4) For i = 0 to Ubound(Application("Chat_List")) Chat_List (i,0) = Application("Chat_List")(i,0) Chat_List (i,1) = Application("Chat_List")(i,1) Chat_List (i,2) = Application("Chat_List")(i,2) Chat_List (i,3) = Application("Chat_List")(i,3) Chat_List (i,4) = Application("Chat_List")(i,4) Next Chat_List (i,0) = gName Chat_List (i,1) = MyPWD Chat_List (i,2) = Request.form("Email") Chat_List (i,3) = Application("Chat_Rooms")(0,0) Chat_List (i,4) = Now() End If Application("Chat_List") = Chat_List Application("User_Cnt") = Application("User_Cnt") + 1 Application.UnLock End If Response.Redirect"chat.asp" Response.end End If '///////////////////////////////////////////////////////// '// If there are multple chat rooms show the logon form // '///////////////////////////////////////////////////////// %> Select a Room
button3 <%if session("aff_userid")="" then%> <%else%> button3 <%end if%>

Log On to Room

">

Join a Room
 

<% Response.write "" %>
 
ASHITOSH INTERNATIONAL

ARTICLES |  FAQ | HEAL | TESTIMONIALS | SUCCESS STORIES

 VISION
| TELL YOUR FRIENDS | RATE US
 

©Copyright 2003 TantraConnection.com

Best viewed at 1024 x 800 pixels.
Contact Webmaster