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?
/*
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.
almost there. I tried this:
<?php
if (defined('FS_API'))
{
echo fs_api_get_page_views(NULL,1,the_permalink())." vizualizari";
}
?>
the out put is this:
http://zice.ro/informatii/ce-fel-de-articole-si-tutoriale-va-doriti-de-la-noi/122921
vizualizari
It basically prints out the current permalink followed by the number
of hits.
What am I doing wrong here? It shouldn't print out the permalink just
use it to show only the hits for the current page/post.