% ' 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 & "