function getNodeList($path, $aryReturn = array()) { $aryPages = Page::getPages($path, false); for ($i = 0; $i < count($aryPages); $i++) { $strEntry = $aryPages[$i]->path; $strURL = $aryPages[$i]->getURL(); $aryReturn[] = "[\"" . $strEntry . "\", \"" . $strURL . "\"]"; $aryReturn = getNodeList($strEntry, $aryReturn); } return $aryReturn; }
function getNode($DEPT_PARENT) { global $db; $sql = "select 节点,名称,父节点 from ziyuanku_node where 节点='$DEPT_PARENT' and (管理权限='全体部门' or find_in_set('$部门名称', 管理权限) )order by 排序号 asc "; $rs = $db->Execute($sql); $rs_a = $rs->GetArray(); if(!empty($rs_a)){ $DEPT_ID = $rs_a[0]['节点']; $DEPT_NAME = $rs_a[0]['name']; $open="false"; print "zNodes[zNodes.length]={id:$DEPT_ID, pId:0, name:'$DEPT_NAME', ename:'$DEPT_NAME', open:true};\n"; } getNodeList($DEPT_PARENT); }
function getNode($DEPT_PARENT) { global $db; $sql = "select 节点,名称,父节点 from ziyuanku_node where 节点='$DEPT_PARENT' "; $rs = $db->Execute($sql); $rs_a = $rs->GetArray(); if(!empty($rs_a)){ $DEPT_ID = $rs_a[0]['节点']; $DEPT_NAME = $rs_a[0]['名称']; $open="true"; print "zNodes[zNodes.length]={id:$DEPT_ID, pId:0, name:'$DEPT_NAME', ename:'$DEPT_NAME', open:$open};\n"; } getNodeList($DEPT_PARENT); }
} echo $html; } } ?> </div> <div class="title-section"> <h3>Bài hát nghe nhiều</h3> </div> <div class="content"> <?php $html = ''; if (function_exists('getNodeList')) { $nodes = getNodeList('nhac_so', 0, 10, true); if (isset($nodes)) { foreach ($nodes as $node) { $node_view_new = node_view($node, 'teaser'); $html .= drupal_render($node_view_new); } echo $html; } } ?> </div> <?php } else { ?> <?php print render($page['content']);
/** * 获取符父节点的顺序 * @author wangyuan * @param $id * @return varchar */ function getNodeList($id) { static $model = null; if (empty($model)) { $model = M('linklevel'); } $data = $model->where(['id' => $id])->find(); $show = "-><a href='" . U("YbirdsAdmin/LinkLevel/index", ['id' => $data['id']]) . "'>" . $data['name'] . "</a>"; if ($data['fid']) { $show = getNodeList($data['fid']) . $show; } else { $show = "<A HREF='" . U("YbirdsAdmin/LinkLevel/index", ['id' => 0]) . "'>返回顶级</A>" . $show; } return $show; }