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


PHP mslib_fe::get_subcategories_as_ul方法代码示例

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


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

示例1: substr

                $where = substr($where, 0, strlen($where) - 1);
                $where .= '&';
            }
            $where .= 'categories_id[' . $level . ']=' . $category['categories_id'];
            // get all cats to generate multilevel fake url eof
            if ($category['categories_external_url']) {
                $link = $category['categories_external_url'];
            } else {
                $link = mslib_fe::typolink($this->conf['products_listing_page_pid'], '&' . $where . '&tx_multishop_pi1[page_section]=products_listing');
            }
            $name = '<a href="' . $link . '" class="ajax_link">' . $category['categories_name'] . '</a>';
            $html = '<div class="main_category_box">' . "\n" . '
			<h2>' . $name . '</h2>' . "\n" . '</div>';
        } else {
            $name = '<span>' . $category['categories_name'] . '</span>';
            $subcats_html = mslib_fe::get_subcategories_as_ul($category['categories_id']);
            if ($subcats_html) {
                $html = '<div class="main_category_box">' . "\n" . '
				<h2>' . $name . '</h2>' . "\n";
                $html .= $subcats_html . "\n" . '
				</div>';
            }
        }
        if ($html) {
            $cols[] = $html;
        }
    }
}
$content .= '<div id="menu_category_listing">';
$delimited = ceil(count($cols) / 3);
if ($delimited < 1) {
开发者ID:bvbmedia,项目名称:multishop,代码行数:31,代码来源:menu_without_products.php

示例2: get_subcategories_as_ul

 public function get_subcategories_as_ul($parent_id = '0', &$content = '')
 {
     if (!is_numeric($parent_id)) {
         return false;
     }
     $str = $GLOBALS['TYPO3_DB']->SELECTquery('c.categories_id, cd.categories_name, c.parent_id', 'tx_multishop_categories c, tx_multishop_categories_description cd', 'c.status=1 and c.parent_id = \'' . $parent_id . '\' and c.page_uid=\'' . $this->showCatalogFromPage . '\' and cd.language_id=\'' . $this->sys_language_uid . '\' and c.categories_id = cd.categories_id', '', 'c.sort_order, cd.categories_name', '');
     $categories_query = $GLOBALS['TYPO3_DB']->sql_query($str);
     $count = $GLOBALS['TYPO3_DB']->sql_num_rows($categories_query);
     if ($count) {
         $content .= '<ul>';
         while ($categories = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($categories_query)) {
             if ($categories['categories_name']) {
                 $content .= '<li>';
                 if (mslib_fe::hasProducts($categories['categories_id'])) {
                     // get all cats to generate multilevel fake url
                     $level = 0;
                     $cats = mslib_fe::Crumbar($categories['categories_id']);
                     $cats = array_reverse($cats);
                     $where = '';
                     if (count($cats) > 0) {
                         foreach ($cats as $item) {
                             $where .= 'categories_id[' . $level . ']=' . $item['id'] . '&';
                             $level++;
                         }
                         $where = substr($where, 0, strlen($where) - 1);
                         $where .= '&';
                     }
                     $where .= 'categories_id[' . $level . ']=' . $categories['categories_id'];
                     $link = mslib_fe::typolink($this->conf['products_listing_page_pid'], '&' . $where . '&tx_multishop_pi1[page_section]=products_listing');
                     // get all cats to generate multilevel fake url eof
                     $name = '<a href="' . $link . '" class="ajax_link">' . $categories['categories_name'] . '</a>';
                 } else {
                     $name = '<span>' . $categories['categories_name'] . '</span>';
                 }
                 $content .= $name;
                 mslib_fe::get_subcategories_as_ul($categories['categories_id'], $content);
                 $content .= '</li>';
             }
         }
         $content .= '</ul>';
     }
     return $content;
 }
开发者ID:bvbmedia,项目名称:multishop,代码行数:43,代码来源:class.mslib_fe.php


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