VbzCart/queries/ cat pages

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | queries
Revision as of 18:33, 8 March 2009 by Woozle (talk | contribs) (New page: ==About== * '''Purpose''': catalog index, for translating URLs to page-display requests; {{vbzcart|proc|Upd_CatPages}} caches the output in a table * '''Requires''': {{vbzcart|table|cat_su...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  1. REDIRECT Template:l/vc/query, qryCat_Titles

SQL

<mysql>CREATE OR REPLACE VIEW _cat_pages AS

 SELECT
   CONCAT_WS('-','S',ID) AS AB,
   LOWER(CatKey) AS Path,
   ID,
   'S' AS Type
 FROM cat_supp
 UNION
 SELECT
   CONCAT_WS('-','D',ID) AS AB,
   LOWER(CatWeb_Dept) AS Path,
   ID,
   'D' AS Type
 FROM qryCat_Depts
 UNION
 SELECT
   CONCAT_WS('-','T',ID) AS AB,
   REPLACE(LOWER(CatWeb),'-','/') AS Path,
   ID,
   'T' AS Type
 FROM qryCat_Titles
 UNION
 /* image pages (every size except thumbnail and small) */
 SELECT
   CONCAT_WS('-','I',i.ID) AS AB,
   LOWER(CONCAT_WS('/',REPLACE(t.CatWeb,'-','/'),AttrFldr,i.Ab_Size)) AS Path,
   i.ID,
   'I' AS Type
 FROM cat_images AS i LEFT JOIN qryCat_Titles AS t ON i.ID_Title=t.ID WHERE (i.isActive) AND (i.Ab_Size NOT IN ('th','sm'));</mysql>