本文整理汇总了PHP中tree::getChilds方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::getChilds方法的具体用法?PHP tree::getChilds怎么用?PHP tree::getChilds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree
的用法示例。
在下文中一共展示了tree::getChilds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tname
if ($pageFrom['do'] == 'complain_item') {
$complainPage = 1;
}
if (empty($_GET['close'])) {
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('docomment') . " WHERE doid='{$doid}' ORDER BY dateline");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username']);
$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['id'] == $highlight && $one['uid'] == $space['uid']) {
$one['style'] .= 'color:red;font-weight:bold;';
}
$list[] = $one;
}
}
$isComplain = isComplainOrNot($doid, $_SGLOBAL['db']);
realname_get();
} elseif ($_GET['op'] == 'edit') {
if (submitcheck('editsubmit')) {
if ($id) {
示例2: ksort
}
//排序
ksort($values);
include_once S_ROOT . './source/class_tree.php';
$tree = new tree();
foreach ($values as $value) {
realname_set($value['uid'], $value['username']);
$newdoids[$value['doid']] = $value['doid'];
if (empty($value['upid'])) {
$value['upid'] = "do{$value['doid']}";
}
$tree->setNode($value['id'], $value['upid'], $value);
}
}
foreach ($newdoids as $cdoid) {
$values = $tree->getChilds("do{$cdoid}");
foreach ($values as $key => $id) {
$one = $tree->getValue($id);
$one['layer'] = $tree->getLayer($id) * 2;
$clist[$cdoid][] = $one;
}
}
//分页
$multi = multi($count, $perpage, $page, $theurl);
//同心情的
$moodlist = array();
if ($space['mood'] && empty($start)) {
$query = $_SGLOBAL['db']->query("SELECT s.uid,s.username,s.name,s.namestatus,s.mood,s.updatetime,s.groupid,sf.note,sf.sex\r\n\t\tFROM " . tname('space') . " s\r\n\t\tLEFT JOIN " . tname('spacefield') . " sf ON sf.uid=s.uid\r\n\t\tWHERE s.mood='{$space['mood']}' ORDER BY s.updatetime DESC LIMIT 0,13");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
if ($value['uid'] != $space['uid']) {
realname_set($value['uid'], $value['username'], $value['name'], $value['namestatus']);
示例3: libfile
$value['id'] = 0;
$value['layer'] = 0;
$clist[] = $value;
}
}
if ($_GET['icon'] == 'plus' && $value['replynum']) {
require_once libfile('class/tree');
$tree = new tree();
$query = DB::query("SELECT * FROM " . DB::table('home_docomment') . " WHERE doid='{$doid}' ORDER BY dateline");
while ($value = DB::fetch($query)) {
if (empty($value['upid'])) {
$value['upid'] = "do";
}
$tree->setNode($value['id'], $value['upid'], $value);
}
$values = $tree->getChilds("do");
foreach ($values as $key => $id) {
$one = $tree->getValue($id);
$one['layer'] = $tree->getLayer($id) * 2;
$clist[] = $one;
}
}
} elseif ($op == 'deluserapp') {
if (empty($_G['uid'])) {
showmessage('no_privilege_guest');
}
$hash = trim($_GET['hash']);
$query = DB::query("SELECT * FROM " . DB::table('common_myinvite') . " WHERE hash='{$hash}' AND touid='{$_G['uid']}'");
if ($value = DB::fetch($query)) {
DB::query("DELETE FROM " . DB::table('common_myinvite') . " WHERE hash='{$hash}' AND touid='{$_G['uid']}'");
showmessage('do_success');
示例4: showmessage
}
showmessage('do_success');
}
} elseif ($_GET['op'] == 'getcomment') {
include_once S_ROOT . './source/class_tree.php';
$tree = new tree();
$query = $_SGLOBAL['db']->query("select * from " . tname('treecomments') . " use index(rootid) where rootid = '{$rootid}' order by dateline");
$list = array();
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username']);
if (empty($value['upid'])) {
$value['upid'] = $value['rootid'];
}
$tree->setNode($value['id'], $value['upid'], $value);
}
$values = $tree->getChilds($rootid);
foreach ($values as $id) {
$one = $tree->getValue($id);
$one['layer'] = $tree->getLayer($id) * 2 - 2;
$one['style'] = "padding-left:{$one['layer']}em;";
$list[] = $one;
}
} elseif ($_GET['op'] == 'delete') {
if (submitcheck('deletesubmit')) {
$query = $_SGLOBAL['db']->query("select * from " . tname('treecomments') . " where id = '{$id}'");
if ($c = $_SGLOBAL['db']->fetch_array($query)) {
if ($c['rootid'] == $rootid && $c['uid'] == $_SGLOBAL['supe_uid']) {
$_SGLOBAL['db']->query("delete from " . tname("treecomments") . " where id = '{$id}'");
$addr = strrpos($rootid, "_");
$type = substr($rootid, 0, $addr);
$tid = intval(substr($rootid, $addr + 1));
示例5: tree
$tree = new tree();
$values = array();
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('docomment')." USE INDEX(dateline) WHERE doid IN (".simplode($doids).") ORDER BY dateline");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
realname_set($value['uid'], $value['username']);
$newdoids[$value['doid']] = $value['doid'];
if(empty($value['upid'])) {
$value['upid'] = "do$value[doid]";
}
$tree->setNode($value['id'], $value['upid'], $value);
}
}
foreach ($newdoids as $cdoid) {
$values = $tree->getChilds("do$cdoid");
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:red;font-weight:bold;';
}
$clist[$cdoid][] = $one;
}
}
//分页
$multi = multi($count, $perpage, $page, $theurl);
//同心情的