<?php
/*
+--------------------------------------------------------------------------
|   TanyaCMS - Question and Answer Sofware
|   -----------------------------------------------------------------------
|   by fbschool dev team
|   (c) 2011 - 2012 FBSCHOOL
|   http://www.fbschool.com/tanyacms
|   -----------------------------------------------------------------------
|   This is NOT a freeware, use is subject to license terms
|   Support: 13455n@gmail.com
+--------------------------------------------------------------------------
*/


if (!defined('IN_TANYACMS'))
{
	die;
}

class main extends ASK_CONTROLLER
{

	function get_access_rule()
	{
		$rule_action['rule_type'] = 'black';
		$rule_action['actions'] = array();
		return $rule_action;
	}

	public function setup()
	{
		header('Content-type: text/xml; charset=UTF-8');
		
		date_default_timezone_set('UTC');
	}

	public function index_action()
	{
		if ($_GET['topic'])
		{
			$list = $this->model('question')->get_question_list_by_topic_ids($_GET['topic'], 20);
		}
		else
		{
			$list = $this->model('question')->search_questions_list(false, array('category_id' => $_GET['category'], 'per_page' => 20));
		}
		
		TPL::assign('list', $list);
		
		TPL::output('global/feed');
	}
}