<% '## Default.asp '## Open DataBase Connection '## (Change to include file soon!) set my_conn= Server.CreateObject("ADODB.Connection") my_Conn.Open ConnString '## Get Totals set rs1 = Server.CreateObject("ADODB.Recordset") strSQL = "Select * from Totals" rs1.open strSQL, my_conn Users = rs1("U_Count") Posts = rs1("P_Count") rs1.Close set rs1 = nothing '## Get all Forums From DB strSql = "SELECT * FROM Category" set rs = my_conn.Execute (StrSql) '## Do some Cookie bits to see when last here session("last_here_date") = Request.Cookies("date") Response.Cookies("Date") = now() Response.Cookies("Date").Expires = dateadd("d",365,now()) ' if never been here before, set last_here_date to -10 days if Session("last_here_date") = "" then Session("last_here_date") = dateadd("d",-10,now()) End if '## Function to display new icon Function isNew(dt) if datediff("s", session("last_here_date"), dt) > 1 then isNew = "Novo" Else isNew = " " End If End Function %> figueiraonline.com - Figueira da Foz - um concelho digital
A sua última visita - <%= session("last_here_date")%> Total de Respostas : <%= Posts %> , Total de Utilizadores : <%= Users %>   
<% If rs.Eof or rs.Bof then ' No categories found in DB Response.Write "" Else do until rs.eof '## Grab the Categories. '## Display Category Response.Write "" '## Build SQL to get forums via category strSql = "SELECT Forum.Forum_ID, Forum.F_Name, Forum.F_Description, Forum.F_Cat, Forum.F_Count, Forum.F_Last_Post, Forum.F_Moderator, Members.M_Name " strSql = strSql & "FROM Members INNER JOIN Forum ON Members.Member_id = Forum.F_Moderator " strSql = strSql & "where Forum.F_Cat = " & rs("cat_id") set rsForum = my_conn.Execute (StrSql) if rsForum.eof or rsForum.bof then Response.Write "" else do until rsForum.Eof '## Display Forum Response.Write "" & vbcrlf Response.Write ""& vbcrlf Response.Write "" & vbcrlf Response.Write "" & vbcrlf Response.Write "" & vbcrlf Response.Write "" Response.Write "" & vbcrlf rsForum.movenext loop End If rs.MoveNext loop End If %>
  Fórum Respostas Última resposta Moderador
Não foram encontrados resultados
"& rs("cat_name") & "
 
" & isNew(rsForum("F_Last_Post")) & "" Response.Write rsForum("F_name") & "
" & vbcrlf Response.Write "" & rsForum("F_Description") & "
" & rsForum("F_Count") & "" & rsForum("F_Last_Post") & "" & rsForum("M_Name") & "

Todos os Fóruns

<% my_conn.Close set my_conn = nothing set rs = nothing set rsForum = nothing %>