* Ajax Controller for Wallace House Site * all requests require an 'action' param * @rdarling * * */ include_once 'helpers.php'; include_once '../../../wp-blog-header.php'; $res = ''; //GET requests if (!empty($_GET['action'])) { switch ($_GET['action']) { case 'past_winners': $winners = get_posts(array('post_type' => 'person_livingston', 'posts_per_page' => -1)); $award = !empty($_GET['award']) ? $_GET['award'] : null; $year = !empty($_GET['year']) ? $_GET['year'] : 'all'; $sorted_winners = sort_past_winners($winners, $year, $award); if (!empty($sorted_winners)) { foreach ($sorted_winners as $win) { $res .= ' <div class="row"> <div class="large-10 large-centered columns"> <div class="past-winner"> <div class="name">' . $win['first_name'] . ' ' . $win['last_name'] . '</div> <div class="lib-item"><a href="' . $win['library_link'] . '">' . $win['lib'] . '</a></div> <div class="winning"> <span class="job">' . $win['past_job'] . ',</span> <span class="aff">' . $win['past_aff'] . '</span> </div> <div class="current">'; if (!empty($win['job'])) { $res .= '<span class="job">Current Assignment: ' . $win['job'] . ', </span>'; }
* Template Name: Past Winners * * @package knight_wallace */ get_header('livingston'); ?> <?php include_once 'helpers.php'; //grab our junk $current_year_global = get_option('fellows_current_year'); $alerts = get_posts(array('category_name' => 'alert')); $winners = get_posts(array('post_type' => 'person_livingston', 'posts_per_page' => -1)); $year_to_start_from = $current_year_global - 1; $year_array = year_array($year_to_start_from); $sorted_winners = sort_past_winners($winners, $year_array); ?> <section class="breadcrumb"> <div class="row"> <div class="small-6 columns"> <a href="/livingston-awards/winners/" class="link"> Current Winners</a> </div> </div> </section> <div class="row"> <div class="large-12 columns"> <h1 class="entry-title" id="page_title">Past Winners</h1> </div> </div> <section id="past_winners_control"> <form id="control_form" action="/livingston-awards/winners/past-winners/">