<?php
if (!defined('R_P')) exit("access Die");
include_once(R_P . "/include/class.view.php");
@set_time_limit(180);
@ignore_user_abort();
class cron_view_update{
	var $view = null;
	function cron_view_update(){
		$this->view = new view(1,1);
	}
	
	function run(){
		global $channel;
		foreach($channel as $channelid => $tp){
			$key = "queue_" . $channelid;
			$string = cache::get($key);
			if($string === false) continue;
			$temp = explode(",", $string);
			foreach($temp as $val){
				$data = cache::get( 'count_' . $val);
				if($data === false) continue;
				$t = explode("_", $val);
				$this->view->_update_from_cache(intval($t[0]), intval($t[1]), $data);
			}
		}
	}
}
?>