num_rows > 0) { while ($row = $result->fetch_assoc()) $knot_rows[$row["id"]] = $row["file"]. " (line ".$row["line"].") #".$row["id"].":\\n". str_replace("\"","\\\"",$row["description"]); $knots=""; foreach ($knot_rows as $knot) $knots=$knots . "\"" . $knot . "\";\n"; } $result = mysql_run_query( "SELECT DISTINCT " . "`todo_links`.`dependent`," . "`todo_links`.`depending_on` " . "FROM `todo_links`;" ); if ($result -> num_rows > 0) { $count = 0; while ($row = $result->fetch_assoc()) { $link_rows[$count]["dependent"] = $knot_rows[$row["dependent"]]; $link_rows[$count]["depending_on"] = $knot_rows[$row["depending_on"]]; $count++; } $edges=""; foreach ($link_rows as $link) $edges=$edges . "\"" . $link["depending_on"] . "\" -> \"" . $link["dependent"] . "\";\n"; } header ("Content-type: image/png"); passthru( "echo \"" . base64_encode( "digraph dependencies {\n" . "rankdir=LR;\n" . "fontname=dejavu;\n" . $knots . $edges . "}\n" ) . "\" | " . "base64 -d | " . "timeout 30 dot -Tpng -o/dev/stdout /dev/stdin" ); } else { // array_key_exists("graph", $_GET) if ($result -> num_rows > 0) { print "\n"; print "
\n"; print "