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


PHP GDSRHelper::get_categories_hierarchy方法代码示例

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


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

示例1: init_categories_data

 function init_categories_data()
 {
     $all_cats = GDSRDatabase::get_all_categories();
     $categories = GDSRHelper::get_categories_hierarchy($all_cats);
     $ids_array = $items = array();
     foreach ($categories as $cat) {
         $items[$cat->term_id] = $cat->parent;
         $ids_array[] = $cat->term_id;
     }
     GDSRDatabase::add_category_defaults("(" . join(", ", $ids_array) . ")", $ids_array, $items);
 }
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:11,代码来源:main.php

示例2: get_categories_hierarchy

 function get_categories_hierarchy($cats, $depth = 0, $level = 0)
 {
     $h = array();
     foreach ($cats as $cat) {
         if ($cat->parent == $level) {
             $cat->depth = $depth;
             $h[] = $cat;
             $recats = GDSRHelper::get_categories_hierarchy($cats, $depth + 1, $cat->term_id);
             $h = array_merge($h, $recats);
         }
     }
     return $h;
 }
开发者ID:sangpena,项目名称:appflex.mobi,代码行数:13,代码来源:elements.php

示例3: array

    $page_id = $_GET["pg"];
}
if (isset($_POST["gdsr_update"]) && $_POST["gdsr_update"] == __("Update", "gd-star-rating")) {
    $gdsr_items = $_POST["gdsr_item"];
    if (count($gdsr_items) > 0) {
        $items = $ids = array();
        foreach ($gdsr_items as $it) {
            $parts = explode(",", $it);
            $ids[] = $parts[1];
            $items[$parts[1]] = $parts[0];
        }
        gdsrAdmDB::update_category_settings("(" . join(", ", $gdsr_items) . ")", $ids, $items, $_POST["gdsr_article_moderation"], $_POST["gdsr_article_voterules"], $_POST["gdsr_comments_moderation"], $_POST["gdsr_comments_voterules"], $_POST["gdsr_integration_mur"], $_POST["gdsr_integration_active_std"], $_POST["gdsr_integration_active_mur"]);
    }
}
$all_cats = GDSRDatabase::get_all_categories();
$categories = GDSRHelper::get_categories_hierarchy($all_cats);
$number_posts = count($categories);
$max_page = floor($number_posts / $posts_per_page);
if ($max_page * $posts_per_page != $number_posts) {
    $max_page++;
}
$pager = $max_page > 1 ? gdFunctionsGDSR::draw_pager($max_page, $page_id, $url, "pg") : "";
$cat_from = ($page_id - 1) * $posts_per_page;
$cat_to = $page_id * $posts_per_page;
if ($cat_to > $number_posts) {
    $cat_to = $number_posts;
}
?>

<div class="wrap">
<form id="gdsr-articles" method="post" action="">
开发者ID:TheReaCompany,项目名称:pooplog,代码行数:31,代码来源:categories.php


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