<%option explicit%> <% '**************************************************************** ' Display shop categories ' displays a list of categories from Shopping Database ' Support images for each category and multiple columns per listing ' Now allows product displays or subcategory displays '**************************************************************** ' dim colcount Dim strcatImage Dim Mylink ShopPageHeader ' Page header for shop CategoryHeader ' category header on this page Showcategories ' format categories on this page ShopPageTrailer ' shop page trailer ' ' Show Categories Sub ShowCategories() Dim rs dim lngcatid dim strcategory Dim dbc colcount=0 ShopOpenDatabase dbc SQL="Select * from categories order by " & xsortcategories OpenRecordSet dbc, rs, sql While Not rs.EOF lngcatid=rs("categoryid") strcategory=rs("catdescription") strsubcategory=rs("hassubcategory") strcatimage=rs("catimage") ' image if isNull(strcatimage) then strcatimage="" end if if isNULL(strsubcategory) then strsubcategory="" end if FormatCategory lngcatid, strcategory rs.MoveNext Wend if colcount> 0 then FillRemainingcolumns end if response.write "" CloseRecordSet rs ShopCloseDatabase dbc end sub '************************************* Sub CategoryHeader ' displays header for categories %> <%=catHeader%><%=LangCat01%>

<% response.write "
" response.write CatTable end sub ' ***********Format Category Sub FormatCategory (id, name) if colcount=0 then Response.write CatRow end if response.write CatColumn if strSubcategory ="" then response.write "" & name & "" else Response.write "" & name & "..." Response.write "
" response.write "" & LangProductProduct & "" Response.write " " & langSubcategories & "" Response.write "" end if If strCatImage<> "" then AddImage id, Name end if Response.write CatColumnEnd colcount=colcount+1 if colcount>= CatMaxColumns then response.write "" colcount=0 end if end sub Sub AddImage(id, iname) dim mylink dim linkname linkname=Server.URLEncode(Iname) if strSubcategory ="" then %>

<% else %>

<% end if end sub Sub FillRemainingColumns Do While Colcount " colcount=colcount+1 loop response.write "" end sub %>