예제 #1
0
파일: git.php 프로젝트: rwaldron/git-php
function html_home()
{
    global $repos, $repo_suffix;
    echo "<div class=\"git-home\">\n";
    echo "<table>\n<tr>";
    echo "<th>Project</th>";
    echo "<th>Description</th>";
    echo "<th>Owner</th>";
    echo "<th>Last Changed</th>";
    echo "<th>Download</th>";
    echo "<th>Hits</th>";
    echo "</tr>\n";
    foreach ($repos as $repo) {
        $today = 0;
        $total = 0;
        stat_get_count($repo, $today, $total);
        $desc = short_desc(file_get_contents($repo . $repo_suffix . "/description"));
        $owner = get_file_owner($repo);
        $last = get_last($repo);
        $proj = get_project_link($repo);
        $dlt = get_project_link($repo, "targz");
        $dlz = get_project_link($repo, "zip");
        echo "<tr><td>{$proj}</td><td>{$desc}</td><td>{$owner}</td><td>{$last}</td><td>{$dlt} | {$dlz}</td><td> ({$today} / {$total}) </td></tr>\n";
    }
    echo "</table>";
    echo "</div>\n";
}
예제 #2
0
function html_home($repos)
{
    $str = '';
    $str .= "<table>\n";
    $str .= "<tr><th>Project</th><th>Description</th><th>Owner</th><th>Last Changed</th><th>Download</th></tr>\n";
    foreach ($repos as $repo) {
        $desc = short_desc(file_get_contents("{$repo}/description"));
        $owner = get_file_owner($repo);
        $last = get_last($repo);
        $proj = get_project_link($repo);
        $dlt = get_project_link($repo, "targz");
        $dlz = get_project_link($repo, "zip");
        $str .= "<tr><td>{$proj}</td><td>{$desc}</td><td>{$owner}</td><td>{$last}</td><td>{$dlt} | {$dlz}</td></tr>\n";
    }
    $str .= "</table>";
    return $str;
}