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) {
} //排序 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']);
$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');
} 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));
$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); //同心情的