Visualizzazione dei risultati da 1 a 8 su 8

Discussione: Informazione

  1. #1

    Informazione

    Ciao a tutti, sono nuovo del forum, e non sono tanto esperto di asp, ho trovato uno script, l'ho installato e funziona correttamente, è uno script per visualizzare gli utenti online,l'unica cosa mi crea un collegamento ad una pagina popup che permette di visualizzare a tutti gli ip e il luogo di provenienza, vorrei eliminare questo collegamento per poter visualizzare solo io queste informazioni, inserisco il codice e se qualcuno può aiutarmi ne sarei grato, perchè non so dove mettere mano grazie a tutti
    Guido
    il codice:

    <% Response.buffer = True
    '-----------------------------------------------------------------------------------------------------
    '- ASP ActiveUsers - Version 1.0 - 13 January 2006
    '- Credits to an original article of Josh Painter (http://www.joshpainter.com)
    '- Copyright © 2006 - modified by Livio Siri (http://www.livio.net) - All Rights Reserved.
    '-----------------------------------------------------------------------------------------------------

    '######### Configuration #########################

    '--- The Session("bLoginOK") enables the full IP view and WHOIS link.
    '--- If TRUE you can display the full IP number and perform an IP Whois to know more details about your online visitors.
    '--- If your site has an administration system, the Session("bLoginOK") should hold the site administrator login status.
    '--- Fill it with your own login system Session status like: Session("bLoginOK") = Session("YOUR_LOGIN_SESSION_NAME")
    '--- WARNING: For privacy reasons the visitor IP should be hidden from generic users view, then default should be left FALSE

    '--- The Session("bLoginOK") = True enables the full IP view and WHOIS link.
    '--- If your site has an administration system then the Session("bLoginOK") should hold the site administrator login status.
    '--- Fill it with your own login system Session status like: Session("bLoginOK") = Session("YOUR_LOGIN_SESSION_NAME")
    '--- WARNING: For privacy reasons the visitor IP should be hidden from generic users view,
    '--- then for default the Session("bLoginOK") is FALSE
    Session("bLoginOK") = True

    '--- Show Who is Online into a pop-up window (True) or in your own created ASP page (False)
    bShowPopUp = True

    '--- If bShowPopUp = False then define here your Who is Online page name, refered to the root dir
    sWhoIsOnlinePage = "whoisonlinetest.asp"

    '--- The ActiveUsers script path, refered to the root dir
    sActiveUsersPath = "/activeusers/"

    '--- In minutes, how long before a User is considered Inactive and is deleted from ActiveUserList
    intActiveUserTimeout = 15

    '--- In minutes, how often should the ActiveUserList be cleaned up.
    intActiveUserCleanupTime = 1

    '######### Configuration End ######################

    Session.LCID = 1040

    '--- Dim global variables
    Dim bShowPopUp
    Dim sWhoIsOnlinePage
    Dim sActiveUsersPath
    Dim intActiveUserCleanupTime
    Dim intActiveUserTimeout

    '============== CORE =============================================
    Call LogActiveUser()
    Call ActiveUserCleanup()

    '============== Hide the visitor IP number ================================
    Function sNewUserIP(IP)
    ' On error resume next
    Dim Tmp, i, sNewIP
    Tmp = split(IP,".", -1, 1)
    i = 0
    do until i = Ubound(tmp) +1
    If i = 2 Then
    sNewIP = sNewIP & String(len(tmp(2)), "x") & "." ' "xxx."
    Else
    sNewIP = sNewIP & tmp(i) & "."
    End if
    i = i + 1
    loop
    erase Tmp
    If len(sNewIP) > 0 then
    sNewIP = left(sNewIP, Len(sNewIP)-1)
    else
    sNewIP = "(unknown)"
    end if
    sNewUserIP = sNewIP
    End Function

    '============= Log Active Users =======================================
    Sub LogActiveUser
    Dim strActiveUserList
    Dim intUserStart, intUserEnd
    Dim strUser
    Dim strDate
    Dim inStart
    strActiveUserList = Application("ActiveUserListLog")
    inStart = Instr(1, strActiveUserList, Session.SessionID)
    If inStart > 0 Then
    Application.Lock
    intUserStart = Instr(inStart, strActiveUserList, "_Page")+5
    intUserEnd = Instr(intUserStart, strActiveUserList, "|")
    strUser = Mid(strActiveUserList, intUserStart, intUserEnd - intUserStart)
    strActiveUserList = Replace(strActiveUserList, strUser, request.servervariables("path_info") & "?" & request.querystring & ":" & Now())
    Application("ActiveUserListLog") = strActiveUserList
    Application.UnLock
    Else
    Application.Lock
    Application("ActiveUsersLog") = CInt(Application("ActiveUsersLog")) + 1
    Application("ActiveUserListLog") = Application("ActiveUserListLog") & Session.SessionID &_
    "_IP" & Request.ServerVariables("REMOTE_ADDR") &_
    "_From" & UCase(Request.ServerVariables("HTTP_ACCEPT_LANGUAG E")) &_
    "_Logon" & Now() &_
    "_Page" & request.servervariables("path_info") & "?" & request.querystring &_
    ":" & Now() & "|"
    Application.UnLock
    End If
    End Sub

    '============= Clean Up Active Users=======================================
    Sub ActiveUserCleanup
    Dim ix
    Dim intUsers
    Dim strActiveUserList
    Dim aActiveUsers
    If Application("ActiveUserListLog") = "" Then Exit Sub
    If DateDiff("n", Application("ActiveUsersLastCleanup"), Now()) > intActiveUserCleanupTime Then
    Application.Lock
    Application("ActiveUsersLastCleanup") = Now()
    Application.Unlock
    intUsers = 0
    strActiveUserList = Application("ActiveUserListLog")
    strActiveUserList = Left(strActiveUserList, Len(strActiveUserList) - 1)
    aActiveUsers = Split(strActiveUserList, "|")
    For ix = 0 To UBound(aActiveUsers)
    On error resume next
    If DateDiff("n", Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), ":") + 1, Len(aActiveUsers(ix))), Now()) > intActiveUserTimeout Then
    aActiveUsers(ix) = "XXXX"
    Else
    intUsers = intUsers + 1
    End If
    On error goto 0
    Next
    strActiveUserList = Join(aActiveUsers, "|") & "|"
    strActiveUserList = Replace(strActiveUserList, "XXXX|", "")
    Application.Lock
    Application("ActiveUserListLog") = strActiveUserList
    Application("ActiveUsersLog") = intUsers
    Application.UnLock
    End If
    End Sub

    '============= Display Who is Online List =====================================
    Sub ShowActiveUsersList ()
    Dim ix
    Dim intUsers
    Dim strActiveUserList
    Dim aActiveUsers
    Dim count, conn, rs, bgclr
    Dim sUserIP, sFrom, sPage, sUserID, sLastIn, sAtime, sLogon
    response.write "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0><tr><td>"
    response.write "<b style=""font-size:10px;font-family:verdana;color:#999999;"">http://" & request.servervariables("HTTP_HOST") & " - Who is Online Now (" & Now() & ")[/b]"
    response.write "</td></tr></table>"
    response.write "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 style=""border: 1px Solid #6699CC;""><tr><td>"
    response.write "<TABLE BORDER=0 CELLPADDING=2 CELLSPACING=2 style=""font-size=11px;font-family:tahoma;"" width=""100%"" BGCOLOR=WHITE>"
    Response.Write "<tr bgcolor=#dcdcdc>"
    Response.Write "<td align=center>ID</td>"
    Response.Write "<td align=center>IP address</td>"
    Response.Write "<td align=center>From</td>"
    Response.Write "<td align=center>Logon</td>"
    Response.Write "<td align=center>Last in</td>"
    Response.Write "<td align=center>Active time</td>"
    Response.Write "<td align=center>[b]Active page[b]</td>"
    Response.Write "</tr>"
    On error resume next
    count=0
    strActiveUserList = Application("ActiveUserListLog")
    strActiveUserList = Left(strActiveUserList, Len(strActiveUserList) - 1)
    aActiveUsers = Split(strActiveUserList, "|")
    For ix = 0 To UBound(aActiveUsers)
    sUserID = Mid(aActiveUsers(ix), 6, Instr(1, aActiveUsers(ix), "_IP")-6)
    sUserIP = Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), "_IP")+3, Instr(1, aActiveUsers(ix), "_From")-5-Instr(1, aActiveUsers(ix), "_IP")+2)
    sFrom = Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), "_From")+5, Instr(1, aActiveUsers(ix), "_Logon")-5-Instr(1, aActiveUsers(ix), "_From"))
    sLogon = Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), "_Logon")+6, Instr(1, aActiveUsers(ix), "_Page")-6-Instr(1, aActiveUsers(ix), "_Logon"))
    sPage = Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), "_Page")+6, Instr(1, aActiveUsers(ix), ":")-6-Instr(1, aActiveUsers(ix), "_Page"))
    sLastIn = FormatDateTime(Mid(aActiveUsers(ix), Instr(1, aActiveUsers(ix), ":") + 1, Len(aActiveUsers(ix))), vbLongTime)
    sAtime = DateDiff("n", sLogon, Now())
    sLogon = FormatDateTime(sLogon, vbLongTime)
    If count Mod 2 = 0 Then bgclr = "#F6F6F6" Else bgclr = "#EFEFEF" End if
    count=count+1
    Response.Write "<tr bgcolor=" & bgclr & ">"
    Response.Write "<td align=center>" & sUserID & "</td>"
    If Session("bLoginOK") Then
    Response.Write "<td align=center>"& sUserIP & "</td>"
    Else
    Response.Write "<td align=center>" & sNewUserIP(sUserIP) & "</td>"
    End if
    Response.Write "<td align=center>" & sFrom & "</td>"
    Response.Write "<td align=center>" & Replace(sLogon, ".", ":") & "</td>"
    Response.Write "<td align=center>" & Replace(sLastIn, ".", ":") & "</td>"
    Response.Write "<td align=center>" & sAtime & " Mins</td>"
    Response.Write "<td align=center>" & sPage & "</td>"
    Response.Write "</tr>"
    Next
    On error goto 0
    Response.Write "</table>"
    response.write "</td></tr></table>
    "
    If right(Request.serverVariables("SCRIPT_NAME"), len(Request.serverVariables("SCRIPT_NAME")) - instrrev(Request.serverVariables("SCRIPT_NAME"), "/")) <> "activeuserstest.asp" AND bShowPopUp Then
    response.write "<table width=""100%"" height=""100%"" border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=bottom>"
    response.write "<input type=""button"" onclick=""self.close()"" value=""Close Window"" style=""font-size:11px;"">
    "
    response.write "</td></tr></table>"
    End if
    End Sub '--- ShowActiveUsersList

    '============= Display Active Users Number ======================================
    Sub ShowActiveUsersNumber ()
    response.write "<table border=0 cellspacing=0 cellpadding=0 bgcolor=""#FFFFFF"" style=""font-size:11px;font-family:verdana;""><tr><td>"
    If bShowPopUp Then
    response.write "Users online: "
    Else
    response.write "Users online: "
    End if
    response.write "</td><td style='color:red;FONT-SIZE: 8pt; FONT-FAMILY: Tahoma, Arial, Helvetica;'>" & Application("ActiveUsersLog") & "</td></tr></table>"
    End Sub '--- ShowActiveUsersNumber
    %>


    Grazie a ncora

  2. #2
    Non so se ho capito bene, ma se intendi il link che c'è su "users online", basta che commenti la linea:
    codice:
    ============= Display Active Users Number ======================================
    Sub ShowActiveUsersNumber ()
    response.write "<table border=0 cellspacing=0 cellpadding=0 bgcolor=""#FFFFFF"" style=""font-size:11px;font-family:verdana;""><tr><td>"
    If bShowPopUp Then
    response.write " Users online: "   
    Else
    e che al suo posto tu scriva:
    Response.Write "utenti online: "
    in questo modo:
    codice:
    ============= Display Active Users Number ======================================
    Sub ShowActiveUsersNumber ()
    response.write "<table border=0 cellspacing=0 cellpadding=0 bgcolor=""#FFFFFF"" style=""font-size:11px;font-family:verdana;""><tr><td>"
    If bShowPopUp Then
    'response.write " Users online: "   
    Response.Write "utenti online: "
    Else

  3. #3

    informazione

    Ciao grazie per la risposta ho aggiunto l'apice, all'inizio della riga ma scompare anche la scritta user online ti allego l'immagine, vorrei che restasse la scritta, come posso fare?
    Grazie mille
    Immagini allegate Immagini allegate

  4. #4
    Devi aggiungere la riga:

    Response.Write "utenti online: "

    subito sotto la riga che hai commentato (quella cui hai messo l'apice)
    Te l'avevo scritta, bastava fare un copia e incolla

  5. #5

    Grazie

    Grazie mille ora Funziona
    Grazie ancora

  6. #6

  7. #7

    P.S

    senti ti disturbo ancora, ma vorrei cambiare colore della scritta come faccio?

  8. #8
    Basta modificare la riga:
    response.write utenti online: "
    con questa:
    codice:
    response.write "<font face=verdana size=1 color=#000080>utenti online: </font>"
    dove:
    face=verdana è il tipo di carattere
    size=1 è la dimensione del carattere
    color=#000080 è il colore del carattere che in questo caso è blu

    Ma questo non è asp, è html! VVoVe:

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 © 2026 vBulletin Solutions, Inc. All rights reserved.