<?php
if(!defined('R_P')) exit('Access Denied');
$channelid = intval($_GET['channelid']);
$id = intval($_GET['id']);
$type = intval($_GET['type']);
$key = "{$channelid}_{$id}";
$has_digg = $_COOKIE['_digg'];
$ids = explode(".", $has_digg);
if(!$id || in_array($key, $ids)){
	$data = array('good'=>1,'bad'=>1, 'status'=>0);
	die(qbase::xmlPrint(qbase::jsonencode($data)));
}
$data = qbase::get_object('view', $channelid, $id)->update_digg($type);
echo qbase::xmlPrint(qbase::jsonencode($data));
?>