$rs = $db->Execute("SELECT id, name FROM `".$cfg->get('db.prefix')."group` ORDER BY id"); while(!$rs->EOF) { $gruppe[$rs->fields["id"]] = $rs->fields["name"]; $rs->MoveNext(); } $sql = "SELECT id, home "; $sql .= "FROM ".$cfg->get('db.prefix')."kategorie "; $sql .= "WHERE id > 0 "; $sql .= "ORDER BY `order` ASC "; $rs1 = $db->Execute($sql); while(!$rs1->EOF) { unset($pages); $res = $rs1->fields; $cat_data = $language->get_category_translation($res['id']); $res['name'] = $cat_data['name']; // Get Access unset($kat_access); $rs3 = $db->Execute("SELECT ga.group FROM ".$cfg->get('db.prefix')."group_access ga WHERE ga.access='".$cfg->get('global.access.prefix').".k.".$rs1->fields["id"]."'"); while(!$rs3->EOF) { $kat_access[] = $rs3->fields["group"]; $rs3->MoveNext(); } foreach($gruppe as $id=>$name){ if($id == 0 && @in_array($id, $kat_access)){ $res["access"] = "true"; } } $sql = "SELECT t.tpl_name, t2k.list, t2k.id as t2k_id, t2k.wartung "; $sql .= "FROM ".$cfg->get('db.prefix')."tpl t "; $sql .= "LEFT JOIN ".$cfg->get('db.prefix')."tpl_2_kat t2k ON t.tpl_name=t2k.tpl_name "; $sql .= "WHERE t2k.kat=".intval($rs1->fields["id"])." AND t2k.list=1 "; $sql .= "GROUP BY t.tpl_name "; $sql .= "ORDER BY t2k.order ASC "; $rs2 = $db->Execute($sql); while(!$rs2->EOF) { $page = $rs2->fields; $page_data = $language->get_page_translation($page['tpl_name']); $page['tpl_title'] = $page_data['title']; $page['tpl_seo_title'] = $page_data['seo']; // Get Access unset($access); $rs3 = $db->Execute("SELECT ga.group FROM ".$cfg->get('db.prefix')."group_access ga WHERE ga.access='".$cfg->get('global.access.prefix').".".$rs2->fields["tpl_name"]."'"); while(!$rs3->EOF) { $access[] = $rs3->fields["group"]; $rs3->MoveNext(); } foreach($gruppe as $id=>$name){ if($id == 0 && @in_array($id, $access)){ $page["access"] = "true"; } } $pages[] = $page; $rs2->MoveNext(); } $res["pages"] = $pages; $result[] = $res; $rs1->MoveNext(); } $tpl->assign('s_kat', $result); ?>