Ejemplo n.º 1
0
 public static function getparent($root)
 {
     global $db;
     $result = '';
     if (!$db->Query("SELECT * from page where parent=" . $root)) {
         $db->Kill('Error1');
     }
     while (!$db->EndOfSeek()) {
         $row = $db->Row();
         $result .= '<li><a href="#">' . $row->titrfr . '</a>';
         $result .= getchild($row->id);
     }
     return $result;
 }
Ejemplo n.º 2
0
function breakfree_child($array, $a)
{
    if (count($array) != 0) {
        $_GET[$a][] = $array;
    }
    foreach ($array as $u1) {
        //LIMIT CONDITION
        if (count($_GET[$a]) == 6) {
            break;
        }
        //html here
        $user1 = getchild($u1);
        if (count($user1) != 0) {
            breakfree_child($user1, $a);
        }
    }
}
Ejemplo n.º 3
0
function getwife($id)
{
    global $db;
    $finalarray = array();
    $row = $db->get("select * from member where id in (select related_to from member where id={$id})");
    $obj = array();
    // Space Tree Object if he has a wife
    if ($row) {
        $obj = createstruct($row);
        $obj['children'] = getchild($id);
        array_push($finalarray, $obj);
        return $finalarray;
    } else {
        return NULL;
    }
}
Ejemplo n.º 4
0
include "../include/function.php";
include "../include/rank.php";
header("Content-Type: text/html; charset=utf-8");
$sql = "select * from {$db_prefix}users where id='" . $hyid . "'";
$rs = $db->get_one($sql);
$hyname = $rs["username"];
$sql = "select * from {$db_prefix}users where prename='" . $hyname . "'";
$result = $db->query($sql);
$rstulnum = $db->num_rows($result);
$i = 0;
while ($rs = $db->fetch_array($result)) {
    $i++;
    echo '  <div>
  ';
    echo str_repeat('<img border=0  src="treeimgs/tree_line.gif" />', $dpth);
    $chdbit = getchild($rs["username"]);
    if ($chdbit) {
        echo '<a href="#img_' . $rs["id"] . '" onclick="gxtex(' . $rs["id"] . ',' . ($dpth + 1) . ');">';
        echo $i == $rstulnum ? '<img border=0 id="img_' . $rs["id"] . '" src="treeimgs/tree_plusl.gif" />' : '<img border=0 id="img_' . $rs["id"] . '" src="treeimgs/tree_plus.gif" />';
        echo "</a>";
    } else {
        echo $i == $rstulnum ? '<img border=0 id="img_' . $rs["id"] . '" src="treeimgs/tree_blankl.gif" />' : '<img border=0 id="img_' . $rs["id"] . '" src="treeimgs/tree_blank.gif" />';
    }
    echo '';
    echo $rs["username"];
    echo ' [第';
    echo $dpth + 2;
    echo '层] [';
    echo getuserrank($rs["rank"]);
    echo ']  [注册日期:';
    echo date("Y-m-d", $rs["regtime"]);
Ejemplo n.º 5
0
function get_tree($pid, $arr, $num, $cats_old_zhyh)
{
    global $catstr;
    $child = getchild($pid, $arr);
    if (is_array($child)) {
        $total = count($child);
        foreach ($child as $id => $sa) {
            $pstr = '';
            for ($i = 0; $i <= $num; $i++) {
                $pstr = $pstr . ($num ? '&nbsp;&nbsp;&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;');
            }
            $children = array();
            $zhyhcount = 0;
            $children = getchild($id, $arr);
            $zhyhcount = count($children);
            if ($zhyhcount == 0) {
                if (@in_array($id, $cats_old_zhyh)) {
                    $selected_zhyh = " checked";
                } else {
                    $selected_zhyh = " ";
                }
                $zhyh = '<input type="checkbox" class="nfl" name="supplier_cat_id[]" id="supplier_cat_id" value="' . $id . '" ' . $selected_zhyh . '>';
            } else {
                $zhyh = '';
            }
            $catstr = $catstr . $pstr . $zhyh . $sa['name'] . "  <br>";
            $num++;
            get_tree($sa['id'], $arr, $num, $cats_old_zhyh);
            $num--;
        }
    } else {
        return;
    }
}
Ejemplo n.º 6
0
	<!-- single grape end -->

	<!-- the title of wine start -->
	<section class="container">
		<h4><?php 
the_title();
?>
</h4>
	</section>
	<!-- the title of wine end -->

	<!-- wine products start -->
	<section class="container mar">
		<div class="product">
			<?php 
$a = getchild(the_category_ID($echo));
foreach ($a as $v) {
    $v->cat_ID;
}
?>
     		<?php 
$wines = new WP_Query('category__in=' . $v->cat_ID);
if ($wines->have_posts()) {
    while ($wines->have_posts()) {
        $wines->the_post();
        ?>
			<div class="wines clearfix">
				<div class="wines_img">
					<?php 
        the_post_thumbnail('wine-thumbnail');
        ?>