%@LANGUAGE="VBSCRIPT" CODEPAGE="1253"%>
<%
if session("useglobalconn")=1 then
set moConn=server.CreateObject("ADODB.Connection")
moConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;User Id=admin;Password="
end if
if request.querystring("op")<>"" then
set oDict=request.querystring
else
set oDict=request.form
end if
%>
Greek Photo Bank - Landscape, Stock, Lifestyle, Food & Beverage photographs for sale or lease - Collection from Greece and Greek Islands
Options: |
<%
if odict("op")="showcat" or odict("op")="" or odict("op")="showphotos" then
response.write "Photo Catalog | "
else
response.write "Photo Catalog | "
end if
if odict("op")="basket" then
response.write "Basket | "
else
response.write "Basket | "
end if
if odict("op")="search" then
response.write "Search | "
else
response.write "Search | "
end if
if odict("op")="license" then
response.write "License | "
else
response.write "License | "
end if
%>
<%
select case odict("op")
case "showcat","":
ShowCategories
case "showphotos":
ShowPhotos
case else
end select
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SHOWCATEGORIES FUNCTION XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SHOWCATEGORIES FUNCTION XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function ShowCategories()
%>
| Main Categories |
Sub-Categories (Click on Sub-Categories to view their Photos) |
<%
set ors=server.CreateObject("ADODB.Recordset")
ssql= "SELECT * FROM CATEGORY "
ssql=ssql & " WHERE subcategorycode=0"
ssql=ssql & " ORDER BY CategoryName"
ors.open ssql,moconn,2,3
do while not ors.eof
response.write "| " & ors("categoryname") & "" & getrandomphoto(ors("categorycode")) & " | "
response.write "" & getsubcategories(ors("categorycode")) & " |
"
ors.movenext
loop
%>
<%
end function
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SHOWCATEGORIES FUNCTION XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function getrandomphoto(lCatCode)
dim st
dim ors3
dim R
Randomize
R=clng(1*rnd)
if r=0 then
srand="asc"
else
srand="desc"
end if
set ors3=server.CreateObject("ADODB.Recordset")
ors3.open "SELECT TOP 10 * FROM photo where enabled=true and categorycode=" & lcatcode & " ORDER BY photocode " & srand,moconn,2,3
if ors3.eof then
set ors3=server.CreateObject("ADODB.Recordset")
ors3.open "SELECT TOP 10 * FROM photocategory where categorycode=" & lcatcode & " ORDER BY photocode " & srand,moconn,2,3
end if
do while not ors3.eof
ss=ss & "," & ors3("photocode")
ors3.movenext
loop
if ss<>"" then
ss=mid(ss,2)
end if
sarr=split(ss,",")
if ubound(sarr)>0 then
Randomize
R=clng(ubound(sarr)*rnd)
st=st & "
"
else
if ss<>"" then
st=st & "
"
else
end if
end if
getrandomphoto=st
end function
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SHOW PHOTOS FUNCTION XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SHOW PHOTOS FUNCTION XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function ShowPhotos()
%>
| Category | Sub Categories |
| <% response.write getmaincategory(odict("categorycode"))%> | <% response.write getsubcategories(odict("categorycode"))%> |
<%
set ors=server.CreateObject("ADODB.Recordset")
ssql= "SELECT * FROM PHOTO "
ssql=ssql & " WHERE photo.categorycode=" & odict("categorycode")
ssql=ssql & " OR photo.photocode in (select photocategory.photocode from photocategory where photocategory.categorycode=" & odict("categorycode") & ")"
ssql=ssql & " ORDER BY photo.orderid,photo.photoname"
ors.open ssql,moconn,2,3
lcount=0
do while not ors.eof
if lcount=0 then
response.write ""
end if
'href=""showphotobank.asp?photocode=" & ors("photocode") & """ target=showphoto" & ors("photocode") & "'
response.write ""
response.write "![]() " & ors("photoname") & " | "
ors.movenext
lcount=lcount+1
if lcount=5 then
lcount=0
response.write "
"
end if
loop
if lcount<>0 then
for i=1 to 4-lcount
response.write "| | "
next
response.write "
"
end if
%>
<%
end function
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX SHOW PHOTOS FUNCTION XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
%>
<%
'XXXXXXXXXXXXXXXXXXXXXXXXX GET MAIN CATEGORY XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
function GetMainCategory(sCategoryCode)
dim oRs2
if scategorycode<>"" then
else
GetMainCategory=""
exit function
end if
set oRs2=server.CreateObject("ADODB.Recordset")
ors2.open "SELECT * FROM category WHERE categorycode=" & sCategoryCode,moConn,2,3
if not ors2.eof then
if ors2("subcategorycode")>0 then
GetMainCategory=GetMainCategory(ors2("subcategorycode")) & " ->" & ors2("categoryname") & ""
else
'GetMainCategory="" & ors2("categoryname") & ""
GetMainCategory="All Categories ->" & "" & ors2("categoryname") & ""
end if
end if
ors2.close
set ors2=nothing
end function
'XXXXXXXXXXXXXXXXXXXXXXXXX END GET MAIN CATEGORY XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
'XXXXXXXXXXXXXXXXXXXXXXXXX GET SUB CATEGORY XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
function GetSubCategories(sCategoryCode)
dim oRs2
dim sTT
if sCategoryCode<>"" then
else
GetSubCategories=""
exit function
end if
set oRs2=server.CreateObject("ADODB.Recordset")
ors2.open "SELECT * FROM category WHERE subcategorycode=" & sCategoryCode,moConn,2,3
do while not ors2.eof
if stt="" then
stt=stt & "" & ors2("categoryname") & ""
else
stt=stt & " * " & ors2("categoryname") & ""
end if
ors2.movenext
loop
GetSubCategories=stt & " "
ors2.close
set ors2=nothing
end function
'XXXXXXXXXXXXXXXXXXXXXXXXX END GETSUBCATEGORIES XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
%>