Skip to content

Commit 11878a0

Browse files
committed
Wire up conference announcements on the beta site to work off pregen-confs.inc.
1 parent 2851ba1 commit 11878a0

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

index-beta.php

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,30 @@
5050
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc';
5151

5252
// Prepare announcements.
53-
$announcements = "
54-
<div class='announcements'>
55-
Upcoming conferences: PHP North West, 2011
56-
</div>
57-
";
53+
if (is_array($CONF_TEASER) && $CONF_TEASER) {
54+
$teaser_categories = array(
55+
'conference' => 'Upcoming conferences',
56+
'cfp' => 'Calling for papers',
57+
);
58+
59+
$announcements = '<ul class="announcements">';
60+
61+
foreach ($CONF_TEASER as $category => $events) {
62+
if (is_array($events) && $events) {
63+
$announcements .= '<li><span class="category">'.$teaser_categories[$category].':</span><ul>';
64+
$links = array();
65+
foreach (array_slice($events, 0, 4) as $url => $title) {
66+
$title = preg_replace("'([A-Za-z0-9])([\s\:\-\,]*?)call for(.*?)$'i", "$1", $title);
67+
$announcements .= "<li><a href='$url'>$title</a></li>";
68+
}
69+
$announcements .= '</ul>';
70+
}
71+
}
72+
73+
$announcements .= '</ul>';
74+
} else {
75+
$announcements = '';
76+
}
5877

5978
// Prepare featured content.
6079
$features = "

styles/home.css

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,40 @@ div.home-content {
182182
/* Announcement Area */
183183

184184
.home .announcements {
185-
width: 600px;
185+
display: table;
186+
width: 598px;
186187
border: 1px solid #aaa;
187188
background-color: #dfd;
188189
border-radius: 5px;
189190
padding: 15px;
190191
text-align: center;
191192
margin: 0 auto;
192193
font-size: 1.2em;
194+
list-style: none;
195+
}
196+
197+
.home .announcements > li {
198+
display: table-row;
199+
}
200+
201+
.home .announcements .category, .home .announcements ul {
202+
display: table-cell;
203+
}
204+
205+
.home .announcements .category {
206+
text-align: right;
207+
padding: 1em 0.5em 0;
208+
}
209+
210+
.home .announcements > li:first-child .category {
211+
padding-top: 0;
212+
}
213+
214+
.home .announcements ul, .home .announcements ul li {
215+
list-style: none;
216+
margin: 0;
217+
padding: 0;
218+
text-align: left;
193219
}
194220

195221
/* 2x2 Featured Content Grid */

0 commit comments

Comments
 (0)