• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tep_get_parent_categories函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tep_get_parent_categories函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_get_parent_categories函数的具体用法?PHP tep_get_parent_categories怎么用?PHP tep_get_parent_categories使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: tep_get_parent_categories

 function tep_get_parent_categories(&$categories, $categories_id)
 {
     $parent_categories_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int) $categories_id . "'");
     while ($parent_categories = tep_db_fetch_array($parent_categories_query)) {
         if ($parent_categories['parent_id'] == 0) {
             return true;
         }
         $categories[sizeof($categories)] = $parent_categories['parent_id'];
         if ($parent_categories['parent_id'] != $categories_id) {
             tep_get_parent_categories($categories, $parent_categories['parent_id']);
         }
     }
 }
开发者ID:rabbit-source,项目名称:setbook.ru,代码行数:13,代码来源:orders.php


示例2: osC_CategoryTree

 function osC_CategoryTree($load_from_database = true)
 {
     global $languages_id;
     $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int) $languages_id . "' order by c.parent_id, c.sort_order, cd.categories_name");
     $this->data = array();
     while ($categories = tep_db_fetch_array($categories_query)) {
         // Ultimate SEO URLs compatibility - Chemo
         # initialize array container
         $c = array();
         # Get the category path, $c is passed by reference
         tep_get_parent_categories($c, $categories['categories_id']);
         # For some reason it seems to return in reverse order so reverse the array
         $c = array_reverse($c);
         # Implode the array to get the full category path
         $id = implode('_', $c) ? implode('_', $c) . '_' . $categories['categories_id'] : $categories['categories_id'];
         $this->data[$categories['parent_id']][$id] = array('name' => $categories['categories_name'], 'count' => 0);
     }
 }
开发者ID:eosc,项目名称:EosC-2.3,代码行数:18,代码来源:category_tree.php


示例3: tep_get_product_path

function tep_get_product_path($products_id)
{
    $cPath = '';
    $category_query = tep_db_query("select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int) $products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id limit 1");
    if (tep_db_num_rows($category_query)) {
        $category = tep_db_fetch_array($category_query);
        $categories = array();
        tep_get_parent_categories($categories, $category['categories_id']);
        $categories = array_reverse($categories);
        $cPath = implode('_', $categories);
        if (tep_not_null($cPath)) {
            $cPath .= '_';
        }
        $cPath .= $category['categories_id'];
    }
    return $cPath;
}
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:17,代码来源:general.php


示例4: get_category_path

 private function get_category_path($category_id)
 {
     if (tep_not_null($category_id)) {
         $cPath_new = '';
         $categories = array();
         // Initialize the array so the function doesn't complain
         tep_get_parent_categories($categories, $category_id);
         $categories = array_reverse($categories);
         $cPath_new .= implode('_', $categories);
         if (tep_not_null($cPath_new)) {
             $cPath_new .= '_';
         }
         $cPath_new .= $category_id;
         return 'cPath=' . $cPath_new;
     }
     return false;
 }
开发者ID:templatemonster,项目名称:oscommerce,代码行数:17,代码来源:bm_categories_superfish.php


示例5: tep_get_product_path

function tep_get_product_path($products_id)
{
    $OSCOM_Db = Registry::get('Db');
    $cPath = '';
    $Qcategory = $OSCOM_Db->prepare('select p2c.categories_id from :table_products p, :table_products_to_categories p2c where p.products_id = :products_id and p.products_status = 1 and p.products_id = p2c.products_id limit 1');
    $Qcategory->bindInt(':products_id', $products_id);
    $Qcategory->execute();
    if ($Qcategory->fetch() !== false) {
        $categories = array();
        tep_get_parent_categories($categories, $Qcategory->valueInt('categories_id'));
        $categories = array_reverse($categories);
        $cPath = implode('_', $categories);
        if (tep_not_null($cPath)) {
            $cPath .= '_';
        }
        $cPath .= $Qcategory->valueInt('categories_id');
    }
    return $cPath;
}
开发者ID:Akofelaz,项目名称:oscommerce2,代码行数:19,代码来源:general.php


示例6: tep_get_product_path

function tep_get_product_path($products_id)
{
    global $osC_Database;
    $cPath = '';
    $Qcategory = $osC_Database->query('select p2c.categories_id from :table_products p, :table_products_to_categories p2c where p.products_id = :products_id and p.products_status = :products_status and p.products_id = p2c.products_id limit 1');
    $Qcategory->bindTable(':table_products', TABLE_PRODUCTS);
    $Qcategory->bindTable(':table_products_to_categories', TABLE_PRODUCTS_TO_CATEGORIES);
    $Qcategory->bindInt(':products_id', $products_id);
    $Qcategory->bindInt(':products_status', 1);
    $Qcategory->execute();
    if ($Qcategory->numberOfRows()) {
        $categories = array();
        tep_get_parent_categories($categories, $Qcategory->valueInt('categories_id'));
        $categories = array_reverse($categories);
        $cPath = implode('_', $categories);
        if (tep_not_null($cPath)) {
            $cPath .= '_';
        }
        $cPath .= $Qcategory->valueInt('categories_id');
    }
    return $cPath;
}
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:22,代码来源:general.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tep_get_path函数代码示例发布时间:2022-05-23
下一篇:
PHP tep_get_languages函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap