cout rows of a view for new content and comments I have made a view getting the new content added and new comments 

But i need to get its count and so i usedthe following code

$view = views_get_view('new_activity');

$view-&gt;set_arguments(array(arg(2)));

$view-&gt;execute();

return l(count($view-&gt;result), 'new-activity/' . arg(2));


but i see untrue number related to the view page

how to fix it espicially using history_timestamp attribute of each row

the main problem is that the views gets , data and hide the viewed rows 
and only shows the unviewed rows which gives me wrong count 

please help or advice with a better scenario

thanks in advance
count($view-&gt;results) will only give you the number of the results on the current page if using a paged View. Try using $view-&gt;total_rows instead, which will give you the total number of rows returned by the View:

return l($view-&gt;total_rows, 'new-activity/' . arg(2));