<?php
defined('PP_PATH') or exit;
class views_control extends control{
	public function index() {
		$_ENV['_config']['cache']['l2_cache'] = 0;
		$id = (int)R('id');
		$cid = (int)R('cid');
		$_var = $this->category->get_cache($cid);
		empty($_var) && core::error404();
		
		$this->cms_content->table = 'cms_'.$_var['table'];
		$data = $this->cms_content->read($id);
		
		$data['views']++;
		echo 'var views='.$data['views'].';';
		$this->cms_content->update($data);

		exit;
	}
}
