-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbvinfo.php
58 lines (51 loc) · 1.34 KB
/
bvinfo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* @package Joomla.Plugin
* @subpackage System.bvinfo
*
* @copyright Copyright (C) 2015 Yair Lahav, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
require_once('geoplugin.php');
/**
* Joomla! BVinfo Plugin.
*
* @since 3.0
*/
class PlgSystemBvinfo extends JPlugin {
var $debug = false;
var $geoplugin;
var $visitorInfo;
public function PlgSystemBvinfo(&$subject, $config) {
if ($this->debug) {
echo "<br> PlgSystemBvinfo - PlgSystemBvinfo<br>";
}
$this->geoplugin = new geoPlugin();
$this->visitorInfo = $this->geoplugin->locate();
if ($this->debug) {
echo "<br> --- geoplugin --------------------------<br>";
print_r($this->geoplugin);
}
parent::__construct($subject, $config);
}
/**
* Gets visitor information.
*
* @return void
*
* @since 3.0
*/
public function onGetVisitorInfo()
{
if ($this->debug) {
echo "<br> PlgSystemBvinfo - onGetVisitorInfo<br>";
if (empty($this->geoplugin)) {
echo "<br> PlgSystemBvinfo - emppty values<br>";
} else {
print_r($this->geoplugin);
}
}
return $this->visitorInfo;
}
}