Esempio n. 1
0
File: index.php Progetto: ssrsfs/blg
<?php

/*
	29 december 2010: cleanup while trying to add
		status field to typef_news table;
		rewrote to use news categories class
	3 january 2011: DAOFactory, not DAO_Factory;
		setCategoryId now static
	28 march 2011: merged in HL code
	29 march 2011: added page title, header
*/
// define some handy shortcuts to save typing
$settings = Typeframe::CurrentPage()->settings();
if (Typeframe::CurrentPage()->pathInfo()) {
    Typeframe::IncludeScript('/news/categories/view.php');
    return;
}
if (is_array($settings['categoryid']) && !in_array(0, $settings['categoryid']) && 1 == count($settings['categoryid'])) {
    Typeframe::Redirect('Redirecting to category listing...', Typeframe::CurrentPage()->applicationUri() . 'categories/' . $settings['categoryid'][0]);
    return;
}
// create news category object
$categories = News_Category::DAOFactory();
// limit to a particular category id
News::SetCategoryId($categories, @$settings['categoryid']);
// add categories to template
$pm->setVariable('categories', $categories);
// add page title and header to template
$title = News::GetTitle();
$pm->setVariable('page_title', $title);
$pm->setVariable('page_header', $title);