the example was a bit outdated.
you should use fs_api_get_page_views, which is documented here :
http://firestats.cc/wiki/API /*
Returns the number of pages displayed in the specified time period.
days_ago is an optional parameter which specifies how many days ago to start counting.
if days_ago is not specified, the count will begin when you installed FireStats.
site_id : see comment at the start of the file
url: see comment at the start of the file
*/
functionfs_api_get_page_views($days_ago=NULL,$site_id=true,$url=null)
if you don't want to specify days_ago, pass NULL instead, like:
echo "Number of times this page was viewed: ". fs_api_get_hit_count(NULL,true,the_permalink());
note that you had an extra ; after the_permalink().
the site id parameter (second true in your call) is documented at the page.
you probably want to use true here.
On 01/31/2010 02:28 PM, ovivankenobi wrote:
> After reading hte wiki and finding the api page, I guess I need to use
> this function: fs_api_get_hit_count but I can't seem to get it right.
> I'd like to show something like: viewed: XXX jsut show the total
> number of views for each page and post.
> can someone review this code for me please?
> <?php
> if (defined('FS_API'))
> {
> echo "Number of times this page was viewed: ". fs_api_get_hit_count
> (,true,the_permalink(););
> }
> ?>
> the above code doesn't work for me :-( I admit I suck at php so pelase
> help me out here.
> Also I do not know, what the first 2 parameters represent: the first
> one was 100 restricting the number of views to the last 100 days - can
> I leave it empty to show data from all times?
> What is the 2nd one? true? what does it influence?