• Resolved lelebart

    (@lelebart)


    Hi, in order to obtain a counter in the footer of https://www.mauriziobarca.com/ I used this code:

    $slimstat_upgrade_purged_db = 21000;
    require_once(WP_PLUGIN_DIR.'/wp-slimstat/admin/view/wp-slimstat-db.php');
    wp_slimstat_db::init();
    echo $slimstat_upgrade_purged_db + wp_slimstat_db::count_records('1=1', '*', false, '', false);

    Total pageview from dashboard (now – 5years) are 83990: so, 83990+21000=104990.

    Thanks to the online documentation I change the code into:

    $slimstat_upgrade_purged_db = 21000;
    require_once(WP_PLUGIN_DIR.'/wp-slimstat/admin/view/wp-slimstat-db.php');
    wp_slimstat_db::init();
    echo $slimstat_upgrade_purged_db + wp_slimstat_db::count_records('visit_id', '1=1', false);

    but it’s not the behaviour I need.

    How to retrive the total pageview with the new version?

    https://www.ads-software.com/plugins/wp-slimstat/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jason Crouse

    (@coolmann)

    Hi,

    visit_id will count human visits, not pageviews. You may want to change that to ‘id’. This is the function’s signature:

    function count_records( $_column = ‘id’, $_where = ”, $_use_date_filters = true )

    Hope this helps,
    Camu

    Thread Starter lelebart

    (@lelebart)

    I really misunderstood that, my fault.

    Thanks!

    count_records('id', '1=1', false)

    did the trick.

    ??

    Plugin Author Jason Crouse

    (@coolmann)

    Wonderful!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Count All Visitors (Pageview)’ is closed to new replies.