Example #1
0
function fetch_children($userid, $categoryid)
{
	global $vbulletin;

	$ids = array();
	$children = $vbulletin->db->query_read("
		SELECT categoryid
		FROM " . TABLE_PREFIX . "attachmentcategory
		WHERE
			userid = $userid
				AND
			parentid = $categoryid
	");
	while ($child = $vbulletin->db->fetch_array($children))
	{
		$ids[] = $child['categoryid'];
		$ids = array_merge($ids, fetch_children($userid, $child['categoryid']));
	}

	return $ids;
}
Example #2
0
function fetch_children($userid, $categoryid)
{
    global $vbulletin;
    $ids = array();
    $children = $vbulletin->db->query_read("\r\n\t\tSELECT categoryid\r\n\t\tFROM " . TABLE_PREFIX . "attachmentcategory\r\n\t\tWHERE\r\n\t\t\tuserid = {$userid}\r\n\t\t\t\tAND\r\n\t\t\tparentid = {$categoryid}\r\n\t");
    while ($child = $vbulletin->db->fetch_array($children)) {
        $ids[] = $child['categoryid'];
        $ids = array_merge($ids, fetch_children($userid, $child['categoryid']));
    }
    return $ids;
}
Example #3
0
        if ($cell == "G") {
            echo "bgcolor=\"#2f2\">{$cell}</td>";
        } elseif ($cell == "S") {
            echo "bgcolor=\"#22f\">{$cell}</td>";
        } elseif ($cell == '1') {
            echo "bgcolor=\"#000\">{$cell}</td>";
        } else {
            echo "bgcolor=\"#fff\">{$cell}</td>";
        }
    }
    echo "</tr>";
}
echo "</table>";
//var_dump(calc_h(4,3,7,$d, $maze));
////start
//do{
fetch_children(0, 0, -1, $maze, $d, $visited);
//    array_push($visited, calc_h(0,0,-1,$d,$maze));
//
//}
//while (!$goal_reached);
//array_push($visited, calc_h(4,3,7,$d,$maze));
//array_push($visited, calc_h(4,4,8,$d,$maze));
//array_push($visited, calc_h(4,3,5,$d,$maze));
//array_push($visited, calc_h(3,3,6,$d,$maze));
//array_push($visited, calc_h(2,3,5,$d,$maze));
var_dump($visited);
?>
<script language="JavaScript">

</script>