本文整理汇总了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) {
示例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;
}