public function commentdelete() { $wid = isset($_POST['id']) ? addslashes($_POST['id']) : ''; if ($wid == "") { die('ID empty'); } $json['bool'] = 0; $wallmurid = new MuridWallComment(); //load $wallmurid->getByID($wid); if ($wallmurid->cid_admin_id == Account::getMyID()) { $json['bool'] = $wallmurid->delete($wid); if ($json['bool']) { $wall = new MuridWall(); $wall->getByID($wallmurid->wid); $wall->wall_commentcount--; $wall->load = 1; $tgl = Wall::getDateTime(); $wall->wall_update = $tgl; $json['bool'] = $wall->save(); } } else { $json['err'] = Lang::t('Not Authorize'); } die(json_encode($json)); }