Source
231 {
232
233 $visitor = $_SERVER['REMOTE_ADDR'];
234
235 $ipLite = new ip2location_lite;
236
237 if (!isset($_COOKIE["geolocation"])) {
238 $ipLite->setKey('7e6adac1e161b5b5277aa7e960f5b84ab4a979674aa8ca969ce724c2cfdb1916');
239 $visitorGeolocation = $ipLite->getCountry($visitor);
240 if ($visitorGeolocation['statusCode'] == 'OK') {
241 $data = base64_encode(serialize($visitorGeolocation));
242 setcookie("geolocation", $data, time() + 3600 * 24 * 30); //set cookie for 1 month
243 }
244 } else {
245 $visitorGeolocation = unserialize(base64_decode($_COOKIE["geolocation"]));
246 }
Trace
- Page_Controller->get_geolocation()
ViewableData.php:466
- ViewableData->obj(get_geolocation,,,1,get_geolocation)
ViewableData.php:504
- ViewableData->cachedCall(get_geolocation,)
ViewableData.php:517
- ViewableData->hasValue(get_geolocation,,1)
SSViewer.php:187
- SSViewer_Scope->__call(hasValue,Array)
SSViewer.php:650
- SSViewer_DataPresenter->__call(hasValue,Array)
.cache.themes.oset2015.templates.Page.ss:296
- include(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.Page.ss)
SSViewer.php:1172
- SSViewer->includeGeneratedTemplate(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.Page.ss,NewsItem_Controller,,Array,)
SSViewer.php:1234
- SSViewer->process(NewsItem_Controller)
Controller.php:201
- Controller->handleAction(SS_HTTPRequest,index)
RequestHandler.php:208
- RequestHandler->handleRequest(SS_HTTPRequest,DataModel)
Controller.php:151
- Controller->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:174
- ContentController->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:154
- ContentController->handleRequest(SS_HTTPRequest,DataModel)
ContentController.php:154
- ContentController->handleRequest(SS_HTTPRequest,DataModel)
ModelAsController.php:75
- ModelAsController->handleRequest(SS_HTTPRequest,DataModel)
PrefixModelAsController.php:69
- PrefixModelAsController->handleRequest(SS_HTTPRequest,DataModel)
Director.php:383
- Director::handleRequest(SS_HTTPRequest,Session,DataModel)
Director.php:147
- Director::direct(/gb/news-and-reports/news/oset-cup-north-season-finale,DataModel)
main.php:206