%@ Language=VBScript %> <%Option Explicit%> <% if session("LastNameOnTop") & "" = "" AND session("UserID") & "" <> "" then%> <%end if if session("UserID") & "" = "" then server.transfer("account.asp") dim RecipCategs, i, Data, DataExist, thisCategID, PageNo, tens, deleterec, starting, ending, j dim oRs, SQL, oConn, classname1,classname2, totalPages, totalRows, RecipeID, CategTitle, leftphoto,splitFoto,splitFoto1 RecipCategs = Application("RecCategs"&lang) thisCategID = Request.Form("thisCategID") deleterec = Request.Form("deleterec") RecipeID = Request.Form("RecipeID") PageNo = Request("PageNo") : if PageNo & "" = "" then PageNo = 1 tens = Request("tens") : if tens & "" = "" then tens = 1 set oConn = Server.CreateObject("ADODB.Connection") oConn.open Application("ConStr") set oRs = Server.CreateObject("ADODB.Recordset") if deleterec = "1" then SQL = "Delete from RecipeBox where RecipeID=" & RecipeID & " AND UID=" & session("UserID") oConn.execute SQL end if SQL = "MyRecipeBox '" & lang & "', " & session("UserID") & ",'" & thisCategID & "', " & PageSize & "," & PageNo oRs.open SQL, oConn, 0,1,1 if oRs.state=0 then oRs.open SQL, oConn, 3, 1, 1 if oRs.EOF = false then totalRows = oRs("TotalRecs") if totalRows = 0 then DataExist = 0 else totalRows = oRs("TotalRecs") DataExist = 1 Data = oRs.GetRows() totalPages = totalRows \ PageSize if totalRows mod PageSize > 0 then totalPages = totalPages + 1 j=0 redim tempph(totalRows) for i=0 to ubound(Data,2) if Data(5,i) <> "default.jpg" then if instr(Data(5,i),",") <= 0 then tempph(j) = Data(5,i) j = j + 1 else tempph(j) = right(Data(5,i),len(Data(5,i))-instr(Data(5,i),",")) j = j + 1 end if end if next randomize j=Int((j * Rnd)+1) leftphoto = tempph(j-1) if leftphoto & "" = "" then leftphoto = "default.jpg" end if oRs.close if leftphoto & "" = "" then leftphoto = "default.jpg" starting = ((tens-1)*10)+1 : ending = starting + 9 GoToPage = "my_recipe_box.asp" %>