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


PHP content::find_childs_of_parent_id方法代码示例

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


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

示例1: id

<?php

//$dont_check_login = true;
//require_once('../content.inc');
/*category id is defaulted from $_GET where as $categories comes from main_functions. $categories contains an object
which contains all the categories of the opened content / document. Where as category id ('ll be one of the values
of categories ) is used show all the releant contents */
//$content_type = content_type::find_by_content_type($content_type_name);
$childs_of_parent_id_array = content::find_childs_of_parent_id($content->content_id);
if ($childs_of_parent_id_array && count($childs_of_parent_id_array) > 0) {
    $childs_of_parent_id = "<ul>";
    foreach ($childs_of_parent_id_array as $child_content) {
        $childs_of_parent_id .= '<li><a href="' . HOME_URL . 'content.php?content_type=' . $content_type_name . '&amp;content_id=' . $child_content->content_id . '"   
               class="content_subject"> ' . $child_content->subject . ' </a></li>';
    }
    $childs_of_parent_id .= "</ul>";
}
if (!empty($content->parent_id)) {
    $parent_content = content::find_by_id($content->parent_id);
    $parent_of_content = '<a href="' . HOME_URL . 'content.php?content_type=' . $content_type_name . '&amp;content_id=' . $parent_content->content_id . '"   
               class="content_subject"> ' . $parent_content->subject . ' </a>';
}
//end of parent & child details
if (!empty($category)) {
    $category_statement = "";
    foreach ($category as $object) {
        $category_statement .= '<a href="' . HOME_URL . 'content.php?content_type=' . $content_type_name . '&amp;category_id=' . $object->category_id . '">' . $object->category . '</a> &nbsp; &nbsp; ';
    }
}
//check if user is allowed to update the content
$allow_content_update = false;
开发者ID:moxymokaya,项目名称:inoERP,代码行数:31,代码来源:content_view.php

示例2: id

<?php

//$dont_check_login = true;
//require_once('../content.inc');
/*category id is defaulted from $_GET where as $categories comes from main_functions. $categories contains an object
which contains all the categories of the opened content / document. Where as category id ('ll be one of the values
of categories ) is used show all the releant contents */
//$content_type = content_type::find_by_content_type($content_type_name);
$childs_of_parent_id_array = content::find_childs_of_parent_id(${$class}->content_id);
if ($childs_of_parent_id_array && count($childs_of_parent_id_array) > 0) {
    $childs_of_parent_id = "<ul>";
    foreach ($childs_of_parent_id_array as $child_content) {
        $childs_of_parent_id .= '<li><a href="' . HOME_URL . 'content.php?content_type=' . $content_type_name . '&amp;content_id=' . $child_content->content_id . '"   
               class="content_subject"> ' . $child_content->subject . ' </a></li>';
    }
    $childs_of_parent_id .= "</ul>";
}
if (!empty($content->parent_id)) {
    $parent_content = content::find_by_id($content->parent_id);
    $parent_of_content = '<a href="' . HOME_URL . 'content.php?content_type=' . $content_type_name . '&amp;content_id=' . $parent_content->content_id . '"   
               class="content_subject"> ' . $parent_content->subject . ' </a>';
}
//end of parent & child details
if (!empty($category)) {
    $category_statement = "";
    foreach ($category as $object) {
        $category_statement .= '<a href="' . HOME_URL . 'content.php?content_type=' . $content_type_name . '&amp;category_id=' . $object->category_id . '">' . $object->category . '</a> &nbsp; &nbsp; ';
    }
}
//check if user is allowed to update the content
$allow_content_update = false;
开发者ID:noikiy,项目名称:inoERP,代码行数:31,代码来源:content_view.php


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