Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Problemi con funzione (Online/offline) in un mio Mod

Autore Messaggio
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
20 ottobre 2004 alle 23:40:30 Profilo - acarInvia un messaggio privato Rispondi quotando
Modificato il 20 ottobre 2004 alle 23:45:42

Ciao ragazzi mi serve una mano per inserire il Pezzo di codice che segnala quando un utente è online o offline
questa è la sub di una pagina che deve creare una lista di utenti, questa pagina potete vederla ovviamente senza la funzione (Online/offline) sul mio sito
http://www.sebbeccamo.it/ListaUomini.asp
le parti in grassetto sono le parti chiave e la funzione (Online/offline) che ovviamente è errata!
Potete darmi una mano! a fine opera Pubblicherò il Mod...


Sub DisplayTopLastMembers(iTop)
Dim oCn, oRs, rSQL, iLine, iLoop, iNum, NumeroIscrittiTipo, rSQL2, oCn2, ors2
Dim bDisplayProfil, sMyLogin, sURL, sEmail


Set oCn = DBConnexion(DB_MAIN)
'rSQL = "SELECT uLogin, uEmail, uURL, uProfile FROM users WHERE uValid=1 ORDER BY uDate DESC"
rSQL = "SELECT users.uLogin, users.uEMail, users.uURL, users.uProfile, users.uGender, users.uValid FROM users WHERE ((users.uGender=1) and (users.uValid=True)) ORDER BY users.uLogin"

rSQL2 = "SELECT sID FROM sessions WHERE sLogin = '" & Server.URLEncode(sMyLogin) & "'"


Set oRs = DBRecordSet(oCn, rSQL)
Set oRs2 = DBRecordSet(oCn, rSQL2)


Response.Write NumeroIscrittiTipo & vbCRLF
iNum = 0

'Response.Write " & GetTranslation(""LANG_ACCOUNTS_TOTAL"") & " : " & iNum & " & vbCRLF



If Not oRs.EOF Then
CreateTopTable "TopMembers", "Lista Uomini Iscritti"

Response.Write GLOBAL_SITE_SUBTABLE & vbCRLF
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td width=""150"">" & GetTranslation("LANG_LOGIN") & "</td>" & vbCRLF
Response.Write " <td width=""80"">" & GetTranslation("LANG_PM") & "</td>" & vbCRLF
Response.Write " <td width=""50"">" & GetTranslation("LANG_PM") & "</td>" & vbCRLF
Response.Write " <td>" & GetTranslation("LANG_FOTO") & "</td>" & vbCRLF
'Response.Write " <td width=""200"">" & GetTranslation("LANG_EMAIL") & "</td>" & vbCRLF
'Response.Write " <td>" & GetTranslation("LANG_URL") & "</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF

iLine = 1
'iLoop = 0

While Not oRs.EOF
bDisplayProfil = oRs("uProfile").Value
sMyLogin = oRs("uLogin")
sURL = oRs("uURL")
sEmail = oRs("uEmail")

' Force view if admin
If IsAuthorizedBin(ROLE_ADMINISTRATOR) Then
bDisplayProfil = True
end if
Response.Write " <tr class=""tableline" & iLine & """>" & vbCRLF
Response.Write " <td><a href=""" & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.URLEncode(sMyLogin) & """>" & Server.HTMLEncode(sMyLogin) & "</a></td>" & vbCRLF

Response.Write " <td>" & vbCRLF
if Not oRs2.EOF then
Response.Write " <a href=""" & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.HTMLEncode(sMyLogin) & """><img src=""" & GLOBAL_SITE_IMAGES_PATH & "online.gif"" border=""0"" hspace=""2"" alt=""" & GetTranslation("LANG_PROFILE") & " - " & Server.HTMLEncode(sMyLogin) & """></a>"
else
Response.Write " <a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.HTMLEncode(sMyLogin) & """><img src=""" & GLOBAL_SITE_IMAGES_PATH & "offline.gif"" border=""0"" hspace=""2"" alt=""" & GetTranslation("LANG_PROFILE") & " - " & Server.HTMLEncode(sMyLogin) & """></a>"
End if

Response.Write "</td>" & vbCRLF


'Response.Write " <td>" & vbCRLF
Response.Write " <td><p align=""center""><a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_PRIVATE_MESSAGES_PAGE & "?do=new&to=" & Server.HTMLEncode(sMYLogin) & """ title=""Scrivi messaggio privato"">" & GetTranslation("LANG_SEND_PRIVATE_MESSAGE_BOX") & "</a></p></td>" & vbCRLF
'Response.Write "</td>" & vbCRLF

Response.Write " <td><p align=""right"">"
DisplayAvatar(sMyLogin)
Response.Write "</p></td>" & vbCRLF

Response.Write " </tr>" & vbCRLF

iLine = ((iLine-1) XOr 1) + 1


oRs.MoveNext

iNum = iNum + 1
WEnd

'Response.Write "</table>" & vbCRLF
Response.Write " <tr class=""tablelinemain"">" & vbCRLF
Response.Write " <td colspan=""3"">" & GetTranslation("LANG_ACCOUNTS_TOTAL_UOMINI") & " : " & iNum & "</td>" & vbCRLF
Response.Write " </tr>" & vbCRLF
Response.Write "</table>" & vbCRLF
CreateBottomTable ""

NumeroIscrittiTipo = iNum

End If

oRs2.Close
Set oRs2 = Nothing


oRs.Close
Set oRs = Nothing

oCn.Close
Set oCn = Nothing
End Sub

---------------
http://www.pc-sapiens.net
acar

Esperto
Esperto
267 Discussioni



Profilo - acar
21 ottobre 2004 alle 09:49:04 Profilo - acarInvia un messaggio privato Rispondi quotando
Modificato il 21 ottobre 2004 alle 09:58:01

Ho risolto facendo una sola Query e cambiando If del (Online/Offline)

SELECT users.uLogin, users.uEMail, users.uURL, users.uProfile, users.uGender, users.uValid, sessions.sLogin FROM sessions RIGHT JOIN users ON sessions.sLogin = users.uLogin WHERE (((users.uGender)=1) AND ((users.uValid)=True)) ORDER BY users.uLogin


if oRs("uLogin") = oRs("sLogin") then
Response.Write " <a href=""" & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.HTMLEncode(sMyLogin) & """><img src=""" & GLOBAL_SITE_IMAGES_PATH & "online.gif"" border=""0"" hspace=""2"" alt=""" & GetTranslation("LANG_PROFILE") & " - " & Server.HTMLEncode(sMyLogin) & """></a>"
else
Response.Write " <a href=""" & GLOBAL_SITE_PATH & GLOBAL_SITE_PROFILE_PAGE & "?id=" & Server.HTMLEncode(sMyLogin) & """><img src=""" & GLOBAL_SITE_IMAGES_PATH & "offline.gif"" border=""0"" hspace=""2"" alt=""" & GetTranslation("LANG_PROFILE") & " - " & Server.HTMLEncode(sMyLogin) & """></a>"
End if

Grazie lo stesso
---------------
http://www.pc-sapiens.net

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 : 98
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: 558 Notizie: 180 Sondaggi: 11 Preferiti: 5685294 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi