View file modules/main/controllers/main.php

File size: 1.25Kb
<?php
/**
 * Ant0ha's project
 *
 * @package
 * @author Anton Pisarenko <[email protected]>
 * @copyright Copyright (c) 2006 - 2010, Anton Pisarenko
 * @license http://ant0ha.ru/license.txt
 * @link http://ant0ha.ru
 */

defined('IN_SYSTEM') or die('<b>403<br />Запрет доступа!</b>');

//---------------------------------------------

/**
 * Главный пользовательский контроллер основного модуля
 */
class Main_Controller extends Controller {
	/**
	* Метод по умолчанию
	*/
	public function action_index() {
		$this->action_index_page();
	}

	/**
	* Индексная страница
	*/
	public function action_index_page() {
		$last_news = $this->db->get_row("SELECT * FROM #__news ORDER BY news_id DESC LIMIT 1");

		$info = $this->db->get_row("SELECT
			(SELECT COUNT(*) FROM #__users WHERE chat_last_time >= UNIX_TIMESTAMP() + ". $this->config['chat']['online_time'] ." * 60 AND user_id != '". USER_ID ."') AS chat_users_online
		");

		$this->tpl->assign(array(
			'info' => $info,
			'last_news' => $last_news
		));

		$this->tpl->display('index');
	}

	/**
	* ББкоды
	*/
	public function action_bbcode() {
    	$this->tpl->display('bbcode');
	}
}
?>