Пример #1
0
function forumChildren($parent, $level = 1)
{
    $result = dbquery("select * from " . DB_PREFIX . "forums f\n\tleft join " . DB_PREFIX . "fb_forums f2 on f2.forum_id=f.forum_id\n\twhere f2.forum_parent='{$parent}' order by f.forum_order asc");
    $forumR = "";
    if (dbrows($result)) {
        $forumR .= "</table>" . panelstate("off", "forum" . $parent) . "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
        $k = 1;
        $children = "";
        for ($i = $level; $i--; $i > 0) {
            $children .= "&emsp;";
        }
        while ($data = dbarray($result)) {
            $forumR .= renderForum($data, $result, $k, $children);
            $k++;
            $forumR .= forumChildren($data['forum_id'], $level + 1);
        }
        $forumR .= "</table></div><table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
    }
    return $forumR;
}
Пример #2
0
function forumChildren($parent, $level = 1)
{
    $result = dbquery("select * from " . DB_PREFIX . "forums f\n\tleft join " . DB_PREFIX . "fb_forums f2 on f2.forum_id=f.forum_id\n\twhere f2.forum_parent='{$parent}'");
    $forumR = "";
    if (dbrows($result)) {
        $k = 1;
        $children = "";
        for ($i = $level; $i--; $i > 0) {
            $children .= "&emsp;";
        }
        while ($data = dbarray($result)) {
            $forumR .= renderForum($data, $result, $k, $children);
            $k++;
            $forumR .= forumChildren($data['forum_id'], $level + 1);
        }
    }
    return $forumR;
}