<?php
require_once "./includes/common.inc.php";

if($uid) {
$ding = $db -> queryarray("SELECT ding FROM {$tablepre}pic WHERE pid='$uid'");
if($ding) {
$db -> query("UPDATE {$tablepre}pic SET ding=ding+1 WHERE pid='$uid'");
}else{
mexit('0');
}
mexit(''.($ding['ding']+1).'');
}

$view = $db -> queryarray("SELECT views FROM {$tablepre}pic WHERE pid='$pid'");
if($view) {
	$db -> query("UPDATE {$tablepre}pic SET views=views+1 WHERE pid='$pid'");
}else{
mexit('document.getElementById("pic_this").innerHTML="0";');
}
mexit('document.getElementById("pic_this").innerHTML="'.($view['views']+1).'";');
?>
