Is there a way to just display the number of queried elements?

For example, it would be a nice feature to be able to call a function, for example, views_count("view_name") which would just output the number. So it could be used for displaying some information boxes like "we have 156 published news articles" or "we have 50 registered users" etc.

Comments

merlinofchaos’s picture

Status: Active » Fixed
$view = views_get_view('viewname'); 
$view->set_display('default');
$view->execute();
return $view->total_rows;
point-1’s picture

Thanks a lot!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.