<?php
/*
 * $Id: comment_functions.php 679 2012-08-20 12:41:35Z hodaka $
 */

eval( '
function '.$mydirname.'_com_update( $bid, $total_num )
{
    return d3blog_com_update_base( "'.$mydirname.'" , $bid , $total_num ) ;
}
' ) ;

if( ! function_exists( 'd3blog_com_update_base' ) ) {
    function d3blog_com_update_base($mydirname, $bid, $total_num){
        $db = Database::getInstance();
        $sql = "UPDATE ".$db->prefix($mydirname.'_entry')." SET comments = ".intval($total_num)." WHERE bid = ".intval($bid);
        $db->query($sql);
    }
}

eval( '
function '.$mydirname.'_com_approve( &$comment )
{
    return d3blog_com_approve_base( "'.$mydirname.'" , $comment ) ;
}
' ) ;

if( ! function_exists( 'd3blog_com_approve_base' ) ) {
    function d3blog_com_approve_base($mydirname, &$comment){
        // send notification mail
    }
}
?>