本文整理汇总了PHP中get_parent函数的典型用法代码示例。如果您正苦于以下问题:PHP get_parent函数的具体用法?PHP get_parent怎么用?PHP get_parent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_parent函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: return_parent
function return_parent()
{
return get_parent(false);
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:4,代码来源:theme_functions.php
示例2: breadcrumb_arrays
function breadcrumb_arrays($index, $id)
{
$crumb =& $crumb;
if (isset($index[get_parent($index, $id)])) {
$_name = dbarray(dbquery("SELECT weblink_cat_id, weblink_cat_name, weblink_cat_parent FROM " . DB_WEBLINK_CATS . " WHERE weblink_cat_id='" . $id . "'"));
$crumb = array('link' => INFUSIONS . "weblinks/weblinks.php?cat_id=" . $_name['weblink_cat_id'], 'title' => $_name['weblink_cat_name']);
if (isset($index[get_parent($index, $id)])) {
if (get_parent($index, $id) == 0) {
return $crumb;
}
$crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
$crumb = array_merge_recursive($crumb, $crumb_1);
// convert so can comply to Fusion Tab API.
}
}
return $crumb;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:17,代码来源:weblinks.php
示例3: return_parent
/**
* @depreciated as of 2.04
*/
function return_parent()
{
return get_parent(FALSE);
}
开发者ID:Foltys,项目名称:Masopust,代码行数:7,代码来源:theme_functions.php
示例4: get_parent
function get_parent($parent)
{
global $datefmt, $tblprefix, $strBorn, $strDied, $restrictdate, $level, $err_father, $err_mother, $grid, $strLivingPerson, $countlines, $outputstring, $htmlstring, $gridsize;
$peep = new PersonDetail();
$peep->person_id = $parent;
$peep->queryType = Q_IND;
$dao = getPeopleDAO();
$dao->getPersonDetails($peep);
// check if there is a parent
if ($peep->numResults != 1) {
return;
} else {
$per = $peep->results[0];
}
$level += 1;
// ---- position father
$fhtmlstring = "<div style=\"position: absolute; left: " . a2p($level) . "px;\">";
$fhtmlstring .= "(" . $level . ") ";
$nextfather = $per->father->person_id;
$nextmother = $per->mother->person_id;
if ($nextfather != 0) {
get_parent($nextfather);
}
$fhtmlstring .= $per->getFullLink();
$fhtmlstring .= "</div> \n";
// ---- grid lines
if ($level > 0) {
for ($y = 1; $y <= $level - 1; $y += 1) {
if ($grid[$y] != 0) {
$fhtmlstring .= "<img alt=\"\" src=\"images/point.gif\" height=\"16\" width=\"1\" style=\"position: absolute; left: " . (a2p($y - 1) + 7) . "px;\" border=\"0\">\n";
}
}
$fhtmlstring .= "<img alt=\"\" src=\"images/point-";
if ($per->gender == "M") {
$fhtmlstring .= "m";
$grid[$level] = 1;
} else {
$fhtmlstring .= "f";
$grid[$level] = 0;
}
$fhtmlstring .= ".gif\" height=\"16\" width=\"" . ($gridsize - 9) . "\" style=\"position: absolute; left: " . (a2p($y - 1) + 7) . "px;\" border=\"0\">\n";
}
// ---- end grid lines
$fhtmlstring .= "<br> \n";
$outputstring[] = $fhtmlstring;
$countlines += 1;
if ($nextmother != 0) {
$grid[$level + 1] = 1;
get_parent($nextmother);
} else {
$grid[$level + 1] = 0;
}
$level -= 1;
// end get parents
}
开发者ID:redbugz,项目名称:rootstech2013,代码行数:55,代码来源:ancestors.php
示例5: bootstrap_get_breadcrumbs
/**
* bootstrap_get_breadcrumbs()
*
* This creates the list for breadcrumbs to the current page. Requires
* i18n Navigation plugin for full breadcrumbs list else it creates
* a list with only Home / %parent% / %child%
* This function support the following plugins:
* - i18n Navigation (Supported but doesn't format well unless modified)
* - SimpleBreadcrumbs v1.0+ (Preferred)
*
* @return (string) : String containing HTML <ul> list of breadcrumb data
*/
function bootstrap_get_breadcrumbs()
{
if (function_exists('get_breadcrumbs')) {
# SimpleBreadcrumbs v1.0+
get_breadcrumbs(return_page_slug());
} elseif (!function_exists('get_i18n_breadcrumbs')) {
# i18n Navigation plugin
echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
echo '<li class="current">';
get_i18n_breadcrumbs(return_page_slug());
echo '</li>';
} else {
# No supported plugins found!
$parent = (string) get_parent(FALSE);
echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
if (!empty($parent) && $parent != 'index') {
$file = GSDATAPAGESPATH . $parent . '.xml';
if (file_exists($file)) {
$p = getXML($file);
$p_title = $p->title;
$p_slug = $p->slug;
echo '<li><a href="' . find_url($parent, '') . '">' . $p_title . '</a></li>';
}
}
echo '<li class="active">' . get_page_clean_title(FALSE) . '</li>';
}
}
开发者ID:hatasu,项目名称:appdroid,代码行数:39,代码来源:functions.php
示例6: get_data
function get_data()
{
if (!in_the_loop()) {
return;
}
return ['type' => get_type(), 'parent' => get_parent(), 'categories' => get_categories(), 'tags' => get_tags(), 'taxonomies' => get_taxonomies(), 'author' => get_author(), 'published' => date_published(), 'updated' => date_updated()];
}
开发者ID:synapticism,项目名称:ubik,代码行数:7,代码来源:meta.php
示例7: array
|--------------------|
*/
$equal_search = array('category_active_status', 'category_visibility_status');
$default_sort_by = "category_order";
$pgdata = page_init($equal_search, $default_sort_by);
// static/general.php
$page = $pgdata['page'];
$query_per_page = $pgdata['query_per_page'];
$sort_by = $pgdata['sort_by'];
$first_record = $pgdata['first_record'];
$search_parameter = $pgdata['search_parameter'];
$search_value = $pgdata['search_value'];
$search_query = $pgdata['search_query'];
$search = $pgdata['search'];
$parent_id = $_REQUEST['cid'];
$parent = get_parent($parent_id);
$full_order = count_category($parent['relation_level'] + 1, $parent_id, $search_query, $sort_by, $query_per_page);
$total_query = $full_order['total_query'];
$total_page = ceil($full_order['total_query'] / $query_per_page);
// CALL FUNCTION
$listing_order = get_categories($parent['relation_level'] + 1, $parent_id, $search_query, $sort_by, $first_record, $query_per_page);
// HANDLING ARROW SORTING
if ($_REQUEST['srt'] == "category_name DESC") {
$arr_order_number = "<span class=\"sort-arrow-up\"></span>";
} else {
if ($_REQUEST['srt'] == "category_name") {
$arr_order_number = "<span class=\"sort-arrow-down\"></span>";
} else {
$arr_order_number = "<span class=\"sort-arrow-down\"></span>";
}
}
开发者ID:nickyudha,项目名称:spalosophy,代码行数:31,代码来源:control.php
示例8: get_subtasks
//.........这里部分代码省略.........
//if ($type!="complete") echo "<th><a href=".get_order_url('T.Progress',$dir).">Work</a></th>";
echo "<th> </th>";
echo "<th><a href=" . get_order_url('T.Priority', $dir) . ">Severity</a></th>";
echo "<th><a href=" . get_order_url('T.Task_ID', $dir) . ">ID</a></th>";
echo "<th><a href=" . get_order_url('Task_Name', $dir) . ">Task</a></th>";
echo "<th><a href=" . get_order_url('Project_Name', $dir) . ">Project</a></th>";
echo "<th><a href=" . get_order_url('Affected_Department_Name', $dir) . ">Department</a></th>";
echo "<th>File</th>";
echo "<th><a href=" . get_order_url('Username', $dir) . ">Assigned</a></th>";
echo "<th>Last</th>";
echo "<th><a href=" . get_order_url('Request_Username', $dir) . ">Request</a></th>";
echo "<th nowrap><a href=" . get_order_url('T.Request_Date', $dir) . ">Req Date</a></th>";
if ($type == "complete") {
echo "<th><a href=" . get_order_url('L.Log_Date', $dir) . ">Completed</a></th>";
} else {
echo "<th><a href=" . get_order_url('T.Finish_Date', $dir) . ">Due</a></th>";
}
if ($type != "complete") {
echo "<th>Days</th>";
}
echo "</tr>\n";
}
$space = str_repeat(' ', $level);
$ptid = 0;
for ($t = 0; $t < count($subtasks); $t++) {
$total_tasks[$priorities[$subtasks[$t]['Priority']]['Name']]++;
if ($type != "option" and $type != "complete" and (is_null($parent) or $parent === 0) and $subtasks[$t]['Parent_Task_ID'] > 0 and $subtasks[$t]['Parent_Task_ID'] != $ptid) {
$ptid = $subtasks[$t]['Parent_Task_ID'];
echo "<tr {$bg} class=\"gray\">";
echo "<td> </td>";
echo "<td> </td>";
echo "<td> </td>";
echo "<td colspan=\"10\"><small>";
get_parent($ptid, true);
echo "</small></td>";
echo "</tr>\n";
} else {
$ptid = $subtasks[$t]['Parent_Task_ID'];
}
$small_img = $use_file = "";
$expand = false;
if ($preview == true or !$_SESSION['expand'] or $_SESSION['expand']['all'] == 1 and (!isset($_SESSION['expand'][$subtasks[$t]['Task_ID']]) or $_SESSION['expand'][$subtasks[$t]['Task_ID']] != 0) or $_SESSION['expand']['all'] == 0 and $_SESSION['expand'][$subtasks[$t]['Task_ID']] == 1) {
$expand = true;
}
if ($type == "option") {
echo "<option value=\"" . $subtasks[$t]['Task_ID'] . "\"";
if ($subtasks[$t]['Task_ID'] == $parent_task_id) {
echo " selected";
}
echo ">" . $space . $subtasks[$t]['Task_Name'] . "</option>\n";
} else {
$num_sub = 0;
$percent_sub = $subtasks[$t]['Progress'];
if ($type == "complete") {
$finish_date = $subtasks[$t]['Log_Date'];
} else {
$finish_date = $subtasks[$t]['Finish_Date'];
}
//if (!is_null($parent))
list($num_sub, $percent_sub, $finish_date) = get_percent($subtasks[$t]['Task_ID'], $num_sub, $percent_sub, $finish_date);
//$finish_date=$subtasks[$t]['Finish_Date'];
//if ($subtasks[$t]['Log_Date']) $finish_date=$subtasks[$t]['Log_Date'];
//if ($level==0) {
// if ($t%2==0) $bg="class=\"highlight\"";
// else $bg="";
//}
开发者ID:sketchings,项目名称:task-refactor,代码行数:67,代码来源:tasks.php
示例9: forum_breadcrumb_arrays
function forum_breadcrumb_arrays($index, $id, &$crumb = false)
{
if (isset($index[get_parent($index, $id)])) {
$_name = dbarray(dbquery("SELECT forum_id, forum_name, forum_cat, forum_branch FROM " . DB_FORUMS . " WHERE forum_id='" . $id . "'"));
$crumb = array('link' => INFUSIONS . "forum/index.php?viewforum&forum_id=" . $_name['forum_id'] . "&parent_id=" . $_name['forum_cat'], 'title' => $_name['forum_name']);
if (isset($index[get_parent($index, $id)])) {
if (get_parent($index, $id) == 0) {
return $crumb;
}
$crumb_1 = forum_breadcrumb_arrays($index, get_parent($index, $id));
$crumb = array_merge_recursive($crumb, $crumb_1);
// convert so can comply to Fusion Tab API.
}
}
return $crumb;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:16,代码来源:server.php
示例10: breadcrumb_page_arrays
function breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, $id)
{
$crumb =& $crumb;
if (isset($tree_index[get_parent($tree_index, $id)])) {
$_name = get_parent_array($tree_full, $id);
$crumb = array('link' => isset($_name[$id_col]) ? clean_request($getname . "=" . $_name[$id_col], array("aid"), TRUE) : "", 'title' => isset($_name[$title_col]) ? \PHPFusion\QuantumFields::parse_label($_name[$title_col]) : "");
if (get_parent($tree_index, $id) == 0) {
return $crumb;
}
$crumb_1 = breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, get_parent($tree_index, $id));
if (!empty($crumb_1)) {
$crumb = array_merge_recursive($crumb, $crumb_1);
}
}
return $crumb;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:16,代码来源:core_functions_include.php
示例11: breadcrumb_arrays
function breadcrumb_arrays($index, $id)
{
global $aidlink;
$crumb =& $crumb;
//$crumb += $crumb;
if (isset($index[get_parent($index, $id)])) {
$_name = dbarray(dbquery("SELECT link_id, link_name FROM " . DB_SITE_LINKS . " WHERE link_id='" . $id . "'"));
$crumb = array('link' => FUSION_SELF . $aidlink . "&link_cat=" . $_name['link_id'], 'title' => $_name['link_name']);
if (isset($index[get_parent($index, $id)])) {
if (get_parent($index, $id) == 0) {
return $crumb;
}
$crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
$crumb = array_merge_recursive($crumb, $crumb_1);
// convert so can comply to Fusion Tab API.
}
}
return $crumb;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:19,代码来源:site_links.php
示例12: do_notify
function do_notify($user, $request, $method = NULL)
{
$notify = array("from" => $user->id);
if ($method != NULL) {
// notification due to POST, PUT or DELETE
$resource = $request;
$notify = array("notify" => $method, "resource" => $resource, "type" => NULL, "entity" => NULL);
if ($method == "PUT" || $method == "POST") {
$result = mysql_query(sprintf("SELECT type, entity FROM resource WHERE rid='%s'", mysql_real_escape_string($resource)));
if (!$result) {
say("failed to get this resource");
return array('code' => 'failed', 'reason' => 'failed to get this resource');
}
$result_count = mysql_numrows($result);
if ($result_count) {
$row = mysql_fetch_row($result);
$notify["type"] = $row[0];
$notify["entity"] = json_decode($row[1]);
}
//mysql_freeresult($result);
}
// TODO: also send to parent resource
} else {
// end to end notify from one client to others
$notify = array("notify" => "NOTIFY", "resource" => $request["resource"], "data" => $request["data"], "from" => $user->id);
}
$param = json_encode($notify);
$param = str_replace("\\/", "/", $param);
$result = mysql_query(sprintf("SELECT cid FROM subscribe WHERE rid='%s'", mysql_real_escape_string($notify["resource"])));
if (!$result) {
say("failed to get this resource subscribers");
return array('code' => 'failed', 'reason' => 'failed to get this resource subscribers');
}
$result_count = mysql_numrows($result);
$sent_count = 0;
for ($j = 0; $j < $result_count; ++$j) {
$row = mysql_fetch_row($result);
$target = getuserbyid($row[0]);
if ($target == null) {
say("invalid user for " . $row[0]);
} else {
send($target, $param);
++$sent_count;
}
}
//mysql_freeresult($result);
if ($method == "POST" || $method == "PUT" || $method == "DELETE") {
$parent = get_parent($notify["resource"]);
$change = array("notify" => "UPDATE", "resource" => $parent, "type" => $notify["type"], "entity" => $notify["entity"]);
$child = $notify["resource"];
$index = strrpos($child, "/");
if ($index) {
$child = substr($child, $index + 1);
}
if ($method == "POST") {
$change["create"] = $child;
} else {
if ($method == "PUT") {
$change["update"] = $child;
} else {
if ($method == "DELETE") {
$change["delete"] = $child;
}
}
}
$result = mysql_query(sprintf("SELECT cid FROM subscribe WHERE rid='%s'", mysql_real_escape_string($parent)));
$result_count = mysql_numrows($result);
$param = json_encode($change);
// JSON specified escapting / but we don't accept that in Javascript
$param = str_replace("\\/", "/", $param);
say("change=" . $change . " param=" . $param);
for ($k = 0; $k < $result_count; ++$k) {
$row = mysql_fetch_row($result);
$target = getuserbyid($row[0]);
if ($target == null) {
say("invalid user for " . $row[0]);
} else {
send($target, $param);
++$sent_count;
}
++$sent_count;
}
//mysql_freeresult($result);
}
if ($sent_count == 0) {
say('notify could not send to anyone');
return array('code' => 'failed', 'reason' => 'no available user to send notification to');
}
say('notify sent to ' . count($sent_count) . ' items');
return array('code' => 'success', 'sent_count' => $sent_count);
}
开发者ID:ravijoshi0791,项目名称:vvowproject,代码行数:91,代码来源:restserver.php
示例13: get_comment_ancestor_set
function get_comment_ancestor_set($commentid)
{
$parentcomment = get_parent($commentid);
if ($parentcomment) {
$anc = get_comment_ancestor_set($parentcomment);
$anc[$commentid] = true;
} else {
$anc = array($commentid => true);
}
return $anc;
}
开发者ID:qiemem,项目名称:GovDialogue,代码行数:11,代码来源:commentmanagement.php
示例14: breadcrumb_arrays
function breadcrumb_arrays($index, $id)
{
global $aidlink;
$crumb = array('link' => array(), 'title' => array());
if (isset($index[get_parent($index, $id)])) {
$_name = dbarray(dbquery("SELECT forum_id, forum_name FROM " . DB_FORUMS . " WHERE forum_id='" . intval($id) . "'"));
$crumb = array('link' => array(FUSION_SELF . $aidlink . "&parent_id=" . $_name['forum_id']), 'title' => array($_name['forum_name']));
if (isset($index[get_parent($index, $id)])) {
if (get_parent($index, $id) == 0) {
return $crumb;
}
$crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
$crumb = array_merge_recursive($crumb, $crumb_1);
// convert so can comply to Fusion Tab API.
}
}
return $crumb;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:18,代码来源:view.php
示例15: str_replace
$replace = '<span class="jump" onclick="read_details(\'ikdoc\',\'' . $value . '\',\'D\',\'D\')">' . $_SESSION[$ssid]['MT']['ikdoc']->convertBBCodetoHTML($rowl['value']) . '</span>';
} else {
$replace = '<span class="jump" onclick="read_details(\'ikdoc\',\'' . $value . '\',\'D\',\'D\')">' . $out[2][$key] . '</span>';
}
$row["DETAILS"] = str_replace($out[0][$key], $replace, $row["DETAILS"]);
}
//==================================================================
//==================================================================
// Build path string
//==================================================================
$id = $id_item;
$tab_to_root = array();
$current = get_parent($ssid, $tree_id, $language, $link, $id);
while ($current[1] != '') {
array_unshift($tab_to_root, array($current[0], $current[1], $current[2]));
$current = get_parent($ssid, $tree_id, $language, $link, $current[1]);
}
$preference = '<div id="boutton_preference" class="boutton_preference" onClick="active_expand_tools_bar()" onmouseout="lib_hover(\'\')" onmouseover="lib_hover(\'' . js_protect($_SESSION[$ssid]['page_text'][3]['LT']) . '\')"></div>';
$path_to_root = $preference . '<div class="home_path" onclick="read_details(\'ikdoc\',\'1\',\'D\',\'D\')" onmouseout="lib_hover(\'\')" onmouseover="lib_hover(\'' . js_protect($_SESSION[$ssid]['page_text'][4]['LT']) . '\')"></div> : ';
$separator = '';
while (list($parent, $value) = each($tab_to_root)) {
//==================================================================
// Manage BBCode is setup on
//==================================================================
$value[2] = htmlentities($value[2], ENT_QUOTES);
if ($_SESSION[$ssid]['MT']['ikdoc']->use_bbcode) {
$value[2] = $_SESSION[$ssid]['MT']['ikdoc']->convertBBCodetoHTML($value[2]);
}
//==================================================================
//$value[2] = $value[2].'!';
$path_to_root = $path_to_root . '<span class="mouse" onclick="read_details(\'' . $tree_id . '\',\'' . $value[0] . '\',\'' . $mode . '\',\'D\')">' . $value[2] . '</span>' . $separator;
开发者ID:bubaigcect,项目名称:magictree,代码行数:31,代码来源:display_html.php
示例16: get_parent
function get_parent($value, $id = '')
{
if ($value != 0) {
$sql = 'SELECT parent_id FROM ' . $GLOBALS['ecs']->table('category') . " WHERE cat_id = '{$value}'";
$res = $GLOBALS['db']->getOne($sql);
return get_parent($res, $value);
} else {
return $id;
}
}
开发者ID:seanguo166,项目名称:yinoos,代码行数:10,代码来源:category.php
示例17: breadcrumb_arrays
function breadcrumb_arrays($index, $id)
{
$crumb =& $crumb;
if (isset($index[get_parent($index, $id)])) {
$_name = dbarray(dbquery("SELECT article_cat_id, article_cat_name, article_cat_parent FROM " . DB_ARTICLE_CATS . " " . (multilang_table("AR") ? "WHERE article_cat_language='" . LANGUAGE . "' and " : "where ") . "\n\t\t\t\tarticle_cat_id='" . intval($id) . "'"));
$crumb = array('link' => INFUSIONS . "articles/articles.php?cat_id=" . $_name['article_cat_id'], 'title' => $_name['article_cat_name']);
if (isset($index[get_parent($index, $id)])) {
if (get_parent($index, $id) == 0) {
return $crumb;
}
$crumb_1 = breadcrumb_arrays($index, get_parent($index, $id));
$crumb = array_merge_recursive($crumb, $crumb_1);
// convert so can comply to Fusion Tab API.
}
}
return $crumb;
}
开发者ID:php-fusion,项目名称:PHP-Fusion,代码行数:17,代码来源:articles.php
示例18: get_navigation
<?php
get_navigation(get_page_slug(FALSE));
?>
</ul>
</nav>
</div>
</div>
<!-- breadcrumbs: only show when NOT on homepage -->
<p class="breadcrumbs" >
<span class="wrapper">
<a href="<?php
get_site_url();
?>
">Home</a> • <?php
Innovation_Parent_Link(get_parent(FALSE));
?>
<b><?php
get_page_clean_title();
?>
</b>
</span>
</p>
</header>
<div id="site">
<div id="header-wrapper">
<div id="top-header-wrapper">
<div id="top-nav">
<p>hola </p>
</div><!--top-nav-->
开发者ID:Emmett-Brown,项目名称:linea,代码行数:31,代码来源:header.inc+(copia).php
示例19: get_parent
<?php
include '../view/header.php';
require_once '../model/database.php';
require_once '../model/parents_db.php';
$results = get_parent();
?>
<div class="">
<ul class="breadcrumb">
<li><a href="index.php">Home</a> <span class="divider">/</span></li>
<li class="active">Parents</li>
</ul>
<table class="table table-condensed table-bordered table-striped">
<tr>
<th>Parent ID</th>
<th>Student ID</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
<?php
foreach ($results as $parent) {
?>
<tr>
<td><?php
echo $parent['parent_id'];
?>
</td>
<td><?php
echo $parent['s_id'];
开发者ID:rcruzmcd,项目名称:GradingAssist,代码行数:31,代码来源:mparents.php
注:本文中的get_parent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论