<% ' Fruibile - L'elemento CMS Open Source che mancava ' Copyright (C) 2002-2006 Roberto Scano ' ' Licensed under the terms of the GNU Lesser General Public License: ' http://www.opensource.org/licenses/lgpl-license.php ' ' For further information visit: ' http://www.fruibile.it/ ' ' File Author: ' Roberto Scano (mail@robertoscano.info) %> <% 'controllo sicurezza -------------- if Session("WEBGODLogin") <> "W3C_VALIDATOR" then If session("contenuti")<> 1 Then response.Redirect "/backoffice/noentry.asp" end if end if '---------------------------------- 'Prevent your website from cross website attacks --------- refererUrl = Cstr(Request.ServerVariables("HTTP_REFERER")) serverName = Cstr(Request.ServerVariables("SERVER_NAME")) refererName = mid(refererUrl,8,len(serverName)) if refererName <> serverName then response.Redirect "/backoffice/noentry.asp" response.end end if '--------------------------------------------------------- %> <% percorso = " " & DICLanguage(79) & "" percorso = percorso & " / " & DICLanguage(130) lastpage = Request.ServerVariables("HTTP_REFERER") %> <% if intCatID = "" then if Session("supervisor") = true then intCatID = 0 else intCatID = Session("ArgoID") end if end if if Session("supervisor") = true then aggiunta_sql = "" aggiunta_where_sql = "" else aggiunta_sql = " and office_id=" & Session("Office_ID") aggiunta_where_sql = " where office_id=" & Session("Office_ID") end if if request("fld") <> "visible_" & Session("Language") and Request("kwd") = "" then response.redirect "contenuti.asp?cat=" & strCat & "&mnu=" & request("mnu") & "&submnu=" & request("submnu") else 'Paginazione ----------------------------------------------- currentPage = trim(Request.QueryString("sp")) fieldName = trim(Request.QueryString("fn")) sortType = trim(Request.QueryString("st")) if currentPage = "" then currentPage = 1 end if if fieldName = "" then fieldName = "id" end if if sortType = "" then sortType = "DESC" end if 'NUMERO MASSIMO DI RECORD PER PAGINA maxitems = cint(Application("maxitems")) 'RECUPERA NUMERO PAGINA ATTUALE If Not IsEmpty(Request("sp")) then currentPage = Request("sp") End If 'IN CASO DI PROBLEMI ASSEGNA LA PAGINA 1 if currentPage = "" OR not isNumeric(currentPage) then currentPage = int(1) else currentPage = int(currentPage) end if if request("st") <> "" and request("fn") <> "" then ordinamento = request("fn") & " " & request("st") else ordinamento = "posizione" end if Set objRS2 = Server.CreateObject("ADODB.Recordset") 'Paginazione ----------------------------------------------- if request("fld") = "modificato" then strkwdtmp = split(request("kwd"), "/") If CMS_DB = "SQL" or CMS_DB = "MYSQL" then strkwd = "'" & strkwdtmp(2) & "/" & strkwdtmp(1) & "/" & strkwdtmp(0) & "'" Else strkwd = "#" & strkwdtmp(2) & "/" & strkwdtmp(1) & "/" & strkwdtmp(0) & "#" End If if CMS_DB = "MYSQL" Then strSQL = "SELECT Count(*) AS records FROM " & application("prefix") & "documenti WHERE argomento=0 and year(" & Request("fld") & ") = year(" & strkwd & ") and month(" & Request("fld") & ") = month(" & strkwd & ") and dayofmonth(" & Request("fld") & ") = dayofmonth(" & strkwd & ")" & aggiunta_sql & " order by " & ordinamento Set objRS3 = Conn.execute(strSQL) intrecords = cint(objRS3("records")) objRS3.close set objrs3 = nothing intPageSize = int(maxitems) intStart = currentPage*intPageSize intStart = intStart-intPageSize intPages = int(intRecords/intPageSize) +1 SQL = "SELECT * FROM " & application("prefix") & "documenti WHERE argomento=0 and year(" & Request("fld") & ") = year(" & strkwd & ") and month(" & Request("fld") & ") = month(" & strkwd & ") and dayofmonth(" & Request("fld") & ") = dayofmonth(" & strkwd & ")" & aggiunta_sql & " order by " & ordinamento & " LIMIT " & intStart & ", " & intPageSize else SQL = "SELECT * FROM " & application("prefix") & "documenti WHERE argomento=0 and date(" & Request("fld") & ") = " & strkwd & aggiunta_sql & " order by " & ordinamento end if elseif request("fld") = "visible_" & Session("Language") then if CMS_DB = "MYSQL" Then strSQL = "SELECT Count(*) AS records FROM " & application("prefix") & "documenti WHERE argomento=0 and visibile_" & Session("Language") & "=0 " & aggiunta_sql & " order by " & ordinamento Set objRS3 = Conn.execute(strSQL) intrecords = cint(objRS3("records")) objRS3.close set objrs3 = nothing intPageSize = int(maxitems) intStart = currentPage*intPageSize intStart = intStart-intPageSize intPages = int(intRecords/intPageSize) +1 SQL = "SELECT * FROM " & application("prefix") & "documenti WHERE argomento=0 and visibile_" & Session("Language") & "=0 " & aggiunta_sql & " order by " & ordinamento & " LIMIT " & intStart & ", " & intPageSize else SQL = "SELECT * FROM " & application("prefix") & "documenti WHERE argomento=0 and visibile_" & Session("Language") & "=0 " & aggiunta_sql & " order by " & ordinamento end if else strkwd = replace(Request("kwd"),"'","''") if CMS_DB = "MYSQL" Then strSQL = "SELECT Count(*) AS records FROM " & application("prefix") & "documenti WHERE argomento=0 and " & Request("fld") & " like '%" & strkwd & "%'" & aggiunta_sql & " order by " & ordinamento Set objRS3 = Conn.execute(strSQL) intrecords = cint(objRS3("records")) objRS3.close set objrs3 = nothing intPageSize = int(maxitems) intStart = currentPage*intPageSize intStart = intStart-intPageSize intPages = int(intRecords/intPageSize) +1 SQL = "SELECT * FROM " & application("prefix") & "documenti WHERE argomento=0 and " & Request("fld") & " LIKE '%" & strkwd & "%'" & aggiunta_sql & " order by " & ordinamento & " LIMIT " & intStart & ", " & intPageSize else SQL = "SELECT * FROM " & application("prefix") & "documenti WHERE argomento=0 and " & Request("fld") & " LIKE '%" & strkwd & "%'" & aggiunta_sql & " order by " & ordinamento end if end if If CMS_DB = "SQL" or CMS_DB = "MYSQL" Then objrs2.CursorLocation = adUseClient End If 'response.write SQL objRS2.open sql, conn, adOpenStatic, adLockOptimistic if intpages = 0 then intpages = 1 'Nessun documento trovato If objRS2.EOF AND objRS2.BOF then strHTML = strHTML & "

" & DICLanguage(106) & DICLanguage(0) & "

" strHTML = strHTML & "

" & DICLanguage(2) & "" & DICLanguage(0) & "

" & vbcrlf & "
" objRS2.Close set objRS2 = nothing else if CMS_DB = "ACCESS" or CMS_DB = "SQL" then objrs2.Pagesize= MaxItems objrs2.AbsolutePage = CurrentPage intPages = objRS2.PageCount end if strHTML = strHTML & "
" & vbcrlf strHTML = strHTML & "

" & IIf(intrecords > 1, replace(replace(DICLanguage(112),"[N]", intrecords),"[RICERCA]", "" & Request("kwd") & "") , replace(replace(DICLanguage(111),"[N]", intrecords),"[RICERCA]", "" & Request("kwd") & "")) & DICLanguage(0) & "

" & vbcrlf 'strHTML = strHTML & "

Trovat" & IIf(intrecords > 1, "i ", "o ") & intrecords & " document" & IIf(intrecords > 1, "i", "o") & " contenent" & IIf(intrecords > 1, "i", "e") & " " & Request("kwd") & ".

" & vbcrlf if Session("translator") = true then else strHTML = strHTML & "

" & DICLanguage(97) & " 

" & vbcrlf end if if intrecords > maxitems then strHTML = strHTML & "
" & vbcrlf for ia=1 to intPages if cint(ia)=cint(currentPage) then strHTML = strHTML & "" & ia & "" & " | " else strHTML = strHTML & "" else strHTML = strHTML & replace(replace(DICLanguage(115),"[N]", ia),"[TOT]",intpages) & """>" end if strHTML = strHTML & ia strHTML = strHTML & "" strHTML = strHTML & " | " end if next strHTML = strHTML & "
" & vbcrlf end if 'TABELLA CONTENENTE I DOCUMENTI --------------------- strHTML = strHTML & "" & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf rowCount = 0 strHTML = strHTML & " " & vbcrlf Do until objRs2.EOF strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf if request("fld") = "title_" & Session("Language") then strTitle = Replace(fixstring(objRS2("title_" & Session("Language")),"d"), strkwd, "" & strkwd & "") strHTML = strHTML & " " & vbcrlf else strHTML = strHTML & " " & vbcrlf end if strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf strHTML = strHTML & " " & vbcrlf rowCount = rowCount + 1 objRS2.movenext Loop strHTML = strHTML & " " & vbcrlf strHTML = strHTML & "
" & DICLanguage(120) & "" & DICLanguage(32) & "" & DICLanguage(34) & "" & DICLanguage(124) & "
" if objRS2("visibile_" & Session("language")) = 1 then strHTML = strHTML & "V " else strHTML = strHTML & "X " end if 'strHTML = strHTML & " strHTML = strHTML & "[" & objRS2("posizione") & "] " & strTitle & "[" & objRS2("posizione") & "] " & fixstring(objRS2("title_" & Session("Language")),"d") & ""& getCategoryName(objRS2("catid")) & "" if objrs2("modificato") <> 0 then strHTML = strHTML & "" & day(objRS2("Modificato")) & "/" & month(objRS2("Modificato")) & "/" & year(objRS2("Modificato")) & " - " & formatdatetime(objRS2("Modificato"),3) end if strHTML = strHTML & "
" & vbcrlf if intrecords > maxitems then strHTML = strHTML & "
" & vbcrlf for i=1 to intPages if cint(i)=cint(currentPage) then strHTML = strHTML & "" & i & "" & " | " else strHTML = strHTML & "" else strHTML = strHTML & replace(replace(DICLanguage(115),"[N]", i),"[TOT]",intpages) & """>" end if strHTML = strHTML & i strHTML = strHTML & "" strHTML = strHTML & " | " end if next strHTML = strHTML & "
" & vbcrlf end if strHTML = strHTML & "

" & DICLanguage(128) & " 

" & vbcrlf strHTML = strHTML & "

" strHTML = strHTML & "" strHTML = strHTML & "" strHTML = strHTML & "

" & vbcrlf strHTML = strHTML & "
" & vbcrlf objrs2.close set objRS2 = nothing End If end if %>

<%=DICLanguage(130)%>

&submnu=<%=request("submnu")%>" method="post" id="form1">
<%=DICLanguage(80)%>:

" />

<%=strHTML%>