prefix($prefix); switch($db_version){ case ($db_version>= 6000): $id_name = "term_taxonomy_id"; $pid_name = "parent"; $title_name = "name"; $term_taxonomy_db = $wp_prefix . '_term_taxonomy'; $terms_db = $wp_prefix . '_terms'; $sql = "SELECT $term_taxonomy_db.$id_name,$terms_db.$title_name "; $sql .= "FROM $term_taxonomy_db INNER JOIN $terms_db ON $term_taxonomy_db.term_id = $terms_db.term_id "; $sql .= "WHERE $term_taxonomy_db.parent = $parent AND $term_taxonomy_db.taxonomy = 'category'"; break; default: $id_name = "cat_ID"; $pid_name = "category_parent"; $title_name = "cat_name"; $cat_db = $wp_prefix . '_categories'; $sql = "SELECT $id_name , $title_name "; $sql .= "FROM $cat_db "; $sql .= "WHERE $pid_name = $parent"; break; } $res = $xoopsDB->query($sql, 0, 0); if ($res === false){ return ; } else { $index = 0; while($row = $xoopsDB->fetchArray($res)){ if ($depth == 1){ $xpress_sitemap['parent'][$index]['id'] = $row[$id_name]; $xpress_sitemap['parent'][$index]['title'] = $myts->makeTboxData4Show( $row[$title_name] ) ; $url = "index.php?cat="; $xpress_sitemap['parent'][$index]['url'] = $url.$row[$id_name]; if ($disp_sub){ get_sitemap_category_list($mydirname,&$xpress_sitemap,$row[$id_name] , $index, $disp_sub,$depth + 1); } } else { $xpress_sitemap['parent'][$parent_index]['child'][$index]['id'] = $row[$id_name]; $xpress_sitemap['parent'][$parent_index]['child'][$index]['title'] = $myts->makeTboxData4Show( $row[$title_name] ) ; $url = "index.php?cat="; $xpress_sitemap['parent'][$parent_index]['child'][$index]['url'] = $url.$row[$id_name]; $xpress_sitemap['parent'][$parent_index]['child'][$index]['image'] = (($depth > 3) ? 4 : $depth);; // get_sitemap_category_list($mydirname,&$xpress_sitemap,$row[$id_name] , $index, $disp_sub,$depth +1); } $index++; } } } } ?>