Listing 1618
Followup to listing-1617.txt, submitted by anonymous user.
Submitted by anonymous user, 8 October 2008
SELECT ItemCategories.CategoryId, Categories.TreeLeft, Categories.TreeRight, Categories.Level, Categories.ViewCount, CategoryText.CategoryName, CategoryText.MetaTitle, CategoryText.MetaDesc, CategoryText.URLSlug, CategoryText.LongDesc, CategoryPictures.PictureId, CategoryPictures.HomePagePromotional, CategoryPictures.Thumb, CategoryPictures.Picture, CategoryPictures.Original, CategoryPictures.Landscape, CategoryTypeEnum.Name as CategoryType FROM ItemCategories LEFT JOIN CategoryText ON ItemCategories.CategoryId=CategoryText.CategoryId AND CategoryText.LanguageId=1 LEFT JOIN Categories ON ItemCategories.CategoryId=Categories.CategoryId LEFT JOIN CategoryPictures on Categories.DefaultPic = CategoryPictures.PictureId LEFT JOIN CategoryTypeEnum on Categories.CategoryTypeId = CategoryTypeEnum.CategoryTypeId WHERE ItemCategories.ItemId IN ( SELECT ItemCategories.ItemId FROM ItemCategories LEFT JOIN Items ON ItemCategories.ItemId=Items.ItemId WHERE ItemCategories.CategoryId IN ( SELECT Categories.CategoryId FROM Categories WHERE Categories.TreeLeft >= ( SELECT Categories.TreeLeft FROM Categories WHERE CategoryId={$CategoryId} ) AND Categories.TreeRight <= ( SELECT Categories.TreeRight FROM Categories WHERE CategoryId={$CategoryId} ) ) AND Items.Tombstoned=0 ) AND ItemCategories.ItemId IN ( <br /> SELECT DISTINCT (Items.ItemId) FROM Items, Categories, ItemCategories WHERE Items.ItemId = ItemCategories.ItemId AND Categories.CategoryId = ItemCategories.CategoryId AND ItemCategories.CategoryId IN ( {$SQLInStatement} ) GROUP BY Items.ItemId HAVING (COUNT( * ))= {$SQLCnt} <br /> ) AND Categories.Level IN (3,4) AND CategoryTypeEnum.Name IN ( {$Type} ) Order BY Categories.TreeLeft ASC
