示例#1
0
文件: group.php 项目: ramsey/web-news
        case 'rdf':
            echo " <item>\n";
            echo "  <title>", format_subject($details['subject'], $charset), "</title>\n";
            echo "  <link>http://{$host}/{$group}/{$articleNumber}</link>\n";
            echo "  <description>", htmlspecialchars(format_author($details['author'], $charset), ENT_QUOTES, "UTF-8"), "</description>\n";
            echo "  <pubDate>{$date822}</pubDate>\n";
            echo " </item>\n";
            break;
        case 'html':
        default:
            echo "   <tr>\n";
            echo "    <td><a href=\"/{$group}/{$articleNumber}\">{$articleNumber}</a></td>\n";
            echo "    <td><a href=\"/{$group}/{$articleNumber}\">";
            echo format_subject($details['subject'], $charset);
            echo "</a></td>\n";
            echo "    <td vcard\">" . format_author($details['author'], $charset) . "</td>\n";
            echo "    <td align=\"center\"><tt>" . format_date($details['date']) . "</tt></td>\n";
            echo "    <td align=\"right\">{$details['lines']}</td>\n";
            echo "   </tr>\n";
    }
}
switch ($format) {
    case 'rss':
        echo " </channel>\n</rss>\n";
        break;
    case 'rdf':
        echo "</rdf:RDF>\n";
        break;
    case 'html':
    default:
        echo "  </table>\n";
示例#2
0
文件: commit.php 项目: schipa/viewgit
            <td><?php 
echo $page['author_datetime'];
?>
</td>
        </tr>
        <tr>
            <td>Author local date</td>
            <td><?php 
echo $page['author_datetime_local'];
?>
</td>
        </tr>
        <tr>
            <td>Committer</td>
            <td><?php 
echo format_author($page['committer_name']);
?>
 &lt;<?php 
echo htmlentities_wrapper($page['committer_mail']);
?>
&gt;</td>
        </tr>
        <tr>
            <td>Committer date</td>
            <td><?php 
echo $page['committer_datetime'];
?>
</td>
        </tr>
        <tr>
            <td>Committer local date</td>
示例#3
0
文件: blob.php 项目: schipa/viewgit
echo htmlentities_wrapper($page['path']);
?>
: <a href="<?php 
echo makelink(array('a' => 'commit', 'p' => $page['project'], 'h' => $page['lastlog']['h']));
?>
"><?php 
echo htmlentities_wrapper($page['lastlog']['h']);
?>
</a></h2>
<h1><?php 
echo htmlentities_wrapper($page['lastlog']['message_firstline']);
?>
</h1>
<div class="authorinfo">
    <?php 
echo format_author($page['lastlog']['author_name']);
echo ' [' . $page['lastlog']['author_datetime'] . ']';
?>
</div>
<div class="commitmessage">
    <pre>
        <?php 
echo htmlentities_wrapper($page['lastlog']['message_full']);
?>
    </pre>
</div>
<div class="file">
    <?php 
if (isset($page['html_data'])) {
    echo $page['html_data'];
} else {
示例#4
0
	<td><?php 
print_unescaped($_['page']['author_datetime']);
?>
</td>
</tr>
<tr>
	<td>Author local date</td>
	<td><?php 
p($_['page']['author_datetime_local']);
?>
</td>
</tr>
<tr>
	<td>Committer</td>
	<td><?php 
print_unescaped(format_author($_['page']['committer_name']));
?>
 &lt;<?php 
print_unescaped(htmlentities_wrapper($_['page']['committer_mail']));
?>
&gt;</td>
</tr>
<tr>
	<td>Committer date</td>
	<td><?php 
p($_['page']['committer_datetime']);
?>
</td>
</tr>
<tr>
	<td>Committer local date</td>
示例#5
0
function start_article($mail, $refsResolved)
{
    echo "  <blockquote>\n";
    echo '   <table border="0" cellpadding="2" cellspacing="2" width="100%">' . "\n";
    # from
    echo '    <tr class="vcard">' . "\n";
    echo '     <td class="headerlabel">From:</td>' . "\n";
    echo '     <td class="headervalue">' . format_author($mail['headers']['from']['raw'], 'utf-8') . "</td>\n";
    # date
    echo '     <td class="headerlabel">Date:</td>' . "\n";
    echo '     <td class="headervalue">' . format_date($mail['headers']['date']) . "</td>\n";
    echo "    </tr>\n";
    # subject
    echo '    <tr>' . "\n";
    echo '     <td class="headerlabel">Subject:</td>' . "\n";
    echo '     <td class="headervalue" colspan="3">' . format_subject($mail['headers']['subject'], 'utf-8') . "</td>\n";
    echo "    </tr>\n";
    echo "    <tr>\n";
    # references
    if (!empty($refsResolved)) {
        echo '     <td class="headerlabel">References:</td>' . "\n";
        echo '     <td class="headervalue">';
        foreach ($refsResolved as $k => $ref) {
            echo "<a href=\"/" . urlencode($ref['group']) . '/' . urlencode($ref['articleId']) . "\">" . ($k + 1) . "</a>&nbsp;";
        }
        echo "</td>\n";
    }
    # groups
    if (!empty($mail['headers']['newsgroups'])) {
        echo '     <td class="headerlabel">Groups:</td>' . "\n";
        echo '     <td class="headervalue">';
        $r = explode(",", rtrim($mail['headers']['newsgroups']));
        while (list($k, $v) = each($r)) {
            echo "<a href=\"/" . urlencode($v) . "\">" . htmlspecialchars($v) . "</a>&nbsp;";
        }
        echo "</td>\n";
    }
    echo "    </tr>\n";
    echo "   </table>\n";
    echo "  </blockquote>\n";
    echo "  <blockquote>\n";
    echo "   <pre>\n";
}
示例#6
0
function start_article($group, $headers, $charset)
{
    echo "  <blockquote>\n";
    echo '   <table border="0" cellpadding="2" cellspacing="2" width="100%">' . "\n";
    # from
    echo '    <tr class="vcard">' . "\n";
    echo '     <td class="headerlabel">From:</td>' . "\n";
    echo '     <td class="headervalue">' . format_author($headers['from'], $charset) . "</td>\n";
    # date
    echo '     <td class="headerlabel">Date:</td>' . "\n";
    echo '     <td class="headervalue">' . format_date($headers["date"]) . "</td>\n";
    echo "    </tr>\n";
    # subject
    echo '    <tr>' . "\n";
    echo '     <td class="headerlabel">Subject:</td>' . "\n";
    echo '     <td class="headervalue" colspan="3">' . format_subject($headers["subject"], $charset) . "</td>\n";
    echo "    </tr>\n";
    echo "    <tr>\n";
    # references
    if (!empty($headers['references']) || !empty($headers['in-reply-to'])) {
        $ref = $headers["references"] ? $headers["references"] : $headers["in-reply-to"];
        echo '     <td class="headerlabel">References:</td>' . "\n";
        echo '     <td class="headervalue">';
        $r = explode(" ", $ref);
        $c = 1;
        $s = nntp_connect(NNTP_HOST) or die("failed to connect to news server");
        while (list($k, $v) = each($r)) {
            if (!$v) {
                continue;
            }
            $v = trim($v);
            if (!preg_match("/^<.+>\$/", $v)) {
                continue;
            }
            if (strlen($v) > 504) {
                // 512 chars including CRLF
                continue;
            }
            $res2 = nntp_cmd($s, "XPATH {$v}", 223) or print "<!-- failed to get reference article id " . htmlspecialchars($v, ENT_QUOTES, "UTF-8") . " -->";
            list(, $v) = split("/", trim($res2));
            if (empty($v)) {
                continue;
            }
            echo "<a href=\"/{$group}/" . urlencode($v) . "\">" . $c++ . "</a>&nbsp;";
            if ($c > REFERENCES_LIMIT) {
                printf('More than %d references', REFERENCES_LIMIT);
                break;
            }
        }
        echo "</td>\n";
    }
    # groups
    if ($headers["newsgroups"]) {
        echo '     <td class="headerlabel">Groups:</td>' . "\n";
        echo '     <td class="headervalue">';
        $r = explode(",", chop($headers["newsgroups"]));
        while (list($k, $v) = each($r)) {
            echo "<a href=\"/" . urlencode($v) . "\">" . htmlspecialchars($v) . "</a>&nbsp;";
        }
        echo "</td>\n";
    }
    echo "    </tr>\n";
    //while (list($k,$v) = each($headers)) {
    //  echo "<!-- ", htmlspecialchars($k),": ",preg_replace("/-+/", "-", htmlspecialchars($v))," -->\n";
    //}
    echo "   </table>\n";
    echo "  </blockquote>\n";
    echo "  <blockquote>\n";
    echo "   <pre>\n";
}
示例#7
0
    <thead>
        <tr>
            <th class="date">Date</th>
            <th class="author">Author</th>
            <th class="message">Message</th>
            <th class="actions">Actions</th>
        </tr>
    </thead>
    <tbody>
        <?php 
$page['lasthash'] = 'HEAD';
foreach ($page['shortlog'] as $l) {
    $tr_class = $tr_class == 'odd' ? 'even' : 'odd';
    echo "<tr class=\"{$tr_class}\">\n";
    echo "\t<td>{$l['date']}</td>\n";
    echo "\t<td>" . format_author($l['author']) . "</td>\n";
    echo "\t<td><a href=\"" . makelink(array('a' => 'commit', 'p' => $page['project'], 'h' => $l['commit_id'])) . "\">" . htmlentities_wrapper($l['message']) . '</a>';
    if (count($l['refs']) > 0) {
        foreach ($l['refs'] as $ref) {
            $parts = explode('/', $ref);
            $shortref = join('/', array_slice($parts, 1));
            $type = 'head';
            if ($parts[0] == 'tags') {
                $type = 'tag';
            } elseif ($parts[0] == 'remotes') {
                $type = 'remote';
            }
            echo "<span class=\"label {$type}\" title=\"{$ref}\">" . htmlentities_wrapper($shortref) . '</span>';
        }
    }
    echo "</td>\n";
示例#8
0
<h1><?php 
echo htmlentities_wrapper($page['message_firstline']);
?>
</h1>

<div class="authorinfo">
<?php 
echo format_author($page['author_name']);
echo ' [' . $page['author_datetime'] . ']';
?>
</div>

<div class="commitmessage">
<pre>
<?php 
echo htmlentities_wrapper($page['message_full']);
?>
</pre>
</div>

<div class="filelist">
<table>
<thead>
<tr>
	<th>Filename</th>
<?php 
/*
	<th>Links</th>
*/
?>
</tr>
示例#9
0
			<a href="<?php 
    print_unescaped(makelink(array('a' => 'patch', 'p' => $_['page']['project'], 'h' => $l['commit_id'])));
    ?>
" class="patch_link button" title="Patch">Patch</a>
		</div>
		<a class="message" href="<?php 
    print_unescaped(makelink(array('a' => 'commit', 'p' => $_['page']['project'], 'h' => $l['commit_id'])));
    ?>
">
			<?php 
    print_unescaped(htmlentities_wrapper($l['message']));
    ?>
		</a>
		<span class="author shady">
			By <?php 
    print_unescaped(format_author($l['author']));
    ?>
 on <?php 
    p($l[date]);
    ?>
		</span>
		<?php 
    if (count($l['refs']) > 0) {
        ?>
			<div class="refs shady">
			<?php 
        foreach ($l['refs'] as $ref) {
            $parts = explode('/', $ref);
            $shortref = join('/', array_slice($parts, 1));
            $type = 'head';
            if ($parts[0] == 'tags') {
示例#10
0
<h1><?php 
print_unescaped(htmlentities_wrapper($_['page']['message_firstline']));
?>
</h1>

<div class="authorinfo">
<?php 
print_unescaped(format_author($_['page']['author_name']));
print_unescaped(' [' . $_['page']['author_datetime'] . ']');
?>
</div>

<div class="commitmessage">
<pre>
<?php 
print_unescaped(htmlentities_wrapper($_['page']['message_full']));
?>
</pre>
</div>

<div class="filelist">
<table id="filelist">
<thead>
<tr>
	<th>Filename</th>
</tr>
</thead>
<tbody>
<?php 
// pathname | patch | blob | history
foreach ($_['page']['files'] as $file => $url) {
示例#11
0
文件: group.php 项目: adduc/web-news
        case 'rdf':
            echo " <item>\n";
            echo "  <title>", format_subject($subj, $charset), "</title>\n";
            echo "  <link>http://{$host}/{$group}/{$n}</link>\n";
            echo "  <description>", htmlspecialchars(format_author($author, $charset), ENT_QUOTES, "UTF-8"), "</description>\n";
            echo "  <pubDate>{$date822}</pubDate>\n";
            echo " </item>\n";
            break;
        case 'html':
        default:
            echo "   <tr>\n";
            echo "    <td><a href=\"/{$group}/{$n}\">{$n}</a></td>\n";
            echo "    <td><a href=\"/{$group}/{$n}\">";
            echo format_subject($subj, $charset);
            echo "</a></td>\n";
            echo "    <td vcard\">" . format_author($author, $charset) . "</td>\n";
            echo "    <td align=\"center\"><tt>" . format_date($odate) . "</tt></td>\n";
            echo "    <td align=\"right\">{$lines}</td>\n";
            echo "   </tr>\n";
    }
}
switch ($format) {
    case 'rss':
        echo " </channel>\n</rss>\n";
        break;
    case 'rdf':
        echo "</rdf:RDF>\n";
        break;
    case 'html':
    default:
        echo "  </table>\n";