<%Response.Buffer=1%>
<!--#include file = "frame.asp" -->
<%
cat_id = guvenlik(REQUEST.QUERYSTRING("cat_id"))
IF Not IsNumeric(REQUEST.QUERYSTRING("cat_id")) THEN
response.write "L?fen Ge?rli bir ID numaras?girin."
response.end
END IF
page1 = Request.QueryString("pege1")
page2 = Request.QueryString("pege2")
order_by = Request.QueryString("order_by")
if order_by = "" then
order_by = "file_id desc"
end if
page = Request.QueryString("page")
if page<>"" then
page=page
else
page=1
end if
Set rrs = Server.CreateObject("ADODB.Recordset")
nere = "Select * From cats where cat_id = "&cat_id&""
rrs.Open nere, conn, 1, 1
set ii = conn.execute("Select count(*) as toplam From files where cat_id="&cat_id&" and durum= 1")
toplamprogram = ii("toplam")
ii.close
set ii = nothing
set ii = conn.execute("select * from files where durum= 1 order by hit desc")
set yn = conn.execute("Select * From files where durum = 1 order by file_id desc")
Set ed = Server.CreateObject("ADODB.Recordset")
nere = "Select * from files where cat_id = "&cat_id&" and durum = 1 and tavsiyeli = 1"
ed.Open nere, conn, 1, 1
set tum = Server.CreateObject("ADODB.Recordset")
tumu = "Select cat_name,cat_id From cats"
tum.open tumu,conn,1,1
if not ed.EOF then
edx = ed.Recordcount
Randomize
id = (Int(edx * rnd)+0)
ed.Move(id)
end if
Set rs = Server.CreateObject("ADODB.Recordset")
nere = "Select * From files where cat_id = "&cat_id&" and durum = 1 "&page1&" "&page2&" order by "&order_by&""
rs.Open nere, conn, 1,1
if page = "" then
intpage = 1
else
intpage = page
end if
rsx = rs.RecordCount
rs.PageSize = 10
rs.CacheSize = rs.PageSize
if not rs.EOF then
rs.AbsolutePage = intpage
end if
if yn.eof then
response.write ("wrong id"):
response.end
else
%>