/** * returns forums XML */ function getForumsXML($cat, $root) { $fdb = new DbForum(); if ($root) { $c = '<forums>'; } else { $c = ''; } $aa = $fdb->getForums($cat); reset($aa); while (list(, $rr) = each($aa)) { encode_post_text($rr['forum_title'], $root); encode_post_text($rr['forum_desc'], $root); $c .= <<<EOF <forum id="{$rr['forum_id']}" new="0"> \t<title>{$rr['forum_title']}</title> \t<desc>{$rr['forum_desc']}</desc> \t<type>{$rr['forum_type']}</type> \t<posts>{$rr['forum_posts']}</posts> \t<topics>{$rr['forum_topics']}</topics> \t<last>{$rr['forum_last']}</last> </forum> EOF; } if ($root) { $cu = $this->getUrlsXml(); return '<root>' . $cu . $c . "</forums></root>\n"; } else { return $c; } }
/** * returns forums XML */ function getForumsShortXML($cat, $root) { $fdb = new DbForum(); if ($root) { $c = '<forums>'; } else { $c = ''; } $aa = $fdb->getForums($cat); reset($aa); while (list(, $rr) = each($aa)) { encode_post_text($rr['forum_title'], 0); $c .= <<<EOF <forum id="{$rr['forum_id']}"> <uri>{$rr['forum_uri']}</uri> \t<title>{$rr['forum_title']}</title> \t<type>{$rr['forum_type']}</type> </forum> EOF; } if ($root) { return $c . "</forums>\n"; } else { return $c; } }