From e9bae7527e8de728ea6f598ff51867f2e4bec880 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Fri, 22 Nov 2013 00:26:59 -0800 Subject: [PATCH] Slightly prettier conference page.. I'm sure someone will make it perfect --- conferences/index.php | 56 +++++++++++++++++++++++++++++++------------ styles/home.css | 6 +++++ 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/conferences/index.php b/conferences/index.php index 8306f7786..8e539854c 100644 --- a/conferences/index.php +++ b/conferences/index.php @@ -6,25 +6,51 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-events.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-news.inc'; -$layout_workaround = <<< EOT -
-
-

- Are you planning a PHP related conference and want it listed here? - Let us know. -

-
- $RSIDEBAR_DATA -
-EOT; +site_header("PHP Conferences around the world", array( + 'headtags' => '', + 'current' => 'community', + 'css' => array('home.css'), +)); -unset($RSIDEBAR_DATA); +$content = "
"; +$frontpage = array(); +foreach($NEWS_ENTRIES as $entry) { + foreach($entry["category"] as $category) { + if ($category["term"] == "cfp") { + $frontpage[] = $entry; + break; + } + if ($category["term"] == "conferences") { + $frontpage[] = $entry; + break; + } + } +} +$panels = ""; +foreach($frontpage as $entry) { + $link = substr($entry["id"], 15); // Strip http://php.net/ + $date = date_format(date_create($entry["updated"]), 'Y-m-d'); + $content .= '
'; + $content .= '

' . $entry["title"] . '

'; + $content .= '
'; + $content .= sprintf('', $entry["newsImage"]["link"], $entry["newsImage"]["content"]); + $content .= '
'; + $content .= '
'; + $content .= $entry["content"]; + $content .= '
'; + $content .= '
'; -site_header("PHP Conferences around the world", array("layout_workaround" => $layout_workaround, 'headtags' => '')); + $panels .= sprintf('

%s

', $entry["newsImage"]["link"], $entry["title"]); +} +$content .= "
"; -print_news($NEWS_ENTRIES, array("conferences", "cfp"), 10); +echo $content; site_footer( - array("atom" => "/feed.atom") // Add a link to the feed + array( + "atom" => "/feed.atom", + "elephpants" => true, + "sidebar" => $panels, + ) ); diff --git a/styles/home.css b/styles/home.css index ece2a2f08..ce4736625 100644 --- a/styles/home.css +++ b/styles/home.css @@ -112,4 +112,10 @@ complimentary greens: 9FB553 7B8851 61761B C6DA82 CCDA99 padding: 5px; margin-bottom: 20px; } +.newsentry .newsimage a { + float: right; + border: 0; + padding: 10px; +} +