com web/php: Wire up conference announcements on the beta site to work off pregen-confs.inc.: index-beta.php styles/home.css

From: Date: Wed, 28 Mar 2012 04:32:00 +0000
Subject: com web/php: Wire up conference announcements on the beta site to work off pregen-confs.inc.: index-beta.php styles/home.css
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-13267@lists.php.net to get a copy of this message
Commit: 11878a076361e8b815d4f409298e81ef992c66b3 Author: Adam Harvey <aharvey@php.net> Wed, 28 Mar 2012 12:32:00 +0800 Parents: 2851ba1f6a5eeee66c441f6ce561ccbea5d1c00a Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=11878a076361e8b815d4f409298e81ef992c66b3 Log: Wire up conference announcements on the beta site to work off pregen-confs.inc. Changed paths: M index-beta.php M styles/home.css Diff: 11878a076361e8b815d4f409298e81ef992c66b3 diff --git a/index-beta.php b/index-beta.php index 19169ce..5a2d2d0 100644 --- a/index-beta.php +++ b/index-beta.php @@ -50,11 +50,30 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-news.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc'; // Prepare announcements. -$announcements = " -<div class='announcements'> -Upcoming conferences: PHP North West, 2011 -</div> -"; +if (is_array($CONF_TEASER) && $CONF_TEASER) { + $teaser_categories = array( + 'conference' => 'Upcoming conferences', + 'cfp' => 'Calling for papers', + ); + + $announcements = '<ul class="announcements">'; + + foreach ($CONF_TEASER as $category => $events) { + if (is_array($events) && $events) { + $announcements .= '<li><span class="category">'.$teaser_categories[$category].':</span><ul>'; + $links = array(); + foreach (array_slice($events, 0, 4) as $url => $title) { + $title = preg_replace("'([A-Za-z0-9])([\s\:\-\,]*?)call for(..*?)$'i", "$1", $title); + $announcements .= "<li><a href='$url'>$title</a></li>"; + } + $announcements .= '</ul>'; + } + } + + $announcements .= '</ul>'; +} else { + $announcements = ''; +} // Prepare featured content. $features = " diff --git a/styles/home.css b/styles/home.css index ec20166..20c7ca6 100644 --- a/styles/home.css +++ b/styles/home.css @@ -182,7 +182,8 @@ div.home-content { /* Announcement Area */ .home .announcements { - width: 600px; + display: table; + width: 598px; border: 1px solid #aaa; background-color: #dfd; border-radius: 5px; @@ -190,6 +191,31 @@ div.home-content { text-align: center; margin: 0 auto; font-size: 1.2em; + list-style: none; +} + +.home .announcements > li { + display: table-row; +} + +.home .announcements .category, .home .announcements ul { + display: table-cell; +} + +.home .announcements .category { + text-align: right; + padding: 1em 0.5em 0; +} + +.home .announcements > li:first-child .category { + padding-top: 0; +} + +.home .announcements ul, .home .announcements ul li { + list-style: none; + margin: 0; + padding: 0; + text-align: left; } /* 2x2 Featured Content Grid */

« previous php.webmaster (#13267) next »