com web/php: Converted news layout to HTML5. Began standardizing dates.: include/layout.inc
| From: | Levi Morrison | Date: | Fri, 14 Mar 2014 14:54:53 +0000 |
| Subject: | com web/php: Converted news layout to HTML5. Began standardizing dates.: include/layout.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18481@lists.php.net to get a copy of this message | ||
Commit: 116fb105d69f3b23a845cde4d91e6f3f84f52076
Author: Levi Morrison <levim@php.net> Fri, 14 Mar 2014 08:54:49 -0600
Parents: f0f5afb010d793de368fac237a0c7de75957bc7a
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=116fb105d69f3b23a845cde4d91e6f3f84f52076
Log:
Converted news layout to HTML5. Began standardizing dates.
Dates formatted for human readability will be 'd M Y'; dates
formatted for computers will be RFC 3339 (or W3C).
Changed paths:
M include/layout.inc
Diff:
diff --git a/include/layout.inc b/include/layout.inc
index f6b585d..55b1144 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -456,7 +456,6 @@ function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false) {
$image = news_image($item["newsImage"]["link"],
$item["newsImage"]["content"], $item["newsImage"]["title"],
false);
}
- //$id = parse_url($item["id"], PHP_URL_FRAGMENT); 5.1.2
$id = parse_url($item["id"]);
$id = $id["fragment"];
@@ -471,10 +470,9 @@ function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false) {
$permlink = "#" .$id;
}
- // PHP4 strtotime() doesn't support RFC3339 timestamps
$published = substr($item["published"], 0, 10);
$nixtimestamp = strtotime($published);
- $newsdate = date("d-M-Y", $nixtimestamp);
+ $newsdate = date("d M Y", $nixtimestamp);
if ($onlyyear && date("Y", $nixtimestamp) != $onlyyear) {
$count--;
continue;
@@ -491,14 +489,16 @@ function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false)
{
}
echo <<< EOT
-<div class="newsItem hentry{$vevent}">
+<article class="newsItem">
+ <header>
<div class="newsImage">{$image}</div>
- <h2 class="summary entry-title"><a name="{$id}"
id="{$id}" href="{$permlink}" rel="bookmark"
class="bookmark">{$item["title"]}</a></h2>
- <div class="entry-content description">
- <abbr class="published newsdate"
title="{$item["published"]}">{$newsdate}</abbr>
- {$item["content"]}
- </div>
-</div>
+ <h2 class="newstitle"><a id="{$id}" href="{$permlink}"
rel="bookmark"
class="bookmark">{$item["title"]}</a></h2>
+ </header>
+ <time class="newsdate"
datetime="{$item["published"]}">{$newsdate}</time>
+ <div class="newscontent">
+ {$item["content"]}
+ </div>
+</article>
EOT;
}