<%@LANGUAGE="VBSCRIPT"%> <% Dim iMonth, iYear Dim giorno, archivio, mese iMonth=Request ("month") iYear=Request ("year") if iMonth = "" then iMonth = Month(Now) sMonth=NameFromMonth(iMonth) if iYear = "" then iYear = Year(Now) giorno=request.querystring("giorno") archivio=request.querystring("archivio") mese=Right(CStr(100+iMonth), 2) Dim rsblog Dim rscommenti Dim vpage Dim page Dim Block Dim Blocks Dim RecordsInPage Dim intstart Dim i Dim totale Dim maxpages Dim PagStart Dim PagStop Dim RemainingRecords Dim NumberLastRecords Dim SQLCount Dim rsCount Dim msg page = Request("page") RecordsInPage = Request("RecordsInPage") Block = Request("Block") if Block="" then Block=1 if RecordsInPage="" then RecordsInPage=intRecordsPerPage if page="" then page=1 if giorno <> "" then SQLCount = "SELECT COUNT(*) as totale FROM blog WHERE giorno = '" & giorno & "' AND mese = '" & mese & "' AND anno = '" & iYear & "'" elseif archivio<>"OK" then SQLCount = "SELECT COUNT(*) as totale FROM blog WHERE mese = '" & mese & "' AND anno = '" & iYear & "'" else SQLCount = "SELECT COUNT(*) as totale FROM blog" end if set rsCount = adoCon.Execute(SQLCount) totale = rsCount("totale") rsCount.Close set rsCount=Nothing %> <% = Ublogname %>
<% = strLangSelectArchivesBlog %>     <%If giorno <> "" Then response.write giorno & " " & Ucase(sMonth) & " " & iYear elseif archivio<>"OK" then response.write Ucase(sMonth) & " " & iYear else response.write strLangSelectArchivesBlogFull end if %>  
 
 
<% intStart = CInt((page-1) * intRecordsPerPage) ' verifico se la scelta è relativa ad un giorno specifico ' nel caso di giorno<>"" visualizzo tutti i blog relativi al giorno specificato if giorno <> "" then strSQL = "SELECT blog.* FROM blog WHERE giorno = '" & giorno & "' AND mese = '" & mese & "' AND anno = '" & iYear & "' ORDER BY blog_id DESC" strSQL = strSQL & " LIMIT " & intStart & ", " & RecordsInPage msg = "



" & strLangErrorMessageNoBlog1 &"" msg = msg & "

" & strLangNavRedirectErrorNoBlog & "
" ' verifico se è stato scelto di visualizzare l'archivio completo ed in caso contrario, archivio <>OK, visualizzo i blog relativi al mese richiamato dal calendario elseif archivio<>"OK" then strSQL = "SELECT blog.* FROM blog WHERE mese = '" & mese & "' AND anno = '" & iYear & "' ORDER BY blog_id DESC" strSQL = strSQL & " LIMIT " & intStart & ", " & RecordsInPage msg = "



" & strLangErrorMessageNoBlog2 &"" msg = msg & "

" & strLangNavRedirectErrorNoBlog & "
" else ' visualizzo tutto l'archivio blog strSQL = "SELECT blog.* FROM blog ORDER BY blog_id DESC" strSQL = strSQL & " LIMIT " & intStart & ", " & RecordsInPage msg = "



" & strLangErrorMessageNoBlog3 &"" end if set rsblog = adoCon.Execute(strSQL) Set rscommenti = Server.CreateObject("ADODB.Recordset") If rsblog.EOF AND rsblog.BOF Then Response.Write msg Response.End Else For i=1 to RecordsInPage if Not rsblog.EOF then strSQL = "SELECT Count(commenti.blog_id) AS numerocommenti " strSQL = strSQL & "FROM commenti " strSQL = strSQL & "WHERE commenti.blog_id = " & CLng(rsblog("blog_id")) & ";" rscommenti.Open strSQL, adoCon %>
<% = UCase(rsblog("blog_titolo")) %>  <% = strLangGlobBy %> <%If rsblog("blog_email") <> "" Then Response.Write("" & rsblog("blog_autore") & "") Else Response.Write(rsblog("blog_autore")) %> <% = rsblog("data")%> <% = strLangGlobAt %> <% = FormatDateTime(rsblog("ora"),vbShortTime) %>
<% strText = rsblog("blog_testo") Response.write anteprima(strText, 40) %>
<% If CBool(rsblog("commenti")) = True Then %> &month=<% = iMonth %>&year=<% = iYear %>&giorno=<% = giorno %>&archivio=<% = archivio %>"><% = strLangFormSubmitComment %> <% If NOT rscommenti.EOF Then Response.Write " [ " & strLangGlobNumberOfComment & " " & rscommenti("numerocommenti") & " ]" Else Response.Write " [ " & strLangGlobNumberOfComment & " 0 ]" End If End If %>   &month=<% = iMonth %>&year=<% = iYear %>&giorno=<% = giorno %>&archivio=<% = archivio %>"><% = strLangGlobReadAll %>


<% rscommenti.Close else exit for end if rsblog.movenext Next RecordsInPage=intRecordsPerPage %>

<% Response.Write "
" maxpages = int(totale / RecordsInPage) if (totale mod RecordsInPage) <> 0 then maxpages = maxpages + 1 end if Blocks=0 Blocks = int(maxpages / PagesPerBlock) if (maxpages mod PagesPerBlock) <> 0 then Blocks = Blocks + 1 end if Response.Write "" & strLangGlobPage & " " & page & " " & strLangGlobOf & " " & maxpages & "" PagStop=Block*PagesPerBlock PagStart=(PagStop-PagesPerBlock)+1 i=0 if maxpages>1 then For vpage=PagStart to PagStop i=i+1 if Block=1 then i=0 if i=1 and Block>1 then Response.Write "" & _ "  " end if RemainingRecords = totale-(vpage*intRecordsPerPage) if RemainingRecords > 0 then Response.Write "" & vpage & " " else NumberLastRecords = intRecordsPerPage+RemainingRecords Response.Write "" & vpage & " " exit for end if if vpage=PagStop AND Blocks>1 and int(Block-1)" & _ "  " exit for end if Next end if end if Response.Write "
" %>

<% rsblog.Close Set rsblog = Nothing Set rscommenti = Nothing Set strCon = Nothing Set adoCon = Nothing %>