<?php
function deleteComment( $iComment, $sFileDb = null ){
	if( !isset( $sFileDb ) ) $sFileDb = DB_PAGES_COMMENTS;
	$oDB = DataBase::getInstance( );
	$oDB->deleteInFile( $sFileDb, $iComment, 'iComment' );
}
function deleteComments( $iLink, $sFileDb = null ){
	if( !isset( $sFileDb ) ) $sFileDb = DB_PAGES_COMMENTS;
	$oDB = DataBase::getInstance( );
	$oDB->deleteInFile( $sFileDb, $iLink );
}
function saveComment( $aForm, $iComment, $sFileDb = null ){
	if( !isset( $sFileDb ) ) $sFileDb = DB_PAGES_COMMENTS;
	$oDB = DataBase::getInstance( );
	$aData = commentInfo( $iComment, $sFileDb );
	$aData['iComment'] = $iComment;
	$aData = array_merge( $aData, $aForm );
	$oDB->save( $sFileDb, $aData, 'iComment', 'rsort' );
}
function acceptComment( $iComment, $sFileDb = null ){
	if( !isset( $sFileDb ) ) $sFileDb = DB_PAGES_COMMENTS;
	$oDB = DataBase::getInstance( );
	$aComment = commentInfo( $iComment, $sFileDb );
	$aComment['iAccepted'] = 1;
	$oDB->save( $sFileDb, $aComment, 'iComment' );
}
?>