parse the year properly, restore a simplified schedule-config

This commit is contained in:
Vasil Kolev 2016-10-24 16:22:25 +03:00 committed by Openfest
parent dd8e76cb76
commit cd87efd6e8
3 changed files with 23 additions and 26 deletions

View File

@ -3,22 +3,7 @@
get_header();
wp_nav_menu( array( 'theme_location' => 'footer-schedule', 'container_class' => 'content subnav cf' ) );
$requirePath = __DIR__ . DIRECTORY_SEPARATOR . 'schedule' . DIRECTORY_SEPARATOR;
require $requirePath . 'class.SmartCurl.php';
require $requirePath . 'config.php';
require $requirePath . 'load.php';
require $requirePath . 'parse.php';
$sched_config = getSchedConfig(date('Y'));
$data = loadData($sched_config);
if ( preg_match('/^workshop/', $pagename) ) {
$sched_config['filterEventType'] = "workshop";
} else {
$sched_config['filterEventType'] = "lecture";
}
$content = parseData($sched_config, $data);
require("schedule-config.php");
?>
<section class="content grid">

View File

@ -3,16 +3,7 @@
get_header();
wp_nav_menu( array( 'theme_location' => 'footer-schedule', 'container_class' => 'content subnav cf' ) );
$requirePath = __DIR__ . DIRECTORY_SEPARATOR . 'schedule' . DIRECTORY_SEPARATOR;
require $requirePath . 'class.SmartCurl.php';
require $requirePath . 'config.php';
require $requirePath . 'load.php';
require $requirePath . 'parse.php';
$sched_config = getSchedConfig(date('Y'));
$data = loadData($sched_config);
$content = parseData($sched_config, $data);
require("schedule-config.php");
?>
<section class="content grid">

21
schedule-config.php Normal file
View File

@ -0,0 +1,21 @@
<?php
$requirePath = __DIR__ . DIRECTORY_SEPARATOR . 'schedule' . DIRECTORY_SEPARATOR;
require $requirePath . 'class.SmartCurl.php';
require $requirePath . 'config.php';
require $requirePath . 'load.php';
require $requirePath . 'parse.php';
$siteurl = get_option('siteurl');
$year = preg_replace('%.*/([0-9]*)$%', '\1', $siteurl);
$sched_config = getSchedConfig($year);
$data = loadData($sched_config);
if ( preg_match('/^workshop/', $pagename) ) {
$sched_config['filterEventType'] = "workshop";
} else {
$sched_config['filterEventType'] = "lecture";
}
$content = parseData($sched_config, $data);