How do I call a function to use on a page?

Looking at the code it’s not a function, it’s a method of CommentRatingFieldPlugin class, instance of which is being assigned to $crfp global variable.

So your should be something like:

global $crfp;
$crfp->DisplayAverageRating();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)