com web/php: Added recent news to the homepage and removed it from the sidebar.: include/layout.inc index-beta.php styles/home.css styles/theme.css
views/homepage/sidebar.php

From: Date: Tue, 19 Jun 2012 02:29:17 +0000
Subject: com web/php: Added recent news to the homepage and removed it from the sidebar.: include/layout.inc index-beta.php styles/home.css styles/theme.css
views/homepage/sidebar.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-13727@lists.php.net to get a copy of this message
Commit: e93f30d59ceb4e1b896d8deab51d61fe170b086a Author: Levi Morrison <levim@php.net> Mon, 18 Jun 2012 20:29:17 -0600 Parents: d1125b5922758799c2e9b0391baed53ba42b8f41 Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=e93f30d59ceb4e1b896d8deab51d61fe170b086a Log: Added recent news to the homepage and removed it from the sidebar. Changed paths: M include/layout.inc M index-beta.php M styles/home.css M styles/theme.css M views/homepage/sidebar.php Diff: diff --git a/include/layout.inc b/include/layout.inc index c108bf5..3f59e8b 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -789,15 +789,13 @@ function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false) { echo <<< EOT <div class="newsItem hentry{$vevent}"> <div class="newsImage">{$image}</div> - <h1 class="summary entry-title"><a name="{$id}" id="{$id}" href="{$permlink}" rel="bookmark" class="bookmark">{$item["title"]}</a></h1> + <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> + <abbr class="published newsdate" title="{$item["published"]}">{$newsdate}</abbr> {$item["content"]} </div> </div> -<hr /> - EOT; } diff --git a/index-beta.php b/index-beta.php index 79e05a8..401b69f 100644 --- a/index-beta.php +++ b/index-beta.php @@ -114,14 +114,27 @@ $features = " to save you keystrokes. </p> </div> - <br style='clear: both;' /> </div> + <br style='clear: left;' /> "; +$_SERVER['BASE_PAGE'] = 'archive/2012.php'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-news.inc'; +ob_start(); +echo "<div class='recentNewsEntries'> + <h1>Recent News</h1> + <a class='newsArchiveLink' href='/archive/'>(News Archive)</a>"; + +print_news($NEWS_ENTRIES, array("conferences", "cfp", "frontpage"), 5, 2012); +echo "</div>\n"; +$news = ob_get_clean(); + // Wrap announcements and features in a content element $content = " <div class='home-content'> $features + $news </div> "; diff --git a/styles/home.css b/styles/home.css index 482ed56..dfeea94 100644 --- a/styles/home.css +++ b/styles/home.css @@ -293,3 +293,24 @@ div.home-sidebar a:visited { div.home-sidebar a:hover { border-bottom-color: #3F438D; } + +.home-content .recentNewsEntries { + position: relative; + margin-top:3em; +} +.home-content .recentNewsEntries h1 { + border-bottom:1px solid #000; + color:#000; +} +.home-content a.newsArchiveLink { + position: absolute; + top:.5em; + right:0; + font-style:italic; + border-bottom: 1px solid transparent; + color:#666; +} +.home-content a.newsArchiveLink:hover, +.home-content a.newsArchiveLink:focus { + border-bottom: 1px solid #666; +} \ No newline at end of file diff --git a/styles/theme.css b/styles/theme.css index 95f6dd5..a380e0c 100755 --- a/styles/theme.css +++ b/styles/theme.css @@ -681,3 +681,8 @@ table.standard td { padding: 5px 10px; vertical-align: middle; } + +.newsItem .published { + display:block; + margin:.5em 0; +} \ No newline at end of file diff --git a/views/homepage/sidebar.php b/views/homepage/sidebar.php index 834a0d0..2395875 100644 --- a/views/homepage/sidebar.php +++ b/views/homepage/sidebar.php @@ -2,20 +2,6 @@ <?php echo $announcements; ?> - <h2>Recent News</h2> - <ul> - <?php - $i = 0; - foreach (print_news($news, "frontpage", 5, null, true) as $entry): - $escaped_title = htmlentities($entry['title'], ENT_QUOTES, 'UTF-8'); - ?> - <li><a target="_blank" title="<?php echo $escaped_title; ?>" href="<?php echo $entry['permlink']; ?>"><?php echo $escaped_title; ?></a></li> - <?php - endforeach; - ?> - </ul> - <p class="center"><a href="/archive/index.php" title="News Archive">News Archive</a></p> - <h2>Conferences</h2> <ul> <li>Conference 1</li>

« previous php.webmaster (#13727) next »