Categorias

Chat Hanso com ASP e Flash

Um ótimo Chat com detalhes em Flash, ótimo para seu site, um site moderno !
Combina com qualquer pagina, teste em seu site e tenha certeza que trará uma otima aparência.

Este Chat em ASP é facil de editar e tem a aparência de um bate papo profissional e é bastante rápido.

<%@Language = "VBScript"%>
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1000

Dim vAction
Dim vChatName, vPassword, vNewName, vUserPassword, vRoomPassword
Dim vUserArray, vMoodArray, vUserCount
Dim vRoomNo, vNewRoomNo, vCheckOp
Dim vINIFile, x

vAction = Request.QueryString("action")
vChatName = "" & Session("ChatName")

%><%

If vAction = "getuser" Then
	If vChatName <> "" Then
		Response.Write "UserName=" & Server.URLEncode(vChatName) & "&Result=OK"
	Else
		Response.Write "Result=NotLoggedIn"
	End If
	Response.Flush
	Response.End
End If

%><%
Application.Lock

Select Case vAction
Case "login"
	If vChatName <> "" Then
		'already logged in
		Session.Timeout = 2
		Session("LastLine") = Session("StartLine")
		Response.Write "Result=OK"
	Else
		vRoomNo = 1
		vUserArray = Application("ChatUsers" & vRoomNo)
		vMoodArray = Application("ChatMoods" & vRoomNo)
		vUserCount = Application("UserCount" & vRoomNo)
		vNewName = Trim(Request.Form("txtUserName"))
		vPassword = Request.Form("txtPassword")
	
		vCheckOp = CheckOp(vNewName, vPassword)
		If vCheckOp = "BadPassword" Then
			If vPassword = "" Then
				Response.Write "Result=Password"
			Else
				Response.Write "Result=BadPassword"
			End If
		Else
			If LogUserIn(vNewName, vUserArray, vMoodArray, vUserCount) = True Then
				Session("Kicked") = "False"
				If vCheckOp = "OK" Then
					Session("Op") = "True"
					Session("Password") = vPassword
				Else
					Session("Op") ="False"
					Session("Password") = ""
				End If
				Session("ChatName") = vNewName
				Session("RoomNo") = vRoomNo
				Application("ChatUsers" & vRoomNo) = vUserArray
				Application("ChatMoods" & vRoomNo) = vMoodArray
				Application("UserCount" & vRoomNo) = vUserCount
				AddLineToChat vRoomNo, "**" & vNewName & " has arrived**"
				Session("StartLine") = Application("ChatLineCount" & vRoomNo)
				Session("LastLine") = Application("ChatLineCount" & vRoomNo)
				Session.Timeout = 2
				Response.Write "Result=OK&Users=" & Application("UserCount1")
			Else
				Response.Write "Result=BadLogin"
			End If
		End If
	End If
Case "logout"
	vRoomNo = Session("RoomNo")
	vUserArray = Application("ChatUsers" & vRoomNo)
	vMoodArray = Application("ChatMoods" & vRoomNo)
	vUserCount = Application("UserCount" & vRoomNo)
	If LogUserOut(vChatName, vUserArray, vMoodArray, vUserCount) Then
		If vUserCount = 0 Then
			Application("ChatLines" & vRoomNo) = "" 
			Application("ChatLineCount" & vRoomNo) = 0
			Application("ChatMaxLines" & vRoomNo) = 0
		End If
		Application("ChatUsers" & vRoomNo) = vUserArray
		Application("ChatMoods" & vRoomNo) = vMoodArray
		Application("UserCount" & vRoomNo) = vUserCount
	End If
	Session("ChatName") = ""
	Session.Timeout = 20
	If Session("Kicked") = "True" Then
		x = Instr(vChatName,"[")
		If x > 1 Then vChatName = Left(vChatName, x - 1)
		AddLineToChat vRoomNo, "**" & vChatName & " has left (kicked)**"
	Else
		AddLineToChat vRoomNo, "**" & vChatName & " has left (quit)**"
	End If
	Response.Write "Result=OK"
Case "changeroom"
	vINIFile = Application("INIFile")
	vRoomNo = Session("RoomNo")
	vNewRoomNo = Request.QueryString("room")
	
	vUserPassword = Request.QueryString("Password")
	vRoomPassword = INIFileValue(vINIFile, "Rooms", "Password" & vNewRoomNo)
	If UCase(vRoomPassword) <> "" And UCase(vRoomPassword) <> UCase(vUserPassword) Then
		Response.Write "Result=Denied&Password=" & vUserPassword
	Else	
		If vRoomNo = vNewRoomNo Then
			Response.Write "Result=OK"
		Else
			vUserArray = Application("ChatUsers" & vRoomNo)
			vMoodArray = Application("ChatMoods" & vRoomNo)
			vUserCount = Application("UserCount" & vRoomNo)
			If LogUserOut(vChatName, vUserArray, vMoodArray, vUserCount) Then
				AddLineToChat vRoomNo, "**" & vChatName & " has left (quit)**"
				If vUserCount = 0 Then
					Application("ChatLines" & vRoomNo) = "" 
					Application("ChatLineCount" & vRoomNo) = 0
					Application("ChatMaxLines" & vRoomNo) = 0
				End If
				Application("ChatUsers" & vRoomNo) = vUserArray
				Application("ChatMoods" & vRoomNo) = vMoodArray
				Application("UserCount" & vRoomNo) = vUserCount
			End If
			
			vUserArray = Application("ChatUsers" & vNewRoomNo)
			vMoodArray = Application("ChatMoods" & vNewRoomNo)
			vUserCount = Application("UserCount" & vNewRoomNo)
			
			If LogUserIn(vChatName, vUserArray, vMoodArray, vUserCount) = True Then
				Session("RoomNo") = vNewRoomNo
				AddLineToChat vNewRoomNo, "**" & vChatName & " has arrived**"
				Application("ChatUsers" & vNewRoomNo) = vUserArray
				Application("ChatMoods" & vNewRoomNo) = vMoodArray
				Application("UserCount" & vNewRoomNo) = vUserCount
				Session("StartLine") = Application("ChatLineCount" & vNewRoomNo)
				Session("LastLine") = Application("ChatLineCount" & vNewRoomNo)
				Response.Write "Result=OK"
			Else
				Response.Write "Result=BadLogin"
			End If
		End If
	End If
	
End Select

Application.Unlock
Response.Flush
Response.End
%>

Arquivos para Download:

chat_hanso.zip