[eluser]rana[/eluser]
First thing, its not like "you can't place the function in view" , but more likely, you shouldn't to keep the MVC model meaningful. From your code examples, it seems that, you could do this 'subscribed' value retrieved while retrieving the 'posts' data by doing some join operation, and it is strongly recommended. For another alternative, you can make another loop inside controller/libraries/models to loop through the posts and have the proper flag assigned like:
Code:
foreach($posts as $post){
$post->subscribed = has_subscribed($post->id);
}
But it is going to give you an extra loop computation. So, you should be careful and consider the amoung of database data to be shown on page before implementation in such way.