Repaso de árbol genalógico

git-svn-id: https://192.168.0.254/svn/Proyectos.DoubleRGroup_Web/trunk@6 9702d7ca-3799-984c-9d87-892b02c0b615
This commit is contained in:
roberto 2014-03-10 18:19:46 +00:00
parent 62e8e1ebb3
commit 480d7c3ea2

View File

@ -44,108 +44,203 @@ function drg_horse_family_tree($atts, $content = null) {
$html .= '<span class="label">' . get_the_title() . '</span>'; $html .= '<span class="label">' . get_the_title() . '</span>';
// Padres // Padres
$html .= '<div class="branch lv1">'; $valorPadre = get_post_meta(get_the_ID(), 'drg_horse_father', true);
$valorMadre = get_post_meta(get_the_ID(), 'drg_horse_mother', true);
if (!empty($valorPadre) || !empty($valorMadre)) {
$html .= '<div class="branch lv1">';
// Padre // Padre, si no tiene no sacamos nada más de sus predecesores
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_father', true) . '</span>'; if (!empty($valorPadre)){
// Abuelos paternos $html .= '<div class="entry';
$html .= '<div class="branch lv2">'; if (empty($valorMadre))
$html .= ' sole"><span class="label">&#9794;&nbsp;' .$valorPadre . '</span>';
else
$html .= '"><span class="label">&#9794;&nbsp;' .$valorPadre . '</span>';
// Abuelo paterno // Abuelos paternos
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandfather', true) . '</span>'; $valorAbuelo = get_post_meta(get_the_ID(), 'drg_horse_paternal_grandfather', true);
$valorAbuela = get_post_meta(get_the_ID(), 'drg_horse_paternal_grandmother', true);
if (!empty($valorAbuelo) || !empty($valorAbuela)) {
$html .= '<div class="branch lv2">';
// Bisabuelos paternos (1) // Abuelo paterno
// $html .= '<div class="branch lv3">'; if (!empty($valorAbuelo)){
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_1', true) . '</span></div>'; $html .= '<div class="entry';
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_1', true) . '</span></div>'; if (!empty($valorAbuela))
// $html .= '</div>'; $html .= '"><span class="label">&#9794;&nbsp;' . $valorAbuelo . '</span>';
else
$html .= ' sole"><span class="label">&#9794;&nbsp;' . $valorAbuelo . '</span>';
$html .= '</div>'; // Abuelo paterno // Bisabuelos paternos (1)
$valorBisAbuelo = get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_1', true);
$valorBisAbuela = get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_1', true);
if (!empty($valorBisAbuelo) || !empty($valorBisAbuela)) {
$html .= '<div class="branch lv3">';
// Abuela paterna //BisAbuelo paterno 1
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandmother', true) . '</span>'; if (!empty($valorBisAbuelo)){
$html .= '<div class="entry';
if (!empty($valorBisAbuela))
$html .= '"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
else
$html .= ' sole"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
}
// Bisabuelos paternos (2) //BisAbuela paterno 1
// $html .= '<div class="branch lv3">'; if (!empty($valorBisAbuela)){
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_2', true) . '</span></div>'; $html .= '<div class="entry';
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_2', true) . '</span></div>'; if (!empty($valorBisAbuelo))
// $html .= '</div>'; $html .= '"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
else
$html .= ' sole"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
}
$html .= '</div>'; //BisAbuelos paterno
}
$html .= '</div>'; // Abuela paterna $html .= '</div>'; // Abuelos paterno
}
$html .= '</div>'; // Abuelos paternos // Abuela paterna
$html .= '</div>'; // Padre if (!empty($valorAbuela)){
$html .= '<div class="entry';
if (!empty($valorAbuelo))
$html .= '"><span class="label">&#9792&nbsp;' . $valorAbuela . '</span>';
else
$html .= ' sole"><span class="label">&#9792&nbsp;' . $valorAbuela . '</span>';
// Madre // Bisabuelos paternos (2)
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_mother', true) . '</span>'; $valorBisAbuelo = get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_2', true);
// Abuelos maternos $valorBisAbuela = get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_2', true);
$html .= '<div class="branch lv2">'; if (!empty($valorBisAbuelo) || !empty($valorBisAbuela)) {
$html .= '<div class="branch lv3">';
// Abuelo materno //BisAbuelo paterno 2
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandfather', true) . '</span>'; if (!empty($valorBisAbuelo)){
$html .= '<div class="entry';
if (!empty($valorBisAbuela))
$html .= '"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
else
$html .= ' sole"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
}
// Bisabuelos paternos (1) //BisAbuela paterno 2
// $html .= '<div class="branch lv3">'; if (!empty($valorBisAbuela)){
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_1', true) . '</span></div>'; $html .= '<div class="entry';
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_1', true) . '</span></div>'; if (!empty($valorBisAbuelo))
// $html .= '</div>'; $html .= '"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
else
$html .= ' sole"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
}
$html .= '</div>'; //BisAbuelos paternos
}
$html .= '</div>'; // Abuelo materno $html .= '</div>'; // Abuela paterna
}
$html .= '</div>'; // Abuelos paternos
}
// Abuela paterna $html .= '</div>'; // Padre
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandmother', true) . '</span>'; }
// Bisabuelos naternos (2) // Madre, si no tiene no sacamos nada más de sus predecesores
// $html .= '<div class="branch lv3">'; if (!empty($valorMadre)) {
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_2', true) . '</span></div>'; $html .= '<div class="entry';
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_2', true) . '</span></div>'; if (empty($valorPadre))
// $html .= '</div>'; $html .= ' sole"><span class="label">&#9792&nbsp;' .$valorMadre . '</span>';
else
$html .= '"><span class="label">&#9792&nbsp;' .$valorMadre . '</span>';
$html .= '</div>'; // Abuela paterna // Abuelos maternos
$valorAbuelo = get_post_meta(get_the_ID(), 'drg_horse_maternal_grandfather', true);
$valorAbuela = get_post_meta(get_the_ID(), 'drg_horse_maternal_grandmother', true);
if (!empty($valorAbuelo) || !empty($valorAbuela)) {
$html .= '<div class="branch lv2">';
$html .= '</div>'; // Abuelos maternos // Abuelo materno
$html .= '</div>'; // Madre if (!empty($valorAbuelo)){
$html .= '<div class="entry';
if (!empty($valorAbuela))
$html .= '"><span class="label">&#9794;&nbsp;' . $valorAbuelo . '</span>';
else
$html .= ' sole"><span class="label">&#9794;&nbsp;' . $valorAbuelo . '</span>';
/*$html .= '<ul>'; // Bisabuelos maternos (1)
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_1', true) . '</a></li>'; $valorBisAbuelo = get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_1', true);
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_1', true) . '</a></li>'; $valorBisAbuela = get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_1', true);
$html .= '</ul>'; if (!empty($valorBisAbuelo) || !empty($valorBisAbuela)) {
$html .= '</li>'; $html .= '<div class="branch lv3">';
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandmother', true) . '</a>'; //BisAbuelo paterno 1
// Bisabuelos paternos (2) if (!empty($valorBisAbuelo)){
$html .= '<ul>'; $html .= '<div class="entry';
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_2', true) . '</a></li>'; if (!empty($valorBisAbuela))
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_2', true) . '</a></li>'; $html .= '"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
$html .= '</ul>'; else
$html .= '</li>'; $html .= ' sole"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
$html .= '</ul>'; }
$html .= '</li>';
// Madre //BisAbuela paterno 1
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_mother', true) . '</a>'; if (!empty($valorBisAbuela)){
// Abuelos paternos $html .= '<div class="entry';
$html .= '<ul>'; if (!empty($valorBisAbuelo))
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandfather', true) . '</a>'; $html .= '"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
// Bisabuelos paternos (1) else
$html .= '<ul>'; $html .= ' sole"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_1', true) . '</a></li>'; }
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_1', true) . '</a></li>';
$html .= '</ul>';
$html .= '</li>';
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandmother', true) . '</a>'; $html .= '</div>'; //BisAbuelos materno
// Bisabuelos paternos (2) }
$html .= '<ul>';
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_2', true) . '</a></li>'; $html .= '</div>'; // Abuelo materno
$html .= '<li><a href="">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_2', true) . '</a></li>'; }
$html .= '</ul>';
$html .= '</li>'; // Abuela materno
$html .= '</ul>'; if (!empty($valorAbuela)){
$html .= '</li>'; */ $html .= '<div class="entry';
if (!empty($valorAbuelo))
$html .= '"><span class="label">&#9792&nbsp;' . $valorAbuela . '</span>';
else
$html .= ' sole"><span class="label">&#9792&nbsp;' . $valorAbuela . '</span>';
// Bisabuelos maternos (2)
$valorPadre = get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_2', true);
$valorMadre = get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_2', true);
if (!empty($valorPadre) || !empty($valorMadre)) {
$html .= '<div class="branch lv3">';
//BisAbuelo materno 2
if (!empty($valorBisAbuelo)){
$html .= '<div class="entry';
if (!empty($valorBisAbuela))
$html .= '"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
else
$html .= ' sole"><span class="label">&#9794;&nbsp;' . $valorBisAbuelo . '</span></div>';
}
//BisAbuela materna 2
if (!empty($valorBisAbuela)){
$html .= '<div class="entry';
if (!empty($valorBisAbuelo))
$html .= '"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
else
$html .= ' sole"><span class="label">&#9792&nbsp;' . $valorBisAbuela . '</span></div>';
}
$html .= '</div>'; //BisAbuelos maternos
}
$html .= '</div>'; // Abuela materna
}
$html .= '</div>'; // Abuelos maternos
}
$html .= '</div>'; // Madre
}
$html .= '</div>'; // .branch lv1
}
endwhile; endwhile;
$html .= '</div>'; // .branch lv1
$html .= '</div>'; // .horse-tree $html .= '</div>'; // .horse-tree
wp_reset_query(); wp_reset_query();
return $html; return $html;