<?php
error_reporting(0);
if (!eregi($_SERVER['SERVER_NAME'], $_SERVER['HTTP_REFERER'])) {exit();}
close_browse();
global $db, $CcTvAi_com_userid;
if ($CcTvAi_com_userid) {
	$cd_pid=SafeRequest("pid", "post");
	$cd_uid=SafeRequest("uid", "post");
	if(!IsNumID($CcTvAi_com_userid)) {exit();}
	if(!IsNumID($cd_uid)) {exit();}
	if(!IsNumID($cd_pid)) {exit();}
	$cd_nameContent=unescape(SafeRequest("text", "post"));
	$sql="select cd_id,cd_uid from " . tname('pic') . " where cd_id='$cd_pid'";
	$result=$db->query($sql);
	if ($row=$db->fetch_array($result)) {
		if ($row['cd_uid']==$CcTvAi_com_userid) {
			$db->query("update " . tname('pic') . " set cd_title='" . $cd_nameContent . "' where cd_id='$cd_pid'");
			echo $cd_nameContent;
		} else {
			die('20002');
		}
	} else {
		die('30000');
	}
} else {
	die('20001');
}
?>