Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 254 | All time: 7,870 This week: 455 |
Version | License | PHP version | Categories | |||
ci-visitorcounter 1.0.0 | Free for non-comm... | 5 | PHP 5, User Management |
Description | Author | |
This class can keep track of visitors to a Web site. |
Visitorcounter is a class y for codeigniter to use this class you must install first the geoip2 via composer
Download GeoLite2 Database reader : add this into your composer.json file
{
"require":
{
"geoip2/geoip2": "~2.0"
}
}
or install via composer
php composer require geoip2/geoip2:~2.0<br/>
To use this class add this line to your controller
$this->library->load('visitorcounter');
$this->visitor->counter->run();
How to get the vist data
$this->library->load('visitorcounter');
//replace the date,year,month you want to display
$this->visitorcounter->read($date,$year,$month);
//For current date
$this->visitorcounter->read();
//Sample output
::1~2019-03-04 02:00 pm~Invalid IP address: ::1~JP~Invalid IP address: ::1
::2~2019-03-04 02:00 pm~Invalid IP address: ::1~PH~Invalid IP address: ::1
::3~2019-03-04 02:01 pm~Invalid IP address: ::1~US~Invalid IP address: ::1
::2~2019-03-04 02:02 pm~Invalid IP address: ::1~PH~Invalid IP address: ::1
::1~2019-03-04 02:60 pm~Invalid IP address: ::1~JP~Invalid IP address: ::1
//Getcurrentdata by array
// getcurrentdata($date,$year,$month)
if($data = $this->visitorcounter->getcurrentdata()){
var_dump($data);
}
//output
array(3) {
[0]=>
array(2) {
["country"]=>
string(2) "JP"
["counter"]=>
int(2)
}
[1]=>
array(2) {
["country"]=>
string(2) "PH"
["counter"]=>
int(2)
}
[2]=>
array(2) {
["country"]=>
string(2) "US"
["counter"]=>
int(1)
}
}
Files (7) |
File | Role | Description | ||
---|---|---|---|---|
test (1 directory) | ||||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
README.md | Doc. | Documentation | ||
Visitorcounter.php | Class | Class source |
Files (7) | / | test | / | application |
File | Role | Description | ||
---|---|---|---|---|
controllers (1 file) | ||||
models (1 file) | ||||
tb_visits.sql | Data | Auxiliary data |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.