Пример #1
0
    $highlight = 0;
    $count = 0;
    if (empty($_GET['close'])) {
        foreach (C::t('home_docomment')->fetch_all_by_doid($doid) as $value) {
            $tree->setNode($value['id'], $value['upid'], $value);
            $count++;
            if ($value['authorid'] == $space['uid']) {
                $highlight = $value['id'];
            }
        }
    }
    if ($count) {
        $values = $tree->getChilds();
        foreach ($values as $key => $vid) {
            $one = $tree->getValue($vid);
            $one['layer'] = $tree->getLayer($vid) * 2;
            $one['style'] = "padding-left:{$one['layer']}em;";
            if ($one['layer'] > 0) {
                if ($one['layer'] % 3 == 2) {
                    $one['class'] = ' dtls';
                } else {
                    $one['class'] = ' dtll';
                }
            }
            if ($one['id'] == $highlight && $one['uid'] == $space['uid']) {
                $one['style'] .= 'color:#F60;';
            }
            $list[] = $one;
        }
    }
} elseif ($_GET['op'] == 'spacenote') {
Пример #2
0
    $values = array();
    foreach (C::t('home_docomment')->fetch_all_by_doid($doids) as $value) {
        $newdoids[$value['doid']] = $value['doid'];
        if (empty($value['upid'])) {
            $value['upid'] = "do{$value['doid']}";
        }
        $tree->setNode($value['id'], $value['upid'], $value);
    }
}
$showdoinglist = array();
foreach ($newdoids as $cdoid) {
    $values = $tree->getChilds("do{$cdoid}");
    $show = false;
    foreach ($values as $key => $id) {
        $one = $tree->getValue($id);
        $one['layer'] = $tree->getLayer($id) * 2 - 2;
        $one['style'] = "padding-left:{$one['layer']}em;";
        if ($_GET['highlight'] && $one['id'] == $_GET['highlight']) {
            $one['style'] .= 'color:#F60;';
        }
        if ($one['layer'] > 0) {
            if ($one['layer'] % 3 == 2) {
                $one['class'] = ' dtls';
            } else {
                $one['class'] = ' dtll';
            }
        }
        if (!$show && $one['uid']) {
            $show = true;
        }
        $clist[$cdoid][] = $one;