本文整理汇总了PHP中Tree::getTreeByUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::getTreeByUrl方法的具体用法?PHP Tree::getTreeByUrl怎么用?PHP Tree::getTreeByUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tree
的用法示例。
在下文中一共展示了Tree::getTreeByUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
if ($_POST) {
DB::escapePost();
News::setSubscribers();
if ($_SERVER['HTTP_REFERER']) {
$this->redirect($_SERVER['HTTP_REFERER']);
} else {
$this->redirect('/media/news/');
}
} else {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
if (Funcs::$uri[2] == '') {
$tree['pic'] = $tree['fields']['files_gal1'][0]['path'];
$tree['list'] = News::getList($tree['id']);
//$tree['tags']=News::getTagList($tree['id']);
View::render('news/list', $tree);
} else {
//$tree['tags']=News::getTags($tree['id']);
$tree['next'] = News::getNext($tree['id'], $tree['parent'], $tree['udate']);
$tree['prev'] = News::getPrev($tree['id'], $tree['parent'], $tree['udate']);
if (isset($_GET['print'])) {
View::render('news/print', $tree);
} else {
View::render('news/one', $tree);
}
}
}
}
示例2: getValuesNumber
public static function getValuesNumber($path)
{
$data = array();
$tree = Tree::getTreeByUrl();
$ids[] = $tree['id'];
$ids = array_merge($ids, Tree::getChilds($tree['id']));
$sql = '
SELECT DISTINCT type FROM {{data}}
WHERE path=\'' . $path . '\' AND tree IN (' . implode(',', $ids) . ')
';
$type = DB::getOne($sql);
if ($type) {
$sql = '
SELECT MAX(' . Fields::$fieldsName[$type] . ') AS maxv, MIN(' . Fields::$fieldsName[$type] . ') AS minv FROM {{data}}
WHERE path=\'' . $path . '\' AND tree IN (' . implode(',', $ids) . ')
';
$data = DB::getRow($sql);
$data['type'] = substr($type, 0, 1);
}
if ($data['maxv'] > 0) {
return $data;
} else {
return array();
}
}
示例3: __construct
function __construct()
{
$tree = Tree::getTreeByUrl();
Funcs::setMeta($tree);
$list = Search::getResult();
View::render('site/search', array('list' => $list));
}
示例4: SubMenu
public function SubMenu()
{
$list = array();
$data = array();
if (Funcs::$uri[0] == 'about') {
$tree = Tree::getTreeByUrl('', array(Funcs::$uri[0]));
$sql = 'SELECT * FROM {{tree}} WHERE parent=' . $tree['id'] . ' AND menu=1 AND visible=1 ORDER BY num';
$data = DB::getAll($sql);
} elseif (Funcs::$uri[3] != '') {
$uri = Funcs::$uri;
unset($uri[4]);
$tree = Tree::getTreeByUrl('', $uri);
$sql = 'SELECT * FROM {{tree}} WHERE parent=' . $tree['id'] . ' AND menu=1 AND visible=1 ORDER BY num';
$data = DB::getAll($sql);
}
$num = ceil(count($data) / 2);
foreach ($data as $i => $item) {
$item['path'] = Tree::getPathToTree($item['id']);
$item['selected'] = '';
if (strpos($_SERVER['REQUEST_URI'], $item['path']) !== false) {
$item['selected'] = 'selected';
}
if ($i < $num) {
$list[0][] = $item;
} else {
$list[1][] = $item;
}
}
View::widget('menu/sub', array('list' => $list));
}
示例5: __construct
function __construct()
{
if (Funcs::$uri[1] == '') {
$tree = Tree::getTreeByUrl(Funcs::$uri[0]);
Funcs::setMeta($tree);
$tree['list'] = Compare::getCompare();
View::render('compare/list', $tree);
}
}
示例6: upload
public function upload()
{
if ($_SESSION['iuser']['id']) {
if ($_POST['act'] == 'step1') {
$model = new Upload();
$model->step1();
$this->redirect('/fotobook/upload/step2/');
} elseif ($_POST['act'] == 'step2') {
$model = new Upload();
$model->step2();
$this->redirect('/fotobook/upload/step3/');
} elseif ($_POST['act'] == 'step3') {
$model = new Upload();
$model->step3();
View::$layout = 'empty';
View::render('fotobook/upload/step3done');
} elseif ($_POST['act'] == 'step3return') {
$model = new Upload();
$model->step3return();
//$this->redirect('/fotobook/upload/step4/');
} elseif ($_POST['act'] == 'step4') {
$model = new Upload();
$data = $model->step4();
$this->redirect('/fotobook/upload/thanks/', $data);
} elseif (Funcs::$uri[2] == '') {
$this->redirect('/fotobook/upload/step1/');
} elseif (Funcs::$uri[2] == 'step1') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('fotobook/upload/step1', $tree);
} elseif (Funcs::$uri[2] == 'step2') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('fotobook/upload/step2', $tree);
} elseif (Funcs::$uri[2] == 'step3') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('fotobook/upload/step3', $tree);
} elseif (Funcs::$uri[2] == 'step3show') {
View::$layout = 'empty';
View::render('fotobook/upload/step3show');
} elseif (Funcs::$uri[2] == 'step4') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('fotobook/upload/step4', $tree);
} elseif (Funcs::$uri[2] == 'thanks') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('fotobook/upload/thanks', $tree);
}
} else {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('fotobook/upload/page', $tree);
}
}
示例7: __construct
function __construct()
{
if (Funcs::$uri[1] == '') {
$tree = Tree::getTreeByUrl(Funcs::$uri[0]);
Funcs::setMeta($tree);
$tree['list'] = Catalog::getFavorite();
//$tree['recommended']=Catalog::getRecommended();
View::render('favorite/list', $tree);
}
}
示例8: __construct
function __construct()
{
if (!in_array(Funcs::$uri[2], $this->getFuncs(__CLASS__))) {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
$tree['list'] = Faq::getList($tree['id']);
View::render('cards/index', $tree);
} elseif (!$_SESSION['iuser']) {
View::render('site/redirect', array('text' => 'Доступ запрещен', 'href' => '/services/cards/'));
}
}
示例9: message
public function message()
{
if ($_POST) {
$error = Feedback::sendMessage();
if ($error) {
View::render('faq/list', $tree);
} else {
$this->redirect('/feedback/message/?done');
}
} else {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('feedback/message', $tree);
}
}
示例10: __construct
function __construct()
{
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
if ($_POST) {
if (Online::send($tree['id'])) {
$this->redirect('/online/thanks/');
}
}
if (Funcs::$uri[1] == '') {
View::render('online/form', $tree);
} else {
View::render('site/page', $tree);
}
}
示例11: __construct
function __construct()
{
$tree = Tree::getTreeByUrl('gal');
Funcs::setMeta($tree);
if (Funcs::$uri[2] == '') {
$tree['list'] = Specials::getList($tree['id']);
View::render('specials/list', $tree);
} else {
//$parents=Tree::getParents($tree['id']);
//$parentTree=Tree::getTreeById($parents[count($parents)-3],'gal');
//$tree['pic']=$parentTree['fields']['files_gal1'][0]['path'];
$tree = Specials::getOne($tree['id']);
//$tree['tags']=Articles::getTags($tree['id']);
View::render('specials/one', $tree);
}
}
示例12: __construct
function __construct()
{
if (!in_array(Funcs::$uri[1], get_class_methods(__CLASS__))) {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
$tree['list'] = Faq::getList($tree['id']);
if ($_POST) {
$error = Faq::ask($tree['id']);
if ($error) {
View::render('faq/list', $tree);
} else {
$this->redirect('/help/faq/');
}
} else {
View::render('faq/list', $tree);
}
}
}
示例13: __construct
function __construct()
{
if ($_GET['act'] == 'del') {
Forum::del();
$this->redirect('/' . implode('/', Funcs::$uri) . '/');
}
if (Funcs::$uri[2] == '') {
$tree = Tree::getTreeByUrl('wide', array('help', 'forum'));
Funcs::setMeta($tree);
$tree['list'] = Forum::getForum();
View::render('forum/forum', $tree);
} elseif (Funcs::$uri[3] == '') {
if ($_POST) {
$error = Forum::add();
if ($error) {
$tree = Forum::getItems();
Funcs::setMeta($tree);
View::render('forum/items', $tree);
} else {
$this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/');
}
} else {
$tree = Forum::getItems();
Funcs::setMeta($tree);
View::render('forum/items', $tree);
}
} else {
if ($_POST) {
$error = Forum::add();
if ($error) {
$tree = Forum::getList();
Funcs::setMeta($tree);
View::render('forum/list', $tree);
} else {
$this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/' . Funcs::$uri[3] . '/');
}
} else {
$tree = Forum::getList();
Funcs::setMeta($tree);
View::render('forum/list', $tree);
}
}
}
示例14: __construct
function __construct()
{
if (Funcs::$uri[1] == '') {
$tree = Tree::getTreeByUrl();
Funcs::setMeta($tree);
$basket = new Basket();
$tree['order'] = $basket->getOrder();
if ($tree['order']['count'] > 0) {
/*if($_SESSION['iuser']){
$adds=$_SESSION['iuser']['options']['address'];
if($_POST['adds'])$adds=$_POST['adds'];
if(is_numeric($adds)){
$tree['reg']=Cabinet::getOneAdds($adds);
}
$tree['adds']=$adds;
}*/
$accessories = array();
$salegoods = array();
foreach ($tree['order']['goods'] as $key => $item) {
$accessories[] = Catalog::getAdditionalgood($key, 'accessories');
}
foreach ($accessories as $i => $items) {
foreach ($items as $ii => $item) {
$salegoods[] = $item['tree'];
if (key_exists($item['tree'], $tree['order']['goods'])) {
unset($accessories[$i][$ii]);
}
}
}
$tree['order']['accessories'] = $accessories;
$tree['order']['salegoods'] = $salegoods;
View::render('basket/basket', $tree);
} else {
View::render('basket/empty', $tree);
}
} elseif (count($_SESSION['goods']) == 0 && Funcs::$uri[1] != 'addtobasket' && $_SESSION['orderId'] == '' && Funcs::$uri[1] != 'addlisttobasket' && Funcs::$uri[1] != 'getneworder' && Funcs::$uri[1] != 'success' && Funcs::$uri[1] != 'fail') {
$this->redirect('/basket/');
}
}
示例15: getPrev
public static function getPrev()
{
$tree = Tree::getTreeByUrl();
$parent = ' parent=' . $tree['parent'] . ' AND ';
if ($_GET['ids']) {
$parent = ' id IN (' . $_GET['ids'] . ') AND ';
}
$sql = 'SELECT count(*) FROM {{tree}} WHERE ' . $parent . ' visible=1 AND id<>' . $tree['id'] . '';
if (DB::getOne($sql) > 0) {
$sql = '
SELECT id FROM {{tree}}
WHERE ' . $parent . ' visible=1 AND id<>' . $tree['id'] . ' AND num<=\'' . $tree['num'] . '\'
ORDER BY num
';
$id = DB::getOne($sql);
if ($id) {
return Tree::getPathToTree($id) . ($_GET['ids'] != '' ? '?ids=' . $_GET['ids'] : '');
} else {
return Video::getNext();
}
}
}