I have the Adventia Chat Server 3.0 Premium on my website and I have a few questions that hopefully you can help me with. My chat room is located here: http://www.noodlebugs.com/adventia/chat/
1) When a person logs in and out and has been kicked for inactivity, it shows on the chat screen. Can I edit the code to not display this?
2) Is there a way to edit the code to display the broadcast messages in the chat log?
3) Is there a way to edit the code so that the new chat messages appear at the bottom instead of always at the top?
If you need any other info please let me know. Thanks for your help in advance.
my3texasboys
09-01-2004, 09:29 PM
Guess no one can help. Thanks anyway.
lmf232s
09-01-2004, 09:58 PM
Some of us have a life, cant be on the computer 24/7.
You only gave it a couple of hours.
As for your questions.
1) When a person logs in and out and has been kicked for inactivity, it shows on the chat screen. Can I edit the code to not display this?
Yes
2) Is there a way to edit the code to display the broadcast messages in the chat log?
Yes
3) Is there a way to edit the code so that the new chat messages appear at the bottom instead of always at the top?
Yes.
Hope that helps.
If you want to know exaclty how, your going to have to post some code
my3texasboys
09-01-2004, 10:12 PM
Originally posted by lmf232s
Some of us have a life, cant be on the computer 24/7.
You only gave it a couple of hours.
As for your questions.
Yes
Yes
Yes.
Hope that helps.
If you want to know exaclty how, your going to have to post some code
Ummm...try nearly a week not a couple of hours. I posted that question last Friday. As I said in my previous post, I do not know much about ASP therefore I have no idea what code I would need to post that would be helpful to someone that does know what they are doing.
lmf232s
09-01-2004, 10:23 PM
You right i was looking a the wrong date.
Any who, I guess no one knew the answer but im willing to give it a shot.
Need to see some code to see how it is displayed and what not.
Not sure what you need to post. I would say all of it but not sure how much you are dealing with. It seems like a really simple chat application so it should not be that difficult.
Pick a page and post it. well start with that. It looks like it has frames so pick the page that sounds like post.asp or something like that.
my3texasboys
09-02-2004, 02:46 PM
Here is the code for the admin panel where the moderation button is:
<!--#INCLUDE FILE="blnShowModerationPanel.asp"-->
<!--#INCLUDE FILE="blnRemoveSingleUser.asp"-->
<%
option explicit
'************************************************************
'* ASP ADVENTIA CHAT SERVER - Version 3.1 *
'* Copyright 2000, Adventia Software - All Rights Reserved *
'* URL: http://www.adventia.com E-mail: info@adventia.com *
'************************************************************
dim sAdmin,sPassword
sAdmin=request.form("admin")
sPassword=request.form("password")
response.addheader "Pragma","no-cache"
%>
<HTML>
<HEAD>
<TITLE>Adventia Chat Control Panel</TITLE>
</HEAD>
<BODY>
<%
if sAdmin=application("administrator") and sPassword=application("admin_password") then
dim blnOK,sAction,sAudience,sLogFile,sText
sAction=request.form("action")
blnOK=nProcessAdminInput(sAction,sAudience,sLogFile,sText)
response.write("<TABLE BORDER=""1"" CELLSPACING=""0""><TR VALIGN=""TOP""><TD>")
blnOK=nShowAdminMenu(sAdmin,sPassword)
response.write("</TD><TD>")
blnOK=nShowAdminDisplay(sAction,sAudience,sLogFile,sText)
response.write("</TD><TR><TD VALIGN=""TOP"">")
blnOK=blnShowModerationPanel(sAdmin,sPassword)
response.write("</TD></TR></TABLE>")
else 'Display login screen
%>
<b>Administrator Login:</b>
<FORM ACTION="admin.asp" METHOD=POST>
User: <Input TYPE=TEXT VALUE="" size="10" NAME="admin"><BR>
Pwd : <Input TYPE=PASSWORD VALUE="" size="10" NAME="password"><BR>
<Input TYPE=SUBMIT VALUE="GO">
</FORM>
<!--#INCLUDE FILE="setFocus.js"-->
<%
end if
%>
</BODY>
</HTML>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Function nProcessAdminInput(sAction,sAudience,sLogFile,sText)
dim sUsername,blnOK,j,i,aVisitors,sTarget
sText=request.form("t")
sAudience=request.form("a")
sUsername=request.cookies("u")
sTarget=request.form("target")
if sAction="GO" then
if sText="remove" then
application.lock
if sAudience <>"ALL" then
blnOK=blnRemoveSingleUser(sAudience)
application("TextStream") = "<B>" & sAudience & " was removed from the chat by the Administrator</B> (" & Now & ")<BR>" & application("TextStream")
else 'Remove everybody
aVisitors=split(application("visitors"),",")
for i = 0 to ubound(aVisitors)
for j=0 to 5
if aVisitors(i) <> "" then
if application(aVisitors(i) & j) <> "" then application(aVisitors(i) & j) = ""
end if
next
next
application("visitors") = ""
end if
application.unlock
elseif sText="ban" and sAudience <> "ALL" then 'issue: we can't ban everybody
application.lock
if application("banned") = "" then
application("banned") = sAudience
else
application("banned") = sAudience & "," & application("banned")
end if
blnOK=blnRemoveSingleUser(sAudience)
application("TextStream") = "<B>" & sAudience & " was banned from the chat by the Administrator</B> (" & Now & ")<BR>" & application("TextStream")
application.unlock
end if
elseif sAction="OK" then
dim aBanned,strTemp
aBanned=split(application("banned"),",")
for i = 0 to ubound(aBanned)
if ucase(aBanned(i))<>ucase(sTarget) then strTemp = strTemp & aBanned(i) & ","
next
if right(strTemp,1)="," then strTemp = left(strTemp,len(strTemp)-len(","))
application.lock
application("banned") = strTemp
application.unlock
elseif sAction="Clear Conversation" then
application.lock
application("TextStream") = ""
application.unlock
elseif sAction="Show Room Log" then
dim sLogFileName,objFS,objFile,sTemp
sLogFileName = request.servervariables("APPL_PHYSICAL_PATH") & Application("LogFile")
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFile = objFS.OpenTextFile(sLogFileName, 1)
While not objFile.AtEndOfStream
sTemp=objFile.ReadLine
if instr(sTemp,cstr(date))>0 then
sLogFile=sLogFile & sTemp & "<BR>"
end if
Wend
objFile.Close
set objFS=nothing
elseif sAction="Save Chat Transcript" then
application.lock
Application("LogSession")=True
application.unlock
elseif sAction="Stop Saving" then
application.lock
Application("LogSession")=False
application.unlock
end if
End Function
Function nShowAdminMenu (sAdmin,sPassword)
dim sSelected,aVisitors,i
response.write("<small>Current Server Date/Time:<br>" & now & "</small><hr>")
response.write("<FORM ACTION=""admin.asp"" METHOD=POST>")
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""Show Room Log""><BR>")
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""Show User Activity""><BR><BR>")
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""Show Conversation""><BR>")
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""Clear Conversation""><BR>")
if Application("LogSession")=True then
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""Stop Saving""><BR><BR>")
else
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""Save Chat Transcript""><BR><BR>")
end if
response.write("<SELECT NAME=""t"">")
response.write("<option selected value=""remove"">Remove</option>")
response.write("<option value=""ban"">Ban</option>")
response.write("</SELECT>")
aVisitors=split(application("visitors"),",")
response.write("<select name=""a"" size=""1"">")
sSelected=""
' if sAudience="ALL" then sSelected="selected"
for i = 0 to ubound(aVisitors)
sSelected=""
if aVisitors(i) <> "" and aVisitors(i) <> sAdmin then
' if aVisitors(i) = sAudience then sSelected="selected"
response.write ("<option " & sSelected & " value=" & aVisitors(i) & ">" & aVisitors(i) & "</option>")
end if
next
response.write("<option " & sSelected & " value=""ALL"">ALL</option>")
response.write("</select>")
response.write("<Input TYPE=HIDDEN NAME=""admin"" VALUE=""" & sAdmin & """>")
response.write("<Input TYPE=HIDDEN NAME=""password"" VALUE=""" & sPassword & """>")
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""GO""><BR>")
' response.write(application("banned"))
if len(application("banned")) > 1 then
dim aBanned
aBanned=split(application("banned"),",")
response.write("Lift ban for: <select name=""target"" size=""1"">")
for i = 0 to ubound(aBanned)
sSelected=""
if aBanned(i) <> "" and aBanned(i) <> sAdmin then
response.write ("<option " & sSelected & " value=" & aBanned(i) & ">" & aBanned(i) & "</option>")
end if
next
response.write("</select>")
response.write("<Input TYPE=SUBMIT NAME=""action"" VALUE=""OK""><BR>")
end if
response.write("<BR><Input TYPE=SUBMIT NAME=""action"" VALUE=""Broadcast"">")
response.write("<Input TYPE=TEXT NAME=""message"" SIZE=""12"">")
response.write("</FORM>")
end function
Function nShowAdminDisplay (sAction,sAudience,sLogFile,sText)
dim aVisitors,nTimeInactive,i
aVisitors=split(application("visitors"),",")
If sAction="GO" then
If sText="remove" then
response.write(sAudience & " was removed.<BR>")
elseif sText="ban" then
response.write(sAudience & " was banned.<BR>")
End If
elseif sAction="OK" then
dim sTarget
sTarget = request.form("target")
response.write("The ban for " & sTarget & " has been lifted.")
elseif sAction="Clear Conversation" then
response.write("The text buffer was cleared.")
elseIf sAction="Show Room Log" then
response.write("<PRE>" & sLogFile & "</PRE>")
elseif sAction="Show Conversation" then
response.write(application("TextStream"))
elseif sAction="Save Chat Transcript" then
response.write("Chat transcript is being saved to " & request.servervariables("APPL_PHYSICAL_PATH") & Application("TranscriptFile"))
elseif sAction="Stop Saving" then
response.write("Chat transcript was saved to " & request.servervariables("APPL_PHYSICAL_PATH") & Application("TranscriptFile"))
elseif sAction="Show User Activity" then
for i = 0 to ubound(aVisitors)
if aVisitors(i) <>"" then
nTimeInactive=now - application("t_" & aVisitors(i))
response.write (aVisitors(i) & ": " & " last talked at " & _
application("t_" & aVisitors(i)) & ". Inactive for " & _
hour(nTimeInactive) & " hours " & minute(nTimeInactive) & " minutes<BR>")
if hour(nTimeInactive)>0 or minute(nTimeInactive)>application("TimeLimit") then
blnOK=blnRemoveSingleUser(aVisitors(i))
response.write(aVisitors(i) & " has been removed")
response.write("<BR>")
application.lock
application("TextStream") = "<B>" & aVisitors(i) & " was removed due to inactivity</B> (" & Now & ")<BR>" & application("TextStream")
application.unlock
end if
end if
next
elseif sAction="Broadcast" then
application.lock
application("TextStream") = "<b>Moderator Message:</b> " & request.form("message") & " (" & Now & ")<BR>" & application("TextStream")
application.unlock
response.write(application("TextStream"))
end if
End Function
</SCRIPT>
my3texasboys
09-02-2004, 02:48 PM
And here is the main chat page display where it shows all messages including everyone entering and leaving with the except of the Moderation message.
<%
'************************************************************
'* ASP ADVENTIA CHAT SERVER - Version 3.1 *
'* Copyright 2000, Adventia Software - All Rights Reserved *
'* URL: http://www.adventia.com E-mail: info@adventia.com *
'************************************************************
Option Explicit
dim sUsername, nUserExists, sError, blnValidated
dim aVisitors
dim i, sTextBuffer, nTables, nMarker, nMaxBufferLength
' Check if user is logged on
nUserExists=False
aVisitors=split(application("visitors"),",")
for i = 0 to ubound(aVisitors)
if aVisitors(i)=sUsername then nUserExists=True
next
'If sUsername="" or not nUserExists or not blnValidated then
If sUsername="" or not nUserExists or ucase(blnValidated)<>"TRUE" then
sError="empty"
response.redirect("login.asp?error=" & sError & "&target=parent")
End If
response.addheader "Pragma","no-cache"
%>
<HTML><HEAD><title>Display</title><META HTTP-EQUIV="REFRESH" CONTENT="<%=application("RefreshRate")%>"></HEAD>
<%
if application("C_" & sUsername) <> "" then
response.write("<BODY BGCOLOR=""#FFFFFF"" onLoad=""window.open('main_frame_private.asp?tid=" & server.urlencode(time) & "&an=yes&o=" & application("C_" & sUsername) & "&g=" & sUsername & "','_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes, copyhistory=no,width=480,height=300')"">")
application.lock()
application("C_" & sUsername)=""
application.unlock()
else
%>
<BODY BGCOLOR="#FFFFFF"><%
end if
sTextBuffer=application("TextStream")
if len(sTextBuffer) > nMaxBufferLength then
nMarker = instr(nMaxBufferLength,sTextBuffer,"<BR>")
if nMarker>0 then
sTextBuffer = left(sTextBuffer,nMarker-1)
application.lock
application("TextStream") = sTextBuffer
application.unlock
end if
end if
response.write application("TextStream")
%></BODY></HTML>
lmf232s
09-02-2004, 03:01 PM
Neither of those pages had what i was looking for.
Try this to narrow it down.
What are you viewing the pages in(text editor, etc)?
What you might want to do is a find/replace(without replacing anything yet) on every page you have.
This section is to help find the code that displays when someone gets kicked from the room for inactivity.
1) When a person logs in and out and has been kicked for inactivity, it shows on the chat screen. Can I edit the code to not display this?
What youll be looking for is something like
response.write aVisitors(i) & "Time has expired"
Im not sure what message displays when someone gets kicked for inactivity.
You should know what it says. So take the part of the message - the user name and youll have the string that you can search for.
SO do a ctrl+F for find and on every page search for the text that displays when a user is inactive. Again do not include the name of the user becauase this is being set by some variable such as aVisitors(i).
Well fix that one then well move on.
You understand this, i just hope im not rambling on.
my3texasboys
09-02-2004, 03:37 PM
Ok since I have no clue which file I need to post, here are the files I have:
my3texasboys,
Check everyfile for the string message that is displayed when a user gets
kicked off for inactivity. Im not sure what file it is in.
If i had to guess i would say
display_frame.asp
input_frame.asp
but im not sure.
In an effort to not have you post all the pages, you should check to see if you can find the code in one of the pages.
The string message that is displayed when a users gets kicked off for inactivity will be hard coded in the page most likely.
SO all you need to do is open every page and do a find and replace(with out replacing anything) and see what page contains the
string message that is displayed when a user gets kicked off.
Now you dont want to include the name of the user becuase this is being stored in a session variable and you will not find a match in the code.
Check that out and see if you can find anything and let me know.
my3texasboys
09-03-2004, 09:52 AM
Thank you. I did find that message in the admin.asp and I removed the text so now it just shows the username which is much better than the text of user has been removed for inactivity.
lmf232s
09-05-2004, 04:53 PM
You can probably take out the name as well so it does not display as well, unless you like it the way it is. You may want to document in code where you took that out incase you ever need to replace that line of code to the originall or even modify it to do something else.
For you next question
Is there a way to edit the code to display the broadcast messages in the chat log?
What is the braodcast message?
Where is it coming from?
What info does it contain?
Is the message stored anywhere (text file/ DB)?
Is it important that people in the chat room see it?
webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved.