本文整理汇总了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 . '&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 . '&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 . '&category_id=' . $object->category_id . '">' . $object->category . '</a> ';
}
}
//check if user is allowed to update the content
$allow_content_update = false;
示例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 . '&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 . '&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 . '&category_id=' . $object->category_id . '">' . $object->category . '</a> ';
}
}
//check if user is allowed to update the content
$allow_content_update = false;