Visualizzazione dei risultati da 1 a 2 su 2

Discussione: utenti connessi

  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    589

    utenti connessi

    salve volevo sapere se cè uno script per visualizzare gli utenti connessi autenticati e quindi verificare se sono on line ..questo è il global.asa come individuo i vari utenti on line?


    <script language="VBScript" runat="Server">
    Sub Application_OnStart
    Application("UtentiOnLine") = 0
    End Sub

    Sub Session_OnStart
    Session.Timeout = 20
    Application.Lock
    Application("UtentiOnLine") = Application("UtentiOnLine") + 1
    Application.Unlock
    End Sub

    Sub Session_OnEnd
    Application.Lock
    Application("UtentiOnLine") = Application("UtentiOnLine") - 1
    Application.Unlock
    End Sub
    </script>

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    589
    a dimenticavo vorrei avvertire quando si autenticano in chat .. questo è il codice dellla pagina login i in chat



    <%

    '
    ' $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

    %>

    <%

    ' 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")
    Response.Redirect "chiusanolog.html"

    ElseIf (Len(userName) = 0) Then
    errorMessage = getMsg("error.missing_username")
    Response.Redirect "chiusanolog.html"

    ElseIf (Len(userName) > MAX_USERNAME_LENGTH) Then
    errorMessage = getMsg("error.username_length_exceeded", MAX_USERNAME_LENGTH)
    Response.Redirect "chiusanolog.html"

    ElseIf (userExists(userName)) Then
    errorMessage = getMsg("error.username_in_use")


    Response.Redirect "chat.asp?mode=userLogin&username=session('BlogNic k')&login=login"



    ElseIf (NOT isValidUsername(userName)) Then
    errorMessage = getMsg("error.invalid_username")

    Response.Redirect "chiusanolog.html"


    ElseIf (isUserNameBlocked(userName)) Then
    errorMessage = getMsg("error.username_blocked")

    Response.Redirect "chiusanolog.html"

    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]images/new.gif[/img]" & getMsg("user.logged_on", p.name, Now()) & "</span>
    " _
    )

    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="css/chat.css" />
    <script language="JavaScript1.2" type="text/javascript">
    <!--

    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()">

    <% If (Len(errorMessage) > 0) Then %>
    <center>


    <div class="err">
    <%= errorMessage %>
    </div>
    </center>
    <% End If %>

    <table border="0" cellspacing="0" cellpadding="0" style="position: absolute; top: 90px" width="100%">
    <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>




    <table width="240" border="0" cellspacing="0" cellpadding="2">
    <form name="frmLogin" method="GET" action="chat.asp">
    <input type="hidden" name="mode" value="userLogin">
    <tr>
    <td></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></td>
    </tr>
    <tr>
    <td></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></td>
    </tr>
    </form>
    <tr>
    <td></td>
    <td colspan=2 align=center style="color: #999999;">






    </td>
    <td></td>
    </tr>
    <tr>
    <td></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></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]images/transparent.gif[/img][img]images/ico.user.gif[/img]</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>


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

    </td>
    <td></td>
    </tr>
    </table>




    </td>
    </tr>
    <tr>
    <td style="font-size: 10px; font-weight: lighter; text-align: justify;color: #666666; padding: 8px">
    [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 ConquerChat section 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>


    <div style="position: absolute; bottom: 4px; right: 4px; padding: 4px; border: 3px dashed #bbbbbb;"></div>

    </body>
    </html>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.