%@ LANGUAGE="VBSCRIPT"%> <% Response.Buffer = True %> <% Function TraeVar( Var, Update_Interval, Fun ) dim d, strLastUpdate strLastUpdate = Application( Var & "LU") if isnull(strLastUpdate) or (Update_Interval < DateDiff("s", strLastUpdate, Now)) then d = Fun Application.Lock Application( Var ) = d Application( Var & "LU" ) = cstr(Now) Application.Unlock ' response.write "Leyo" else d = Application( Var ) ' response.write "No Leyo" end if TraeVar = d end function Function HaceListaFotos() dim dbc, rs, sql, m Set dbc = Server.CreateObject("ADODB.Connection") dbc.Open "DSN=fotos" Set rs = Server.CreateObject ("adodb.Recordset") rs.Open "Select Foto,Votos,Votantes from Fotos where genero='" & genero & "'", dbc, 1, 1 if rs.recordcount > 0 then HaceListaFotos = rs.getrows() else redim m(0,0,0) HaceListaFotos = m end if rs.close Set rs = nothing Dbc.close Set Dbc = nothing end function dim imagen, votos, votantes, porcentage, genero, listafotos, cfotos, x imagen=request("imagen") genero = "F" if trim(imagen) = "" then r = "ListaFotos" & genero listafotos = TraeVar( r , 0, HaceListaFotos ) if not isnull(listafotos) and not isempty(listafotos) then cfotos = ubound(listafotos,2) if cfotos > 0 then Randomize() x = cint (cfotos * Rnd) imagen = lcase(listafotos(0,x)) votos = listafotos(1,x) votantes = listafotos(2,x) if votantes <> 0 then porcentage = votos / votantes else porcentage = 1 end if else imagen = "" votos = 0 votantes = 0 porcentage = 0 end if end if end if %>
|
||||||||||||||||||||||
| [an error occurred while processing this directive] | ||||||||||||||||||||||
|
Enviame
a un amigo como postal! - TOP
30 Presiona
AQUI para ver otra foto
|
||||||||||||||||||||||
|
||||||||||||||||||||||