当前位置: 首页>>代码示例>>PHP>>正文


PHP Tree::getIdTreeByModule方法代码示例

本文整理汇总了PHP中Tree::getIdTreeByModule方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::getIdTreeByModule方法的具体用法?PHP Tree::getIdTreeByModule怎么用?PHP Tree::getIdTreeByModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree::getIdTreeByModule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getRSS

 public static function getRSS()
 {
     $data = array();
     $id = Tree::getIdTreeByModule('news');
     $sql = 'SELECT * FROM {{tree}} WHERE parent=' . $id . ' AND visible=1 ORDER BY udate DESC LIMIT 0,10';
     $list = DB::getAll($sql);
     foreach ($list as $item) {
         $field = Fields::getFieldsByTree($item['id']);
         $data[] = array('id' => $item['id'], 'name' => trim(strip_tags($item['name'])), 'preview' => strip_tags($field['preview']), 'path' => 'http:://' . $_SERVER['HTTP_HOST'] . '/about/news/' . $item['id'] . '/', 'udate' => date("D, d M Y H:i:s O", strtotime($item['udate'])));
     }
     return array('list' => $data);
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:12,代码来源:ArticlesModel.php

示例2: ask

 function ask()
 {
     if ($_POST) {
         $tree = Tree::getIdTreeByModule('faq');
         $model = new Faq();
         if ($model->ask($tree) === true) {
             $this->redirect('/faq/thanks/');
             View::render('faq/ask', $tree);
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         $tree['rubrics'] = Faq::getRubricsTree($tree['parent']);
         View::render('faq/ask', $tree);
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:16,代码来源:FaqController.php

示例3: getRubricsTree

    public function getRubricsTree($tree)
    {
        $data = array();
        $parent = Tree::getIdTreeByModule('faq');
        $sql = '
			SELECT * FROM {{tree}}
			WHERE parent=' . $parent . ' AND visible=1 AND path<>\'ask\' AND path<>\'thanks\'
			ORDER BY num
		';
        $list = DB::getAll($sql);
        foreach ($list as $item) {
            $countAll = 0;
            if (Funcs::$uri[1] == '' || Funcs::$uri[1] == 'ask' || Funcs::$uri[1] != '' && $tree == $item['id'] && Funcs::$uri[1] != 'ask') {
                $items = Faq::getRecurs($item['id']);
                $data[] = array('id' => $item['id'], 'name' => $item['name'], 'path' => $item['path'], 'sub' => $items['sub'], 'count' => $countAll);
            }
        }
        return $data;
    }
开发者ID:sov-20-07,项目名称:billing,代码行数:19,代码来源:FeedbackModel.php

示例4: run

 function run()
 {
     $id = Tree::getIdTreeByModule('news');
     $list = News::getList($id, 5);
     View::widget('news', array('list' => $list));
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:6,代码来源:NewsWidget.php


注:本文中的Tree::getIdTreeByModule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。