Child pages
  • cPanel API 1 Functions - Stats::lastvisitors

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function retrieves a list of a domain's most recent visitors.

Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)None.
  • cPanel API 2Stats::lastvisitors
    Excerpt Include
    cPanel API 2 Functions - Stats::lastvisitors
    cPanel API 2 Functions - Stats::lastvisitors
    nopaneltrue
Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$get_lastvisitors = $cpanel->api1('Stats','lastvisitors', array('example.com','0','/path/to/thelogfile.log','5') ); // Call the function.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

Expand
titleLiveAPI Perl Module
Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $get_lastvisitors = $cpliveapi->api1('Stats','lastvisitors', ['example.com','0','/path/to/thelogfile.log','5'] ); # Call the function.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 

Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

Code Block
languagetext
<cpanel Module="Stats::lastvisitors($FORM('domain','ssl','file','numlines')">
Expand
titleCommand Line
Code Block
languagebash
cpapi1 --user=username Stats lastvisitors example.com 0 /path/to/thelogfile.log 5

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote

Expand
titleOutput (HTML)
Code Block
/tmp/$user/webalizerftp/index.html

Parameters

ParameterTypeDescriptionPossible ValuesExample
domainstring

Required

The domain name.

A valid domain name.example.com
sslBoolean

Whether to display the normal or SSL log file.

This value defaults to 0.

  • 1 — Display the SSL log file.
  • 0 — Display the normal log file.
0
filestring

The path to the log file.

This value defaults to the correct file path.

A valid absolute file path./path/to/thelogfile.log
numlinesinteger

Required

The number of recent visitors to view.

A valid integer.5

Returns

This function displays HTML that contains information about the latest visitors to the specified domain.