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


PHP Shop::getParent方法代码示例

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


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

示例1: unset

     } else {
         $order = 'ORDER BY sort_order ASC';
     }
     unset($url[$n]);
     unset($current_url_pages[count($current_url_pages) - 1]);
 }
 $smarty->assign("dir", $dirs);
 for ($f = 0; $f < count($cat_list); $f++) {
     $url_to_check = implode("/", $url) . '/';
     if ($cat_list[$f]['full_url'] == $url_to_check) {
         $cat_content = $cat_list[$f];
         $page_found = true;
         //находим родителя уровня 1
         if (!in_array($cat_content['id'], array(TIRES_ID, DISK_ID))) {
             //$parent = $db->get_single("SELECT id FROM fw_catalogue WHERE param_left < '{$cat_content['param_left']}' and param_right > '{$cat_content['param_right']}' and param_level = '1'");
             $parent = $shop->getParent($cat_content);
         } else {
             $parent = $cat_content;
         }
         if ($cat_content['param_level'] > 2) {
             $parent2 = $db->get_single("SELECT id FROM fw_catalogue WHERE param_left < '{$cat_content['param_left']}' and param_right > '{$cat_content['param_right']}' and param_level = '2'");
         } elseif ($cat_content['param_level'] == 2) {
             $parent2 = $cat_content;
         }
         $smarty->assign('parent', $parent);
         if (isset($parent2)) {
             $smarty->assign('parent2', $parent2);
         }
         if ($cat_content['title'] != '') {
             $page_title = $cat_content['title'];
         } else {
开发者ID:askovorodka,项目名称:sqc,代码行数:31,代码来源:shop.f_main.php

示例2: implode

 if (!$page_found) {
     if (preg_match("/^([0-9]+)\$/", $url[$n])) {
         $product_content = $shop->getProductInfo(intval($url[$n]));
         if ($product_content['id'] != '') {
             for ($f = 0; $f < count($cat_list); $f++) {
                 $url_to_check = implode("/", $url) . '/';
                 if ($cat_list[$f]['full_url'] == '/') {
                     $cat_list[$f]['full_url'] = '';
                 }
                 if ($cat_list[$f]['full_url'] . $product_content['id'] . '/' == $url_to_check && $product_content['parent'] == $cat_list[$f]['id']) {
                     foreach ($cat_list as $key => $val) {
                         if ($val['param_left'] < $cat_list[$f]['param_left'] && $val['param_right'] > $cat_list[$f]['param_right'] && $val['param_level'] == $cat_list[$f]['param_level'] - 1) {
                             $cat_parent_info = $val;
                             $smarty->assign('cat_parent_info', $cat_parent_info);
                             $smarty->assign('cat_content', $cat_list[$f]);
                             $cat_parent = $shop->getParent($cat_parent_info);
                             $smarty->assign('parent', $cat_parent);
                         }
                     }
                     $page_found = true;
                     if ($product_content['title'] != '') {
                         $page_title = $product_content['title'];
                     } else {
                         $page_title = 'Продукция ' . $product_content['name'];
                     }
                     if ($product_content['meta_keywords'] != '') {
                         $meta_keywords = $product_content['meta_keywords'];
                     } else {
                         $meta_keywords = $page_title;
                     }
                     if ($product_content['meta_description'] != '') {
开发者ID:askovorodka,项目名称:sqc,代码行数:31,代码来源:shop.f_main.php


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