cvs: phpweb /bin createNewsEntry
| From: | Hannes Magnusson | Date: | Wed, 19 Mar 2008 20:49:51 +0000 |
| Subject: | cvs: phpweb /bin createNewsEntry | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-1346@lists.php.net to get a copy of this message | ||
bjori Wed Mar 19 20:49:51 2008 UTC
Modified files:
/phpweb/bin createNewsEntry
Log:
- link href MUST be IRI
- xhtml ID MUST begin with a letter, not a digit
http://cvs.php.net/viewvc.cgi/phpweb/bin/createNewsEntry?r1=1.2&r2=1.3&diff_format=u
Index: phpweb/bin/createNewsEntry
diff -u phpweb/bin/createNewsEntry:1.2 phpweb/bin/createNewsEntry:1.3
--- phpweb/bin/createNewsEntry:1.2 Thu Jan 3 09:26:22 2008
+++ phpweb/bin/createNewsEntry Wed Mar 19 20:49:51 2008
@@ -1,6 +1,7 @@
#!/usr/local/bin/php
<?php
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");
+$BASE = "http://www.php.net";
function ce(DOMDocument $d, $name, $value, array $attrs = array(), DOMNode $to = null) {
if ($value) {
@@ -69,7 +70,7 @@
} while(1);
-$via = $archive = "/archive/$y.php#" .$id;
+$via = $archive = $BASE . "/archive/$y.php#id" .$id;
ce($dom, "id", "http://php.net" .$archive,
array(), $item);
ce($dom, "published", date(DATE_ATOM), array(), $item);
@@ -85,7 +86,7 @@
}
if ($conf) {
/* /conferences news item */
- $href = "/conferences/index.php";
+ $href = $BASE . "/conferences/index.php";
do {
fwrite(STDOUT, "When does the conference start/cfp end? (strtotime() compatible syntax):
");
@@ -98,7 +99,7 @@
} while(1);
$item->appendChild($dom->createElementNs("http://php.net/ns/news", "finalTeaserDate",
date("Y-m-d", $t)));
} else {
- $href = "/index.php";
+ $href = $BASE . "/index.php";
}
foreach($cat as $n) {
@@ -109,7 +110,7 @@
}
}
-ce($dom, "link", null, array("href" => "$href#$id",
"rel" => "alternate", "type" => "text/html"), $item);
+ce($dom, "link", null, array("href" => "$href#id$id",
"rel" => "alternate", "type" => "text/html"), $item);
fwrite(STDOUT, "Will a picture be accompanying this entry? ");
$yn = fgets(STDIN);