<% call Main() function ReviewThis(lngRecipeId,strRecipe,con,bSubmitted) dim rst,rst2,strLine,strLines,strGroup,strGroups,strCell,lngReviewId if not bSubmitted then ReviewThis = ML("TPL_RECIPE_REVIEW") ReviewThis = MLReplace(ReviewThis,"USERNAME",Session("USERNAME")) ReviewThis = MLReplace(ReviewThis,"EMAILADDRESS",Session("EMAILADDRESS")) else ReviewThis = ML("TPL_RECIPE_REVIEWTHANKS") Session("USERNAME") = R("USERNAME") Session("EMAILADDRESS") = R("EMAILADDRESS") dim strSQl strSQl = "INSERT RecipeReview (RecipeId,USERNAME,EMAILADDRESS,REMARKS,IPAddress) VALUES (" & _ "'" & SQLEncode (R("ID")) & "', " & _ "'" & SQLEncode (R("UserName")) & "', " & _ "'" & SQLEncode (R("EMAILADDRESS")) & "', " & _ "'" & SQLEncode (R("Remarks")) & "', " & _ "'" & Request.ServerVariables("REMOTE_HOST") & "')" con.execute strSQL strSQL = "SELECT @@Identity ID" set rst = con.execute (strSQL) lngReviewId = rst("ID") end if set rst=con.execute ("SELECT * FROM RecipeReviewTopic WHERE Active=1 ORDER BY SortOrder") do while not rst.eof if not bSubmitted then strLine = ML("TPL_RECIPE_REVIEW_SCOREROW") strLine = MLReplace(strLine,"ID",rst("RecipeReviewTopicId")) strLine = MLReplace(strLine,"topic",rst("RecipeReviewTopic")) strLines = strLines & strLine else ' Response.Write R("REVIEW" & rst("RecipeReviewTopicId")) & "
" if R("REVIEW" & rst("RecipeReviewTopicId")) <> "" then strSQL = "INSERT RecipeReviewScore (RecipeReviewId,RecipeId,RecipeReviewTopicId,Score) VALUES (" & _ "'" & lngReviewId & "', " & _ "'" & SQLEncode (R("ID")) & "', " & _ "'" & rst("RecipeReviewTopicId") & "', " & _ "'" & SQLEncode (R("REVIEW" & rst("RecipeReviewTopicId"))) & "')" con.execute strSQL end if end if rst.MoveNext loop rst.close IF AllowEdit() then ReviewThis =MLReplace(ReviewThis,"REVIEWTOPICS",strLInes) end if set rst=con.execute ("SELECT * FROM RecipeCategoryMain WHERE Active=1 ORDER BY SortOrder") do while not rst.eof strGroup = ML("TPL_RECIPE_REVIEW_CATGROUP") strGroup = MLReplace(strGroup,"name",rst("RecipeCategoryMain")) set rst2=con.execute ("SELECT * FROM RecipeCategory WHERE Active=1 AND RecipeCategoryMainId=" & rst("RecipeCategoryMainId") & " ORDER BY SortOrder") dim lngCellNr lngCellNr = 3 strLines="" strLine="" do while not rst2.eof lngCellNr = lngCellNr + 1 if not bSubmitted then if lngCellNr = 4 then 'New Row lngCellNr=1 strLines = strLines & strLine strLine = ML("TPL_RECIPE_REVIEW_CATROW") end if strCell = ML("TPL_RECIPE_REVIEW_CATCELL") strCell = MLReplace(strCell,"name",rst2("RecipeCategory")) strCell = MLReplace(strCell,"id",rst2("RecipeCategoryId")) strLine = MLReplace(strLine,"CELL" & lngCellNr,strCell) else 'Response.Write R("check_" & rst2("RecipeCategoryId")) & "
" if R("check_" & rst2("RecipeCategoryId")) ="1" then strSQL = "INSERT RecipeReviewCategory (RecipeReviewId,RecipeId,RecipeCategoryId) VALUES (" & _ "'" & lngReviewId & "', " & _ "'" & SQLEncode (R("ID")) & "', " & _ "'" & rst2("RecipeCategoryId") & "')" con.execute strSQL end if end if rst2.movenext loop rst2.close strLine = MLReplace(strLine,"CELL2" & lngCellNr,strCell) strLine = MLReplace(strLine,"CELL3" & lngCellNr,strCell) strLines = strLines & strLine strGroup = MLReplace(strGroup,"ROWS",strLines) strGroups = strGroups & strGroup rst.MoveNext loop rst.close ReviewThis =MLReplace(ReviewThis,"REVIEWCATEGORIES",strGroups ) ReviewThis =MLReplace(ReviewThis,"RECIPEID",lngRecipeId ) ReviewThis =MLReplace(ReviewThis,"CANCELURL", Request.ServerVariables("URL") & "?recept=" & strRecipe ) ReviewThis =MLReplace(ReviewThis,"SUBMITURL", Request.ServerVariables("URL") & "?recept=" & strRecipe & "&submitted=y" ) end function function CreateMetaTag(strName) dim strMeta strMeta= strName strMeta= Replace (strMeta,"""","") strMeta= Replace (strMeta,"
","") strMeta= Replace (strMeta,"","") strMeta= Replace (strMeta,"","") strMeta= Replace (strMeta,"","") strMeta= Replace (strMeta,"","") strMeta= Replace (strMeta,vbCr,"") strMeta= Replace (strMeta,vbLf,"") if len (strMeta) > 255 then strMeta =left(strMeta,255) end if CreateMetaTag = strMeta end function function Main() dim strPage Dim oXMLHttp Set oXMLHttp = Server.CreateObject("MSXML2.XMLHTTP") oXMLHttp.Open "GET", "http://www.recepten.net/categorie/subcategorie/recept.aspx" , False oXMLHttp.Send strPage = oXMLHttp.responseText dim strList dim strListItem dim con set con=server.createobject("ADODB.Connection") openconsite con dim rst,rst2, lngRecipeId set rst=server.createobject("ADODB.Recordset") set rst2=server.createobject("ADODB.Recordset") dim strCategory,strType,strBackLink1,strBackLink2,strBackLinkDescription1,strBackLinkDescription2 ,strPhotoGallery rst.open "SELECT * FROM RECIPES WHERE URL= '" & SQLEncode(R("recept")) & "' AND Visible=1", con, adopenstatic,adlockreadonly strPage=MLReplace(strPage,"RECIPEID",R("recept")) if not rst.eof then lngRecipeId=rst("recipeid") strCategory=rst("Category") strType=rst("Type") strPhotoGallery = n2e(rst("PhotoGallery")) if strPhotoGallery <> "" then dim strTemplate strTemplate = ML("tpl_recipe_photogallery") strTemplate=MLReplace(strTemplate,"photo",strPhotoGallery) strPage=MLReplace(strPage,"PHOTOGALLERY",strTemplate) end if rst2.open "SELECT * FROM recipecategories WHERE category='" & SQLEncode(strCategory) & "'", con strBackLink2= "/" & rst2("url2") strBackLinkDescription1 = rst2("Description") strBackLinkDescription2 = rst2("Description2") rst2.close strBackLink1 = "/recepten.php?categorie=" & lcase(strCategory) & "&soort=" & lcase(strType) rst2.open "SELECT * FROM recipetypes WHERE type='" & SQLEncode(strType) & "'", con strBackLinkDescription1 = rst2("Description") & " " & strBackLinkDescription1 rst2.close strPage = MLReplace(strPage,"BREADCRUMBS",ML("tpl_recipe_backlinks") & "" & strBackLinkDescription2 & " - " & strBackLinkDescription1 & "
") 'strPage = MLReplace(strPage,"RECIPEID",rst("recipeid")) strPage = MLReplace(strPage,"TITLE","Recept voor " & rst("title")) strPage = MLReplace(strPage,"RECEPTNAAM",rst("title")) strPage = MLReplace(strPage,"METADESCRIPTION",CreateMetaTag("Recept " & rst("title") & ": " & rst("description") & " " & rst("ingredients") )) strPage = MLReplace(strPage,"RECEPTBESCHRIJVING",rst("description")) strPage = MLReplace(strPage,"RECEPTINGREDIENTEN",rst("ingredients")) strPage = MLReplace(strPage,"RECEPTBEREIDINGSWIJZE",cstr(rst("instructions"))) strPage = MLReplace(strPage,"RECEPTBEREIDINGSTIJD",rst("preparationtime")) if r("review")="y" then strPage = MLReplace(strPage,"REVIEWTHIS",ReviewThis(rst("recipeid"),R("recept"),con,false)) elseif r("submitted")="y" then strPage = MLReplace(strPage,"REVIEWTHIS",ReviewThis(rst("recipeid"),R("recept"),con,true)) elseif AllowEdit() then strPage = MLReplace(strPage,"REVIEWINVITE","
" & ML("tpl_recipe_reviewinvite") & "
" ) end if rst.close '***** REVIEWS ********* dim strReview, strReviews rst.open "SELECT * FROM RECIPEREVIEW WHERE RECIPEID=" & lngRecipeId & " AND VISIBLE=1 ORDER BY RECIPEID ASC",con do while not rst.eof if not isnull(rst("remarks")) then if rst("remarks")<>"" then strReview = ML("tpl_show_review") strReview=MLReplace(strReview,"USERNAME",rst("username")) strReview=MLReplace(strReview,"REMARKS",rst("remarks")) strReviews = strReviews & strReview end if end if rst.movenext loop rst.close if AllowEdit() then dim strEdit strEdit = "Dit recept bewerken
" strPage=MLReplace(strPage,"EDIT",strEdit ) strPage = MLReplace(strPage,"SHOWID","RECIPEID:" & lngRecipeId & " " ) dim strScore rst.Open "SELECT * FROM vwRecipeTopicScore WHERE RecipeId=" & lngRecipeId do while not rst.eof strScore=strScore & rst("RecipeReviewTopic") & ": " & rst("Score") & "
" rst.Movenext loop rst.Close strPage = MLReplace(strPage,"SHOWscore","

BEOORDELINGEN:

" & strScore & "
" ) end if strPage=MLReplace(strPage,"REVIEWS",strReviews) '******** RELATED RECIPES ********** dim lngCount lngCount = 0 dim strRelatedRecipes,strRelatedRecipe rst.Open "SELECT RECIPES.* FROM RecipeRelated JOIN Recipes ON Recipes.RecipeId = RecipeRelated.RelatedRecipeId WHERE Recipes.Visible=1 AND RecipeRelated.RecipeId=" & lngRecipeId do while not rst.eof lngCount=lngCount + 1 'strRelatedRecipe = MLReplace(strRelatedRecipe,"RECIPEID",rst("URL")) 'strRelatedRecipe = MLReplace(strRelatedRecipe,"NAME",rst("title")) 'strRelatedRecipe = MLReplace(strRelatedRecipe,"DESCRIPTION",RemoveHTMLTags(rst("description"))) strRelatedRecipe = "
  • " & rst("title") & "
  • " strRelatedRecipes= strRelatedRecipes & strRelatedRecipe rst.moveNext loop rst.close 'if strRelatedRecipes <> "" then ' strRelatedRecipes = ML("TPL_RECIPE_RELATEDHEADER") & strRelatedRecipes 'end if '******** MORE RECIPES ********** rst.Open "SELECT TOP 6 RECIPES.* FROM Recipes WHERE Visible=1 AND Recipes.RecipeId > " & lngRecipeId & " ORDER BY RECIPEID" do while not rst.eof and lngCount < 7 lngCount=lngCount + 1 strRelatedRecipe = "
  • " & rst("title") & "
  • " strRelatedRecipes= strRelatedRecipes & strRelatedRecipe rst.moveNext loop rst.close if lngCount < 6 then rst.Open "SELECT TOP " & 6-lngCount & " RECIPES.* FROM Recipes WHERE Visible=1 ORDER BY RECIPEID" do while not rst.eof lngCount=lngCount + 1 strRelatedRecipe=ML("TPL_RECIPE_MOREROW") strRelatedRecipe = "
  • " & rst("title") & "
  • " strRelatedRecipes= strRelatedRecipes & strRelatedRecipe rst.moveNext loop rst.close end if strPage=MLReplace(strPage,"RECEPTMEER",strRelatedRecipes) else strPage = MLReplace(strPage,"RECIPEID",0) strPage = MLReplace(strPage,"TITLE","RECEPT NIET GEVONDEN OF VERWIJDERD") strPage = MLReplace(strPage,"PAGETITLE","Recept niet gevonden!") strPage = MLReplace(strPage,"PAGEDESCRIPTION","") strPage = MLReplace(strPage,"PREPARATIONTIME","") rst.close end if strPage=setmenu(strPage) Response.Write MakeABS(strPage) End Function %>