<?php
/*
	[Office 515158] (C) 2009-2014 天生创想 Inc.
	$Id: mod_news mobile $
*/
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
empty($do) && $do = 'list';
require('function/news.class.php');
if ($do == 'list') {
	if(getGP('type','G')!=''){
		$type=getGP('type','G');
	}else{
		$type=3;
	}
	include_once('template/list.php');
}elseif ($do == 'view') {
		$id = getGP('id','G','int');
		//留言模块
		if(getGP('view','G')!=''){
			$bbsid = getGP('vid','G');
			$title = check_str(getGP('title','G'));
			$author = get_realname($_USER->id);
			$content = getGP('content','G');
			$enddate = get_date('Y-m-d H:i:s',PHP_TIME);
			$uid = $_USER->id;
			//主表信息
			$bbs_log = array(
				'bbsid' => $bbsid,
				'title' => $title,
				'author' => $author,
				'content' => $content,
				'enddate' => $enddate,
				'type'=>3,
				'uid' => $uid
			);
			insert_db('bbs_log',$bbs_log);
			$content=serialize($bbs_log);
			$title='回复信息';
			get_logadd($id,$content,$title,13,$_USER->id);
			echo '1';
			exit;
		}else{
			if($id!=''){
				$views = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."news  WHERE id = '$id'");
			}
		}
		include_once('template/views.php');
}
?>