It's been quite a while since I have used yii so I'm a little rusty.
I'm going to make an assumption: $post
is extended from CActiveRecord
the count function being used by your CActiveRecord requires a sql condition (noted here).
My next assumption is that you are preparing all this business logic in your view and not in the controller. You might consider sending from the view to a decorator, for your email confirmation message.
This is untested, but below we need to compare all the pk of posts:
echo $posts->count('fieldDate < now() AND fieldDate >' . strtotime('yesterday'));
Better and easier might be:
echo $posts->countByAttributes(array('postID'));
If you are looking to count all posts by an author (also untested):
$numberOfPosts = count(PostModel::model()->findAll("author_id=$authorId"));
Otherwise you might try:
count($posts);
If you are receiving an array of post objects that have be queried in a previous controller in the view.
Fat model, thin controller.