• Resolved Braunson

    (@braunson)


    Hello,

    Trying to use SlimStat’s API in another plugin but I receive this when trying to display the info:

    Fatal error: Call to a member function query() on a non-object in /wp-content/plugins/wp-slimstat/admin/view/wp-slimstat-db.php on line 19

    The code I’m using is:

    // Load WP SlimStat DB, the API library exposing all the reports
    require_once(WP_PLUGIN_DIR.'/wp-slimstat/admin/view/wp-slimstat-db.php');
    
    // Initialize the API. You can pass a filter in the options, i.e. show only hits by people who where using Firefox, any version
    wp_slimstat_db::init('browser contains Firefox');
    
    // Use the appropriate method to display your stats
    echo wp_slimstat_db::count_records('1=1', '*', false);

    Example as the example in http://wordpress.org/plugins/wp-slimstat/faq/ at the bottom.

    Any ideas :)?

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Using get_recent and others in a seperate plugin’ is closed to new replies.