%@LANGUAGE="VBSCRIPT" CODEPAGE="28592"%>
<% if not isnumeric(session("jezyk")) then
'response.write "Błąd! Nie wybrany jezyk."
'response.end
end if
sub frazy()
ile_fraz = session("ile_fraz")
for i=1 to ile_fraz
frazy_id(i) = session("frazyid"&i)
objf.open "SELECT dbo.t_katalogi_frazy.id_frazy, dbo.t_katalogi_frazy.id_serwisu, dbo.t_katalogi_frazy.fraza, dbo.t_katalogi_serwisy.nazwa AS nazwa_serwisu, dbo.t_katalogi_dodane.id_katalogu, dbo.t_katalogi_dodane.kiedy, dbo.t_katalogi_dodane.kto FROM dbo.t_katalogi_frazy INNER JOIN dbo.t_katalogi_serwisy ON dbo.t_katalogi_frazy.id_serwisu = dbo.t_katalogi_serwisy.id_serwisu LEFT OUTER JOIN dbo.t_katalogi_dodane ON dbo.t_katalogi_frazy.id_frazy = dbo.t_katalogi_dodane.id_frazy WHERE ((dbo.t_katalogi_frazy.usuniete = 0) OR (dbo.t_katalogi_frazy.usuniete IS NULL)) and t_katalogi_frazy.id_frazy IN ("&frazy_id(i)&")",conn,1,3
if objf.eof then
response.write "
Błąd!
"&objf.Source&"
ile fraz:"&ile_fraz
for j=1 to ubound(frazy_id)
Response.Write("
"&j&": "&frazy_id(j))
next
response.end
else
frazy_sid(i) = objf("id_serwisu")
frazy_snazwa(i) = objf("nazwa_serwisu")
frazy_nazwa(i) = objf("fraza")
objdd.open "select * from t_katalogi_dodane where id_katalogu="&id_katalogu&" and id_frazy IN ("&frazy_id(i)&") and podkategoria is null and kiedy>'2005-11-01'",conn,1,3
if objdd.eof then
frazy_dodane(i)=null
else
frazy_dodane(i)=objdd("kiedy")
end if
objdd.close
end if
objf.close
next
end sub
kjezyk = session("jezyk")
'if(kjezyk = "1") then kjezyk = "1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27" end if
'if(kjezyk = "5") then kjezyk = "5,28,29,30,31,32,33,34,35,36,37,38,39,40" end if
if(kjezyk = "6") then kjezyk = "6,41,42,43,44,45,46" end if
if(kjezyk = "47") then kjezyk = "47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62" end if
%>
<% session("powrotkat") = "katalogiadd.asp?"&request.ServerVariables("QUERY_STRING") %>
<%
if request.Cookies("kataloginiedodane")="1" then
niedodane = 1
else
niedodane = 0
end if
if request.Cookies("filtrowanie")="1" then
filtrowanie = 1
else
filtrowanie = 0
end if
if request.Cookies("szablon")="1" then
szablon = 1
elseif request.Cookies("szablon")="2" then
szablon = 2
end if
if request.Cookies("precle")="1" then
precle = 1
end if
if request.Cookies("all_platne")="1" then
all_platne = 1
end if
if request.Cookies("all_bezplatne")="1" then
all_bezplatne = 1
end if
if request.Cookies("losowo")="1" then
losowo = 1
else
losowo = 0
end if
if all_platne=1 then
kjezyk = "7,75"
end if
if all_bezplatne=1 then
kjezyk = "1,5,65,67,64,68,74,76"
end if
%>
<%
rok = Year(NOW)
miesiac = Month(NOW)
dzien = Day(NOW)
set licz2 = server.CreateObject("ADODB.Recordset")
licz2.open "SELECT count(id) as ile FROM t_katalogi_dodane WHERE id_frazy IN ("&session("frazyid1")&")", conn, 1, 3
set licz = server.CreateObject("ADODB.Recordset")
licz.open "SELECT count(id) as ile FROM t_katalogi_dodane WHERE id_frazy IN ("&session("frazyid1")&") and kto="&crmhnd_id_handlowca&" and DATEDIFF(d, GETDATE(), kiedy)=0", conn, 1, 3
response.write ("Dodanych na tym linku: "&licz2("ile")&", z tego w ostatniej dobie "&licz("ile")&"
")
licz2.close
if crmhnd_id_handlowca=148 then
limit = 240
elseif crmhnd_id_handlowca=166 then
limit = 80
else
limit = 9999
end if
if int(limit)<=int(licz("ile")) then
response.write ("Twoj limit dzienny tego linku zostal dodany. Przejdz do dodawania kolejnej frazy.")
response.end
end if
if request.QueryString("idk")<>"" and request.QueryString("idf")<>"" then
conn.execute("insert into t_katalogi_dodane(id_katalogu, id_frazy, kiedy,kto) values ("&request.QueryString("idk")&","&request.QueryString("idf")&", getdate(),"&crmhnd_id_handlowca&" )")
response.Redirect("katalogiadd.asp?s="&request.QueryString("s"))
end if
if request.QueryString("u")<>"" then
conn.execute "delete from t_katalogi where id_linku="&request.QueryString("u")
response.Redirect("katalogi.asp")
end if
if request.QueryString("all")="1" then
op_wszystkie = true
else
op_wszystkie = false
end if
sprawdzone = false
if request.form.count > 0 then
nazwa = request.Form("nazwa")
kategoria = request.Form("kategoria")
opis = request.Form("opis")
pr = request.Form("pr")
fraza = request.Form("fraza")
jezyk = request.form("jezyk")
if jezyk<>"" then
session("defjezyk") = jezyk
response.write "sess:"&session("defjezyk")
end if
sprawdzone = true
if request.Form("sprawdzone")="0" then
nazwa_test = nazwa
if left(nazwa_test,7) = "http://" then
nazwa_test = right(nazwa_test,len(nazwa_test)-7)
end if
if left(nazwa_test,4) = "www." then
nazwa_test = right(nazwa_test,len(nazwa_test)-4)
end if
check_simi = 0
if conn.execute("select count(*) from t_katalogi where replace(replace(link, 'http://', ''), 'www.', '') = '"&nazwa_test&"'")(0) > 0 then
check_simi = 3
end if
if check_simi =0 then
if Instr(nazwa_test, "?") > 0 then
nazwa_test = left(nazwa_test, Instr(nazwa_test, "?")-1)
end if
if conn.execute("select count(*) from t_katalogi where link like '%"&nazwa_test&"%'")(0) > 0 then
check_simi = 2
end if
if check_simi =0 then
if Instr(nazwa_test, "/") > 0 then
nazwa_test = left(nazwa_test, Instr(nazwa_test, "/")-1)
end if
if conn.execute("select count(*) from t_katalogi where link like '%"&nazwa_test&"%'")(0) > 0 then
check_simi = 1
end if
end if
end if
end if
end if
%>
<%
set objk = server.CreateObject("adodb.recordset")
%>
<% if not sprawdzone and not op_wszystkie then %>
<%
dim frazy_id(6), frazy_sid(6), frazy_snazwa(6), frazy_nazwa(6),frazy_dodane(6),ile_fraz
if isnumeric(request.QueryString("s")) then
strona=request.QueryString("s")
else
strona=0
end if
set objf = server.CreateObject("adodb.recordset")
set objdd = server.CreateObject("adodb.recordset")
set objehh = server.CreateObject("ADODB.Recordset")
objehh.open "SELECT id_frazy FROM t_katalogi_dodane WHERE id_frazy IN ("&session("frazyid1")&") and id_katalogu=12056", conn, 1, 3
if objehh.eof then
desc = "desc"
else
desc = ""
end if
if niedodane=1 then
wyklucz_dodalem = " id_linku not in (select id_katalogu from t_katalogi_dodane where id_frazy IN ("&session("frazyid1")&") and kiedy>'2005-11-01') and"
'wyklucz_dodalem = " id_linku not in (select id_katalogu from t_katalogi_dodane where id_frazy="&session("frazyid1")&" and kiedy>'2005-11-01' and (status is null or status=1)) and"
else
wyklucz_dodalem = ""
end if
if filtrowanie=1 then
wyklucz_dodalem = wyklucz_dodalem&" id_linku not in (select id_katalogu from t_katalogi_checker_found WHERE id_serwisu="&request.Cookies("fserwis")&") and id_linku not in (select id_katalogu from t_katalogi_dodane where id_frazy IN ("&session("frazyid1")&") and kiedy>'2011-02-01') and "
end if
if szablon=1 then
wyklucz_dodalem = wyklucz_dodalem&" a.id_szablonu is not null and a.id_szablonu not in (25, 23) and"
elseif szablon=2 then
wyklucz_dodalem = wyklucz_dodalem&" a.id_szablonu is null and"
end if
if precle=1 then
wyklucz_dodalem = wyklucz_dodalem&" a.id_szablonu_precle is not null"
end if
if losowo=0 then
sql = "select top "&strona+1&" a.*, b.nazwa as nazwa_okresu from t_katalogi a LEFT OUTER JOIN t_katalogi_okresy b ON (a.id_okresu=b.id_okresu) where id_jezyka IN("&kjezyk&") and "&wyklucz_dodalem&" kategoria between 1 and 2 and (data_usuniecia is null) order by pr desc, id_linku desc"
else
sql = "select top "&strona+1&" a.*, b.nazwa as nazwa_okresu from t_katalogi a LEFT OUTER JOIN t_katalogi_okresy b ON (a.id_okresu=b.id_okresu) where id_jezyka IN("&kjezyk&") and "&wyklucz_dodalem&" kategoria between 1 and 2 and (data_usuniecia is null) order by NEWID()"
end if
sql2 = "select count(a.id_linku) as ile from t_katalogi a LEFT OUTER JOIN t_katalogi_okresy b ON (a.id_okresu=b.id_okresu) where id_jezyka IN("&kjezyk&") and "&wyklucz_dodalem&" kategoria between 1 and 2 and (data_usuniecia is null)"
'wersja dla magdy paly
if(session("id_handlowca") = 91) then
sql = "select top "&strona+1&" a.*, b.nazwa as nazwa_okresu from t_katalogi a LEFT OUTER JOIN t_katalogi_okresy b ON (a.id_okresu=b.id_okresu) where id_jezyka IN("&kjezyk&") and "&wyklucz_dodalem&" kategoria between 1 and 2 and (data_usuniecia is null) order by pr desc, id_linku desc"
sql = "select count(a.id_linku) as ile from t_katalogi a LEFT OUTER JOIN t_katalogi_okresy b ON (a.id_okresu=b.id_okresu) where id_jezyka IN("&kjezyk&") and "&wyklucz_dodalem&" kategoria between 1 and 2 and (data_usuniecia is null)"
end if
'Response.Write(sql)
objk.open sql,conn,1,3
set objlicz = Server.CreateObject("ADODB.Recordset")
objlicz.open sql2, conn, 1, 3
response.write("Ilosc linków:"& objlicz("ile"))
if isnull(strona) then
Page = 0
Else
Page = cint(strona)
End If
objk.PageSize=1
AllPages = objk.PageCount
If AllPages=0 Then
AllPages = 1
end if
if Not objk.EOF AND Not objk.BOF Then
objk.AbsolutePage=strona+1
end if
'Response.Write(objk.Source)
if(objk.EOF) then
Response.Write("
Koniec listy.") : Response.End()
end if
id_katalogu = objk("id_linku")
'Response.Write id_katalogu
'call frazy()
id_katalogu = objk("id_linku")
'Response.Write id_katalogu
'for i = 1 to ile_fraz
'set rs = Server.CreateObject("ADODB.RecordSet")
'Response.Write("select * from t_katalogi_dodane where id_katalogu="&id_katalogu&" and id_frazy in (select id_frazy from t_katalogi_frazy where id_serwisu in (select id_serwisu from t_katalogi_frazy where id_frazy = "&frazy_id(i)&")) and podkategoria is not null order by kiedy")
'rs.open "select * from t_katalogi_dodane where id_katalogu="&id_katalogu&" and id_frazy in (select id_frazy from t_katalogi_frazy where id_serwisu in (select id_serwisu from t_katalogi_frazy where id_frazy = "&frazy_id(i)&")) and podkategoria is not null order by kiedy",conn,1,3
'if(rs.RecordCount > 0) then
'rs.Close() : set rs = nothing
'Response.Write("aaaa"&i&"
")
'Response.Redirect(Request.ServerVariables("SCRIPT_NAME")&"?s="&(strona+1))
'else
'Response.Write(i&"
")
'rs.Close() : set rs = nothing
'end if
' rs.Close() : set rs = nothing
'next
call frazy()
%>
<% end if %>
| " target="_blank"><%=nazwa%> | <% end if %> <% if not sprawdzone then %>||||||||||
| link | PR | kategoria | uwagi | ile podk. | fraza | login | hasło | <% if kjezyk="7" or kjezyk="75" or kjezyk="7,75" then %>cena | okres | <% end if %>|
| <% select case check_simi %> <% case 0 %> 0: Link nie istnieje w bazie <% case 1 %> 1: Uwaga: Są podobne linki w bazie. <% case 2 %> 2: Ostrzeżenie: Bardzo podobny link istnieje w bazie. <% case 3 %> 3: Ostrzeżenie: Identyczny link już istnieje w bazie! <% end select %> | ||||||||||
| " target="_blank"> <% if len(objk("link"))>50 then response.write left(objk("link"),50)&"..." else response.write objk("link") end if %> | <%=objk("pr")%> | <% select case objk("kategoria") case 1: response.write "Kat. Ogólnotematyczny" case 2: response.write "Kat. tematyczny" case 3: response.write "Księga gosci" case 4: response.write "Płatne linki" end select %> | <%=objk("opis")%> | <%=objk("ile_podkategorii")%> | <% if objk("fraza")=1 then response.Write("TAK") else response.Write("NIE") end if %> | <%=objk("katalog_login")%> | <%=objk("katalog_haslo")%> | <% if kjezyk="7" or kjezyk="75" or kjezyk="7,75" then %><%=objk("cena")%> | <%=objk("nazwa_okresu")%> | <% end if %>">edycja, )">usuń |
| wszystkie linki >> | ||||||||||