$email, "email" => ""); if (preg_match("|([^\<]*)<([^>]*)>|", $email, $m)) { $ret["name"] = trim($m[1]); $ret["email"] = trim($m[2]); } return $ret; } function print_changeset($row) { $author = parse_email($row["author"]); $gid = md5($author["email"]); $avatar = (USE_SSL ? "https://secure.gravatar.com" : "http://www.gravatar.com") . "/avatar/$gid?r=x&d=mm&s=48"; print ' Avatar
' . htmlspecialchars($author["name"]) . ' ' . htmlspecialchars($row["hash"]) . ' ' . htmlspecialchars($row["time"]). ' (' . Layout::since(strtotime($row["time"])) . ' ago)
' . htmlspecialchars($row["message"]) . '
'; } function sort_by_date($a, $b) { if ($a["time"] < $b["time"]) { return 1; } else if ($a["time"] > $b["time"]) { return -1; } return 0; } function print_changes($current, $next) { global $DB; $revs = array(); if (!($res = $DB->query(kl_str_sql("select revisions from changes where build<=!i and build>!i order by build desc", $current->nr, $next->nr)))) { return; } else { while ($row = $DB->fetchRow($res)) { $revs = array_merge($revs, explode(",", $row["revisions"])); } } if ($res = $DB->query("select * from revs where hash in ('" . implode("','", $revs) . "')")) { print ''; $changesets = array(); while ($row = $DB->fetchRow($res)) { $changesets[] = $row; } usort($changesets, "sort_by_date"); foreach ($changesets as $change) { print_changeset($change); } print '
'; } } Function print_build($current, $next, $buildNr) { print " nr}\">Build " . htmlspecialchars($current->nr). " " . htmlspecialchars($current->modified). " (" . Layout::since(strtotime($current->modified)) . " ago) " . htmlspecialchars($current->chan). " Windows Installer \"Download\"/   Build Log "; if ($next) { print ' ' . ($buildNr ? 'Hide changes <<' : 'Show changes >>') . '
'; print_changes($current, $next); print "
"; } } Layout::header(); $chan = "SingularityAlpha"; $pageSize = 20; $builds = array(); $buildNr = 0; $where = ""; if (isset($_GET["build_id"])) { $buildNr = (int)$_GET["build_id"]; $pageSize = 1; $where = kl_str_sql(" and nr <= !i ", $buildNr); } if ($res = $DB->query(kl_str_sql("select * from builds where chan=!s $where order by nr desc limit !i", $chan, $pageSize + 1))) { while ($row = $DB->fetchRow($res)) { $build = new stdClass; $DB->loadFromDbRow($build, $res, $row); $builds[] = $build; } } $nrBuilds = count($builds); if ($nrBuilds) { print ''; for ($i = 0; $i < $pageSize; $i++) { if (!isset($builds[$i])) continue; print_build($builds[$i], $builds[$i + 1], $buildNr); } print '
'; } Layout::footer(); /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */