// require(DIR_WS_MODULES . 'require_languages.php'); require_once(DIR_WS_CLASSES . 'news.php'); require_once(DIR_WS_FUNCTIONS . 'news.php'); // People are trying to view the future... the universe will be destroyed if we don't stop them! if (isset($_GET['date']) && ($_GET['date'] > date('Y-m') || !zen_not_null($_GET['date'])) ) { zen_redirect(zen_href_link(FILENAME_NEWS_ARCHIVE)); } // Set the current date $curren_date = ((!isset($_GET['date'])) ? date('Y-m-d') : $_GET['date']); // Find the date news was published most recently from the current date (but not the future you dummy) $date_selector = $db->Execute("select news_date_published from " . TABLE_NEWS_ARTICLES . " where news_status = '1' and to_days(news_date_published) <= to_days('" . $curren_date . "') order by news_date_published DESC limit 1"); // Set the current archive date $archive_date = ((!isset($_GET['date'])) ? substr($date_selector->fields['news_date_published'], 0, 7) : $_GET['date']); // Everybody loves the breadcrumb $breadcrumb->add(NAVBAR_TITLE, zen_href_link(FILENAME_NEWS_INDEX)); if (isset($_GET['date'])) { $breadcrumb->add(news_date_archive($archive_date), zen_href_link(FILENAME_NEWS_ARCHIVE, 'date=' . $archive_date)); } else { $breadcrumb->add(news_date_archive($archive_date), zen_href_link(FILENAME_NEWS_ARCHIVE)); } ?>