本文整理匯總了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;