Esempio n. 1
0
$file_keywords = $nav_title . ',';
$C[cate_hot_file] = get_cate_file($cate_id, 'file_downs');
if ($auth[pd_a]) {
    $seo = get_seo('public', $cate_id);
    if ($seo[title]) {
        eval("\$title = \"{$seo['title']}\";");
    }
    eval("\$keywords = \"{$seo['keywords']}\";");
    eval("\$description = \"{$seo['description']}\";");
}
include PHPDISK_ROOT . "./includes/header.inc.php";
if ($cate_id) {
    //面包屑
    $cur_cate = $cate_obj->getNodeById($cate_id);
    $breadcrumb = array();
    get_cate_breakcrumb($cur_cate, $breadcrumb);
    //分类数据
    $C[cate_list] = get_all_relate_cate_from_cateid($cate_id);
    //课程数据
    $course_array = get_course_from_cate($cate_id, '', $perpage);
    $course_data = $course_array['data'];
    //分页
    $page_nav = multi($course_array['total_num'], $perpage, $pg, "public.php?cate_id=" . $cate_id);
} else {
    $q = $db->query("select * from {$tpf}categories where share_index=1 order by show_order asc,cate_id asc");
    $cate_list = array();
    while ($rs = $db->fetch_array($q)) {
        $cate_list[] = $rs;
    }
    $db->free($q);
    unset($rs);
Esempio n. 2
0
function get_cate_breakcrumb($cate_obj, &$breadcrumb)
{
    $cur_cate = $cate_obj;
    $cur_cate_parent = $cur_cate->getParent();
    $cur_cate_parent_id = $cur_cate_parent->getId();
    if (!empty($cur_cate_parent_id)) {
        get_cate_breakcrumb($cur_cate_parent, $breadcrumb);
    }
    $crumb = array('name' => $cur_cate->get('cate_name'), 'url' => urr('public', 'cate_id=' . $cur_cate->get('cate_id')));
    $breadcrumb[] = $crumb;
}