Foros del Web » Programando para Internet » ASP Clásico »

MOD para un foro ASP, ayuda!!

Estas en el tema de MOD para un foro ASP, ayuda!! en el foro de ASP Clásico en Foros del Web. Hola! Tengo un foro en ASP ( www.rataforo.com.ar ) y necesito crearle un MOD que es bastante fácil para los que saben...pero no tanto para ...
  #1 (permalink)  
Antiguo 07/03/2004, 13:52
Avatar de polecat  
Fecha de Ingreso: diciembre-2003
Ubicación: Argentina
Mensajes: 391
Antigüedad: 20 años, 6 meses
Puntos: 0
MOD para un foro ASP, ayuda!!

Hola!
Tengo un foro en ASP (www.rataforo.com.ar) y necesito crearle un MOD que es bastante fácil para los que saben...pero no tanto para mi.
Si han visto el foro, lo que yo quiero hacer, es ponerle en la página principal, en la parte de estadísticas, que usuarios estan viendo el foro. Eso se puede ver haciendo click en Usuarios Activos, pero yo quiero que aparezcan los nicknames en la pagina central.
Busque en el archivo active_users_inc.asp haber si me podia guiar en algo, pero no entendi mucho....
Si alguien sabe como hacer, por favor que me ayude...en el siguiente post voy a poner una parte del active_users_inc.asp.
Recuerden que yo solo quiero que aparezca el nombre de usuario...nada más.

Desde ya muchisimas gracias!!
__________________
Juan Manuel
Diseño web/Gráfico & Ilustración
E-mail: [email protected] / Skype: jmbosi
Portfolio: www.facebook.com/hacelobiendesign
  #2 (permalink)  
Antiguo 07/03/2004, 13:53
Avatar de polecat  
Fecha de Ingreso: diciembre-2003
Ubicación: Argentina
Mensajes: 391
Antigüedad: 20 años, 6 meses
Puntos: 0

'Get the users IP address
strIPAddress = Request.ServerVariables("REMOTE_ADDR")


'Get if the user wants to be shown in the active users list
If Request.Cookies("Forum")("Hide") = "True" Then
blnHideActiveUser = 1
Else
blnHideActiveUser = 0
End If

'Calculate the active users ID number
lngActiveUsersID = lngLoggedInUserID


'Initialise the SQL variable with an SQL statement to get the active users details
If strDatabaseType = "SQLServer" Then
strSQL = "EXECUTE " & strDbProc & "ActiveUsersWhereIPis @strIPAddress = '" & strIPAddress & "'"
Else
strSQL = "SELECT " & strDbTable & "ActiveUser.* From " & strDbTable & "ActiveUser WHERE IP='" & strIPAddress & "';"
End If

'Query the database
rsCommon.Open strSQL, adoCon

'If there are no records for this user then add them to the datatbase
If rsCommon.EOF Then

'Get the uesrs web browser
'strBrowserUserType = BrowserType()

'Get the OS type
'strOS = OSType()

'If the user is not in the active users list then write them to it
'Initilse sql statement
If strDatabaseType = "SQLServer" Then
strSQL = "EXECUTE " & strDbProc & "AddNewActiveUser @strIPAddress = '" & strIPAddress & "', @lngActiveUsersID = '" & lngActiveUsersID & "', @strOS = '" & strOS & "', @strBrowserUserType = '" & strBrowserUserType & "', @blnHideActiveUser = '" & blnHideActiveUser & "'"
Else
strSQL = "INSERT INTO " & strDbTable & "ActiveUser (IP, Author_ID, OS, Browser, Hide) VALUES ('" & strIPAddress & "','" & lngActiveUsersID & "','" & strOS & "','" & strBrowserUserType & "','" & blnHideActiveUser & "');"
End If

'Write to database
adoCon.Execute(strSQL)

'Else if there's records returned then update them
Else
'The user is already in the db so just update the recordset
'Initilse sql statement
If strDatabaseType = "SQLServer" Then
strSQL = "EXECUTE " & strDbProc & "UpdateActiveUser @lngActiveUsersID = '" & lngActiveUsersID & "', @blnHideActiveUser = '" & blnHideActiveUser & "', @strIPAddress = '" & strIPAddress & "'"
Else
strSQL = "UPDATE " & strDbTable & "ActiveUser SET " & strDbTable & "ActiveUser.Author_ID=" & lngActiveUsersID & ", " & strDbTable & "ActiveUser.Active=Now(), " & strDbTable & "ActiveUser.Hide=" & blnHideActiveUser & " WHERE IP='" & strIPAddress & "';"
End If

'Write to database
adoCon.Execute(strSQL)


'Clean up old users
'Initilse sql statement
If strDatabaseType = "SQLServer" Then
strSQL = "EXECUTE " & strDbProc & "DeleteActiveUser"
Else
strSQL = "DELETE FROM " & strDbTable & "ActiveUser WHERE " & strDbTable & "ActiveUser.Active < Now() - 0.0070;"
End If

'Detlete from database
adoCon.Execute(strSQL)


'Delete older second entries if the user has returned in under 10 minutes with a new IP
If lngActiveUsersID <> 2 Then
If strDatabaseType = "SQLServer" Then
strSQL = "EXECUTE " & strDbProc & "DeleteActiveUserDoubleEntry @lngActiveUsersID = " & lngActiveUsersID & ", @strIPAddress = '" & strIPAddress & "'"
Else
strSQL = "DELETE FROM " & strDbTable & "ActiveUser WHERE " & strDbTable & "ActiveUser.Author_ID=" & lngActiveUsersID & " AND " & strDbTable & "ActiveUser.IP <> '" & strIPAddress & "';"
End If

'Detlete from database
adoCon.Execute(strSQL)
End If
__________________
Juan Manuel
Diseño web/Gráfico & Ilustración
E-mail: [email protected] / Skype: jmbosi
Portfolio: www.facebook.com/hacelobiendesign
  #3 (permalink)  
Antiguo 08/03/2004, 22:41
Avatar de polecat  
Fecha de Ingreso: diciembre-2003
Ubicación: Argentina
Mensajes: 391
Antigüedad: 20 años, 6 meses
Puntos: 0
Ya lo logré!!!
Gracias igual!
__________________
Juan Manuel
Diseño web/Gráfico & Ilustración
E-mail: [email protected] / Skype: jmbosi
Portfolio: www.facebook.com/hacelobiendesign
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:29.