Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The JoomlaStats API can be used by programmers to use the JoomlaStats as an engine to build your own applications.

From version com_joomlastats_v2.3.0 JoomlaStats share its API through 2 files:
- general.php
- simple.
Right now you can use our database, but shortly there will be some functions added to get the result of powerfull queries!php

Both of them You will find in below directory:
.../joomla/administrator/components/com_joomlastats/api/

.

To include JoomlaStats API, for example in Your module, use below statement:

No Format

	{//include JoomlaStats API
		$PathToJoomlaStatsApi = dirname(__FILE__) .DIRECTORY_SEPARATOR. '..' .DIRECTORY_SEPARATOR. 'administrator' .DIRECTORY_SEPARATOR. 'components' .DIRECTORY_SEPARATOR. 'com_joomlastats' .DIRECTORY_SEPARATOR. 'api' .DIRECTORY_SEPARATOR. 'api.include.php';
		if (defined( '_JEXEC' )) //in joomla CMS v1.5.x all modules have own direcotory - path need to be a little longer
			$PathToJoomlaStatsApi = dirname(__FILE__) .DIRECTORY_SEPARATOR. '..' .DIRECTORY_SEPARATOR. '..' .DIRECTORY_SEPARATOR. 'administrator' .DIRECTORY_SEPARATOR. 'components' .DIRECTORY_SEPARATOR. 'com_joomlastats' .DIRECTORY_SEPARATOR. 'api' .DIRECTORY_SEPARATOR. 'api.include.php';


		if ( file_exists($PathToJoomlaStatsApi) ) {
			require_once($PathToJoomlaStatsApi);
		} else {
			echo 'File with JoomlaStats API not found. Did You install JoomlaStats engine (eg.: com_joomlastats_v2.3.0.zip)?';
		}
	}


.

Each function in these files has comments, that explains the pruprose of the function, how to use it and describes the list of arguments.

Class

Description

js_JSApiSimple

This class contain simplified versions of other JoomlaStats API methods.

js_JSApiGeneral

This class contain most of the JoomlaStats API methods.

js_OS

This class contains (hold) data about Operating System (OS)

js_Browser

This class contains (hold) data about Browsers

js_Tld

This class contains (hold) data about Top Level Domains (TLD)

js_Visitor

This class contains (hold) data about visitors