<?php
if(!defined('IN_MYMPS')) exit('FORBIDDEN');
$cache = $cache ? $cache : get_cache_config();
$smarty -> cache_lifetime    = $cache['announce']['time'];
$smarty -> caching           = $cache['announce']['open'];

if (!$smarty->is_cached(mymps_tpl('announce','smarty'),$part)){
	$loc 		= get_location('aboutus','','ÍøÕ¾¹«¸æ');
	$page_title = $loc['page_title'];
	$location	= $loc['location'];
	$timestamp  = time();
	
	$query = $db -> query("SELECT * FROM `{$db_mymps}announce` WHERE begintime<='$timestamp' AND (endtime='0' OR endtime>'$timestamp') ORDER BY id DESC");
	while($row = $db -> fetchRow($query)){
		$arr['id'] 		= $row['id'];
		$arr['title'] 		= $row['title'];
		$arr['begintime']	= $row['begintime'] == 0 ? $row['pubdate'] : $row['begintime'];
		$arr['endtime'] 	= $row['endtime'];
		$arr['author'] 		= $row['author'];
		$arr['content'] 	= $row['redirecturl'] ? '<a href='.$row[redirecturl].' target=_blank>'.$row[redirecturl].'</a>' : $row['content'];
		$arr['uri'] 		= $row['redirecturl'] ? $row['redirecturl'] : Rewrite('about',array('part'=>'aboutus#'.$row['id']));
		$announce[]			= $arr;
	}
	
	tpl_assign();
	$smarty -> assign('announce',$announce);
	$smarty -> assign('part','announce');
	$smarty -> assign('cat',NULL);
}
$advetisement = $adveritems = $cat_list = $area_list = $announce = $page_title = $location = $cat = $catid = $announce =$aboutus = $faq = $flink = $categories = NULL;
?>