Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Forum
  COMMUNITY
      OFF-TOPICS
         chat in asp

chat in asp

Autore Messaggio
sorema

Utente
Utente
69 Discussioni



Profilo - sorema
15 ottobre 2005 alle 16:23:59 Profilo - soremaInvia un messaggio privato Rispondi quotando
sarà questo il forum giusto? comunque chiedo uguale...
nel mio sito in html che voglio trasferire su aspnuke, esavo una conquer chat, che è in asp, e mi trovavo bene
come faccio ad inserirla nel nuovo portale? creo una nuova pagina e nella parte dove dice "inserisci qui il tuo codice" metto tutta la sezione in asp della pagina defautl (che riguarda il login) della conquer chat?
ma se chiedo l'anteprima nel browser mi dice che è impossibile trovare i vari includes...
non capisco... :(
carlostefano

Esperto
Esperto
296 Discussioni



Profilo - carlostefano
15 ottobre 2005 alle 16:30:20 Profilo - carlostefanoInvia un messaggio privato Rispondi quotando
che dici, problema di percorsi?
posta il codice, così vediamo...
sorema

Utente
Utente
69 Discussioni



Profilo - sorema
15 ottobre 2005 alle 18:00:40 Profilo - soremaInvia un messaggio privato Rispondi quotando
allora il codice del file default.asp della chat che ho modificato è questo:
<!-- #include file='includes/includes-inc.asp' -->
<%
sTitlePage = "nome pagina"
%>
<!-- #include file='includes/toppage-inc.asp' -->
<%
createtoptable "tabella","Nome pagina"
%>
<!-- #include file='includes/includes-inc.asp' -->
<%
sTitlePage = "nome pagina"
%>
<!-- #include file='includes/toppage-inc.asp' -->
<%
createtoptable "tabella","Nome pagina"
%>
<%

'
' $Id: default.asp,v 1.1.1.1 2003/03/09 22:45:57 peter Exp $
'
' This page is the main entrace for ConquerChat. It shows a list of currently
' logged in chatusers and makes it possible to log in by entering your user-
' name in the appropriate field.
'
' @author Peter Theill peter@theill.com
'

Option Explicit

Response.Buffer = True

%>
<!-- #include file="inc.common.asp" -->
<%

' many users does not read the included README.TXT file before trying to
' set up this chat -- in order to help them a bit we check if we have the
' required objects properly initialised
On Error Resume Next
If (NOT IsObject(conquerChatUsers) OR NOT IsObject(conquerChatRooms)) Then
Response.Redirect("errorInSetup.asp")
Response.End
End If

Dim userId

' do not show login screen if a valid session exists
If (loggedOn()) Then
Response.Redirect "frames.asp"
Response.End
End If

Dim mode, errorMessage
mode = Request("mode")

If (mode = "userLogin") Then

Dim userName
userName = Server.HTMLEncode(Request("username"))

If (countUsers() >= USERS) Then
errorMessage = getMsg("error.maximum_users_reached")
ElseIf (Len(userName) = 0) Then
errorMessage = getMsg("error.missing_username")
ElseIf (Len(userName) > MAX_USERNAME_LENGTH) Then
errorMessage = getMsg("error.username_length_exceeded", MAX_USERNAME_LENGTH)
ElseIf (userExists(userName)) Then
errorMessage = getMsg("error.username_in_use")
ElseIf (NOT isValidUsername(userName)) Then
errorMessage = getMsg("error.invalid_username")
ElseIf (isUserNameBlocked(userName)) Then
errorMessage = getMsg("error.username_blocked")
Else

Dim p
Set p = New Person
p.id = -1
p.name = userName
p.roomId = 0
p.ipAddress = Request.ServerVariables("REMOTE_ADDR")

' we have a new chat user thus we need to create a new
' id for him/her
Set p = addUser(p)

' tell all other users about this new user
Call addMessage( _
p.id, _
"-1", _
"<span class=LoggedIn><img src='images/new.gif' height=9 width=9>&nbsp;" & getMsg("user.logged_on", p.name, Now()) & "</span><br>" _
)

Session("user") = p.data

' redirect to new frame window and create a new user login
Response.Redirect("frames.asp")
Response.End

End If

End If ' > If (mode = "userLogin") Then

' make sure we don't show any inactive users for new chat users
kickInactiveUsers()

If (conquerChatRooms.Count = 0) Then
setupRooms()
End If

%>
<_html>
<_head>
<_title><%= getMsg("application.name") %><_/title>
<link rel="stylesheet" type="text/css" href="../chat/css/chat.css" />
<_Script language="Java_Script1.2" type="text/Java_Script">
<!--

function init() {
// set focus on 'username' field
f = document.frmLogin;
if (typeof f != 'undefined' && typeof f.username != 'undefined') {
f.username.select();
f.username.focus();
}
}

// -->
</_Script>
<_/head>

<_body class="frontpage" onload="init()" style="background-color: #FFFFFF">

<% If (Len(errorMessage) > 0) Then %>
<center>
<br />
<_div class="err">
<%= errorMessage %>
</_div>
</center>
<% End If %>

<table border="0" cellspacing="0" cellpadding="0" style="position: absolute; top: 90; left:230" width="415" height="303">
<tr>
<td class="hdr"><%= getMsg("login.join_chat", getMsg("application.name") & " " & getMsg("application.version")) %></td>
</tr>
<tr>
<td style="background-color: #b3d68e; border-top: 1px dashed #ffffff; border-bottom: 1px dashed #ffffff" align=center>

<br />

<table width="240" border="0" cellspacing="0" cellpadding="2">
<_form name="frmLogin" method="GET" action="../chat/default.asp">
<input type="hidden" name="mode" value="userLogin">
<tr>
<td>&nbsp;</td>
<td align=right style="font-size: 10px;"><%= getMsg("login.username") %></td>
<td width="100%"><input type=text name=username value="<%= Server.HTMLEncode(userName) %>" class=editField size=28 maxlength=32 tabindex=1></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=2 align=right><input type=submit class=btn name=login value="<%= getMsg("button.login") %>" border=0 tabindex=2 title="<%= getMsg("button.login.title") %>"></td>
<td>&nbsp;</td>
</tr>
</_form>
<tr>
<td>&nbsp;</td>
<td colspan=2 align=center style="color: #999999;">
<br>
<br>
<br>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=2>

<table width=100% border=0 cellspacing=0 cellpadding=4 style="border-right: 3px double #003300">
<tr>
<td colspan=3 class=uocap><%= getMsg("login.users_online") %></td>
</tr>
<% If (countUsers() <> 0) Then %>
<tr>
<th class=uo>&nbsp;</th>
<th class=uo><%= getMsg("login.header.username") %></th>
<th class=uo><%= getMsg("login.header.room") %></th>
</tr>
<%

' display all users and their associated rooms

Dim user, room_
For Each userId In conquerChatUsers

Set user = getUser(userId)
Set room_ = getRoom(user.roomId)
If (room_ Is Nothing) Then
Set room_ = New Room
room_.name = "N/A"
End If

Response.Write("<tr>")
Response.Write(" <td class=uo width=24><nobr><img src='images/transparent.gif' width=8 height=16><img src='images/ico.user.gif' width=16 height=16 border=0></nobr></td>")
Response.Write(" <td class=uo>" & user.name & "</td>")
Response.Write(" <td class=uo>" & Server.HTMLEncode(room_.name) & "</td>" & vbCrLf)
Response.Write("</tr>")

Next

%>
<tr>
<td class=uofoot colspan=3>
<br>
<%= getMsg("login.users_logged_on", countUsers(), USERS) %>
</td>
</tr>
<% Else %>
<tr>
<td class=uo colspan=3>&nbsp;<%= getMsg("login.no_users_online") %></td>
</tr>
<% End If %>
</table>

</td>
<td>&nbsp;</td>
</tr>
</table>

<br>

</td>
</tr>
<tr>
<td style="font-size: 10px; font-weight: lighter; text-align: justify;color: #666666; padding: 8px" bgcolor="#FFFFFF">
[This is the development version of ConquerChat -- you are able to log on to test the features of it but errors might occur since I'm working
directly on this one. This chat may not show the exact downloadable source
either since I might be in the progress of developing additional
features. If you're interested in getting the free ASP source code
for this chat, visit the <a href="http://www.theill.com/asp/conquerchat.asp" style="font-weight: bolder">ConquerChat section</a> where you're able to download all versions. If you are hosting this chat on your own server you're free to remove this notice.]</td>
</tr>
</table>

<!-- Copyright(c) 2003, The Theill Web Site -->
<_div style="position: absolute; bottom: 4px; right: 4px; padding: 4px; border: 3px dashed #bbbbbb;"><a href="http://www.theill.com/" target="_top"><img border="0" src="http://www.theill.com/images/ani_theillcom_scroll.gif" alt="Provided for free by The Theill Web Site"></a></_div>

<_/body>
<_/html>
<%
CreateBottomTable ""
%><!-- #include file='includes/bottompage-inc.asp' --><!-- #include file='includes/clearitall-inc.asp' -->
<%
CreateBottomTable ""
%>



<!-- #include file='includes/bottompage-inc.asp' -->
<!-- #include file='includes/clearitall-inc.asp' -->

i files della chat si trovano in una cartella chiamata conquerchat e quelli di aspnuke nella root.
ho anche provato cambiando il percorso per cercare i files include, pensando fosse quello, da
<!-- #include file='includes/includes-inc.asp' -->
e simili, a
<!-- #include file='http://www.nomemiosito/includes/includes-inc.asp' -->
ma o sbaglio a scrivere il percorso( probabile) o non è quella la soluzione: comunque l'errore che mi da è che non li trova, i vari includes.
grazie!

carlostefano

Esperto
Esperto
296 Discussioni



Profilo - carlostefano
15 ottobre 2005 alle 18:07:45 Profilo - carlostefanoInvia un messaggio privato Rispondi quotando
tu hai inserito i percorsi come se il file in questione si trovasse nella root, ma se nella root non è, quei percorsi non sono validi.. usa al posto di "include file = " usa "include virtual =/" e dopo backslash ci metti il resto del percorso così come l'avevi messo tu, quindi ad esempio

<!-- #include virtual='/includes/includes-inc.asp' -->
sorema

Utente
Utente
69 Discussioni



Profilo - sorema
15 ottobre 2005 alle 18:49:57 Profilo - soremaInvia un messaggio privato Rispondi quotando
nada, mi scrive che non posso metterci il backslash davanti:
Active Server Pages error 'ASP 0130'

Invalid File attribute

/conquerchat/default.asp, line 5

File attribute '/includes/toppage-inc.asp' cannot start with forward slash or back slash.
i files includes si trovano in una cartella omonima, nella root quindi il percorso, mi pare dovrebbe esser questo. piuttosto...i file della chat, default compreso, dovrebbero stare altrove o possono stare nella cartella loro?
carlostefano

Esperto
Esperto
296 Discussioni



Profilo - carlostefano
15 ottobre 2005 alle 18:53:18 Profilo - carlostefanoInvia un messaggio privato Rispondi quotando
perchè File?? avevo scritto di mettere include virtual, te capi? certo che il percorso di include file non può iniziare con backslash...
sorema

Utente
Utente
69 Discussioni



Profilo - sorema
15 ottobre 2005 alle 18:59:55 Profilo - soremaInvia un messaggio privato Rispondi quotando
che scema, scusami! però fatta la modifica su tutti gli includes..mi scrive adesso questo
Active Server Pages error 'ASP 0128'

Missing File or Virtual attribute

/conquerchat/default.asp, line 252

The Include file name must be specified using either the File or Virtual attribute.
ma nella linea 252 non c'è niente che riguardi conquerchat/default.asp..ci sono gli altri includes della pagina di aspnuke! che vuol dire?
sorema

Utente
Utente
69 Discussioni



Profilo - sorema
15 ottobre 2005 alle 19:01:07 Profilo - soremaInvia un messaggio privato Rispondi quotando
per intenderci, la riga 252 è questa
%><!-- #include virtual='/includes/bottompage-inc.asp' --><!-- #include vitual='/includes/clearitall-inc.asp' -->

(sta tutto sulla stessa fila ovviamente)
carlostefano

Esperto
Esperto
296 Discussioni



Profilo - carlostefano
15 ottobre 2005 alle 19:06:38 Profilo - carlostefanoInvia un messaggio privato Rispondi quotando
/conquerchat/default.asp è il file in cui si è verificato l'errore... è quello che contiene il codice di cui stiamo parlando, giusto?
prova a metterlo su righe distinte, così:

%>
<!-- #include virtual='/includes/bottompage-inc.asp' -->
<!-- #include vitual='/includes/clearitall-inc.asp' -->
<%
sorema

Utente
Utente
69 Discussioni



Profilo - sorema
15 ottobre 2005 alle 19:18:57 Profilo - soremaInvia un messaggio privato Rispondi quotando
1- conquerchat/default.asp è il file di cui stiamo parlando e quello che da l'errore.
2- anche mettendolo come hai detto tu, l'errore si sposta di due righe... e scrive questo
Active Server Pages error 'ASP 0128'

Missing File or Virtual attribute

/conquerchat/default.asp, line 254

The Include file name must be specified using either the File or Virtual attribute.
gli manco un file... ti riposto il codice completo, forse ti aiuta...

<!-- #include virtual='/includes/includes-inc.asp' -->
<%
sTitlePage = "nome pagina"
%>
<!-- #include virtual='/includes/toppage-inc.asp' -->
<%
createtoptable "tabella","Nome pagina"
%>
<!-- #include virtual='/includes/includes-inc.asp' -->
<%
sTitlePage = "nome pagina"
%>
<!-- #include virtual='/includes/toppage-inc.asp' -->
<%
createtoptable "tabella","Nome pagina"
%>
<%

'
' $Id: default.asp,v 1.1.1.1 2003/03/09 22:45:57 peter Exp $
'
' This page is the main entrace for ConquerChat. It shows a list of currently
' logged in chatusers and makes it possible to log in by entering your user-
' name in the appropriate field.
'
' @author Peter Theill peter@theill.com
'

Option Explicit

Response.Buffer = True

%>
<!-- #include file="inc.common.asp" -->
<%

' many users does not read the included README.TXT file before trying to
' set up this chat -- in order to help them a bit we check if we have the
' required objects properly initialised
On Error Resume Next
If (NOT IsObject(conquerChatUsers) OR NOT IsObject(conquerChatRooms)) Then
Response.Redirect("errorInSetup.asp")
Response.End
End If

Dim userId

' do not show login screen if a valid session exists
If (loggedOn()) Then
Response.Redirect "frames.asp"
Response.End
End If

Dim mode, errorMessage
mode = Request("mode")

If (mode = "userLogin") Then

Dim userName
userName = Server.HTMLEncode(Request("username"))

If (countUsers() >= USERS) Then
errorMessage = getMsg("error.maximum_users_reached")
ElseIf (Len(userName) = 0) Then
errorMessage = getMsg("error.missing_username")
ElseIf (Len(userName) > MAX_USERNAME_LENGTH) Then
errorMessage = getMsg("error.username_length_exceeded", MAX_USERNAME_LENGTH)
ElseIf (userExists(userName)) Then
errorMessage = getMsg("error.username_in_use")
ElseIf (NOT isValidUsername(userName)) Then
errorMessage = getMsg("error.invalid_username")
ElseIf (isUserNameBlocked(userName)) Then
errorMessage = getMsg("error.username_blocked")
Else

Dim p
Set p = New Person
p.id = -1
p.name = userName
p.roomId = 0
p.ipAddress = Request.ServerVariables("REMOTE_ADDR")

' we have a new chat user thus we need to create a new
' id for him/her
Set p = addUser(p)

' tell all other users about this new user
Call addMessage( _
p.id, _
"-1", _
"<span class=LoggedIn><img src='images/new.gif' height=9 width=9>&nbsp;" & getMsg("user.logged_on", p.name, Now()) & "</span><br>" _
)

Session("user") = p.data

' redirect to new frame window and create a new user login
Response.Redirect("frames.asp")
Response.End

End If

End If ' > If (mode = "userLogin") Then

' make sure we don't show any inactive users for new chat users
kickInactiveUsers()

If (conquerChatRooms.Count = 0) Then
setupRooms()
End If

%>
<_html>
<_head>
<_title><%= getMsg("application.name") %><_/title>
<link rel="stylesheet" type="text/css" href="../chat/css/chat.css" />
<_Script language="Java_Script1.2" type="text/Java_Script">
<!--

function init() {
// set focus on 'username' field
f = document.frmLogin;
if (typeof f != 'undefined' && typeof f.username != 'undefined') {
f.username.select();
f.username.focus();
}
}

// -->
</_Script>
<_/head>

<_body class="frontpage" onload="init()" style="background-color: #FFFFFF">

<% If (Len(errorMessage) > 0) Then %>
<center>
<br />
<_div class="err">
<%= errorMessage %>
</_div>
</center>
<% End If %>

<table border="0" cellspacing="0" cellpadding="0" style="position: absolute; top: 90; left:230" width="415" height="303">
<tr>
<td class="hdr"><%= getMsg("login.join_chat", getMsg("application.name") & " " & getMsg("application.version")) %></td>
</tr>
<tr>
<td style="background-color: #b3d68e; border-top: 1px dashed #ffffff; border-bottom: 1px dashed #ffffff" align=center>

<br />

<table width="240" border="0" cellspacing="0" cellpadding="2">
<_form name="frmLogin" method="GET" action="../chat/default.asp">
<input type="hidden" name="mode" value="userLogin">
<tr>
<td>&nbsp;</td>
<td align=right style="font-size: 10px;"><%= getMsg("login.username") %></td>
<td width="100%"><input type=text name=username value="<%= Server.HTMLEncode(userName) %>" class=editField size=28 maxlength=32 tabindex=1></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=2 align=right><input type=submit class=btn name=login value="<%= getMsg("button.login") %>" border=0 tabindex=2 title="<%= getMsg("button.login.title") %>"></td>
<td>&nbsp;</td>
</tr>
</_form>
<tr>
<td>&nbsp;</td>
<td colspan=2 align=center style="color: #999999;">
<br>
<br>
<br>
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan=2>

<table width=100% border=0 cellspacing=0 cellpadding=4 style="border-right: 3px double #003300">
<tr>
<td colspan=3 class=uocap><%= getMsg("login.users_online") %></td>
</tr>
<% If (countUsers() <> 0) Then %>
<tr>
<th class=uo>&nbsp;</th>
<th class=uo><%= getMsg("login.header.username") %></th>
<th class=uo><%= getMsg("login.header.room") %></th>
</tr>
<%

' display all users and their associated rooms

Dim user, room_
For Each userId In conquerChatUsers

Set user = getUser(userId)
Set room_ = getRoom(user.roomId)
If (room_ Is Nothing) Then
Set room_ = New Room
room_.name = "N/A"
End If

Response.Write("<tr>")
Response.Write(" <td class=uo width=24><nobr><img src='images/transparent.gif' width=8 height=16><img src='images/ico.user.gif' width=16 height=16 border=0></nobr></td>")
Response.Write(" <td class=uo>" & user.name & "</td>")
Response.Write(" <td class=uo>" & Server.HTMLEncode(room_.name) & "</td>" & vbCrLf)
Response.Write("</tr>")

Next

%>
<tr>
<td class=uofoot colspan=3>
<br>
<%= getMsg("login.users_logged_on", countUsers(), USERS) %>
</td>
</tr>
<% Else %>
<tr>
<td class=uo colspan=3>&nbsp;<%= getMsg("login.no_users_online") %></td>
</tr>
<% End If %>
</table>

</td>
<td>&nbsp;</td>
</tr>
</table>

<br>

</td>
</tr>
<tr>
<td style="font-size: 10px; font-weight: lighter; text-align: justify;color: #666666; padding: 8px" bgcolor="#FFFFFF">
[This is the development version of ConquerChat -- you are able to log on to test the features of it but errors might occur since I'm working
directly on this one. This chat may not show the exact downloadable source
either since I might be in the progress of developing additional
features. If you're interested in getting the free ASP source code
for this chat, visit the <a href="http://www.theill.com/asp/conquerchat.asp" style="font-weight: bolder">ConquerChat section</a> where you're able to download all versions. If you are hosting this chat on your own server you're free to remove this notice.]</td>
</tr>
</table>

<!-- Copyright(c) 2003, The Theill Web Site -->
<_div style="position: absolute; bottom: 4px; right: 4px; padding: 4px; border: 3px dashed #bbbbbb;"><a href="http://www.theill.com/" target="_top"><img border="0" src="http://www.theill.com/images/ani_theillcom_scroll.gif" alt="Provided for free by The Theill Web Site"></a></_div>

<_/body>
<_/html>
<%
CreateBottomTable ""
%>
<!-- #include virtual='/includes/bottompage-inc.asp' -->
<!-- #include vitual='/includes/clearitall-inc.asp' -->
<%
 1  2  >>

Log in

Login
Password
Memorizza i tuoi dati:

Cerca

 

Sostieni AspNuke

Un piccolo gesto per aiutarci a mantenere AspNuke.it online

Promo

MusicWebItalia.it
Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.

Visitatori

Visitatori Correnti : 171
Membri : 0 offline Anna

Iscritti

 Utenti: 18940
Ultimo iscritto : glauco
Lista iscritti
Messaggi privati: 3373 Commenti: 2210 Immagini: 39 Downloads: 144 Articoli: 49 Pagine: 101 Siti web: 425 Notizie: 180 Sondaggi: 11 Preferiti: 5165594 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi