cvs: php-news-web / article.php
| From: | Jacques Marneweck | Date: | Wed, 04 Aug 2004 20:49:27 +0000 |
| Subject: | cvs: php-news-web / article.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-25680@lists.php.net to get a copy of this message | ||
jacques Wed Aug 4 16:49:27 2004 EDT
Modified files:
/php-news-web article.php
Log:
Fix the references links in articles which are being viewed. Also don't
display references to articles colobus does not know about.
http://cvs.php.net/diff.php/php-news-web/article.php?r1=1.25&r2=1.26&ty=u
Index: php-news-web/article.php
diff -u php-news-web/article.php:1.25 php-news-web/article.php:1.26
--- php-news-web/article.php:1.25 Mon Jun 28 09:11:26 2004
+++ php-news-web/article.php Wed Aug 4 16:49:27 2004
@@ -171,10 +171,16 @@
echo '<td class="headerlabel">References:</td><td
class="headervalue">';
$r = explode(" ", $ref);
$c = 1;
+ $s = nntp_connect("news.php.net")
+ 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;
+ $res2 = nntp_cmd($s, "XPATH $v",223)
+ or die("failed to get reference article id ".htmlspecialchars($v));
+ list(,$v) = split("/", trim($res2));
+ if (empty($v)) continue;
echo "<a
href=\"/$group/".htmlspecialchars(urlencode($v))."\">".($c++)."</a>\n";
}
echo "</td>\n";