$MainQuery = 'SELECT c.id AS catID, c.name AS name, c.description, c.subcat, x.name AS xname FROM ' . _PRE . 'categories' . ' AS x LEFT JOIN ' . _PRE . 'categories' . ' AS c ON c.subcat = x.id WHERE x.seftitle = "' . $categorySEF . '" AND c.seftitle = "' . $subcatSEF . '" ' . $pub_c . $pub_x; } } else { switch (true) { case substr($categorySEF, 0, 2) == l('paginator'): break; case false !== strpos($categorySEF, 'rss-'): die(rss_contents($categorySEF, $articleSEF)); // Two queries for / Category / OR /Page/ // Two queries for / Category / OR /Page/ default: $Try_Page = mysql_query('SELECT id, title, category, description_meta, keywords_meta, position FROM ' . _PRE . 'articles' . ' AS a WHERE seftitle = "' . $categorySEF . '" ' . $pub_a . ' AND position = 3'); // query for category $R = mysql_fetch_assoc($Try_Page); if (!$R) { $MainQuery = 'SELECT id AS catID, name, description FROM ' . _PRE . 'categories' . ' AS c
$MainQuery = 'SELECT c.id AS catID, c.name AS name, c.description, c.subcat, x.name AS xname FROM ' . _PRE . 'categories' . ' AS x LEFT JOIN ' . _PRE . 'categories' . ' AS c ON c.subcat = x.id WHERE x.seftitle = "' . $categorySEF . '" AND c.seftitle = "' . $subcatSEF . '" ' . $pub_c . $pub_x; } } else { switch (true) { case substr($categorySEF, 0, 2) == l('paginator'): break; case false !== strpos($categorySEF, 'rss-'): die(rss_contents($categorySEF)); // Patch #17A - 1.7.1 removed: , $articleSEF (redundant) // Two queries for / Category / OR /Page/ // Patch #17A - 1.7.1 removed: , $articleSEF (redundant) // Two queries for / Category / OR /Page/ default: $Try_Page = mysql_query('SELECT id, title, category, description_meta, keywords_meta, position FROM ' . _PRE . 'articles' . ' AS a WHERE seftitle = "' . $categorySEF . '" ' . $pub_a . ' AND position = 3'); // query for category $R = mysql_fetch_assoc($Try_Page); if (!$R) { $MainQuery = 'SELECT