Source
187 {
188
189 $visitor = $_SERVER['REMOTE_ADDR'];
190
191 $ipLite = new ip2location_lite;
192
193 if (!isset($_COOKIE["geolocation"])) {
194 $ipLite->setKey('7e6adac1e161b5b5277aa7e960f5b84ab4a979674aa8ca969ce724c2cfdb1916');
195 $visitorGeolocation = $ipLite->getCountry($visitor);
196 if ($visitorGeolocation['statusCode'] == 'OK') {
197 $data = base64_encode(serialize($visitorGeolocation));
198 setcookie("geolocation", $data, time() + 3600 * 24 * 30); //set cookie for 1 month
199 }
200 } else {
201 $visitorGeolocation = unserialize(base64_decode($_COOKIE["geolocation"]));
202 }
Trace
- ElementalPage_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.ElementalPage.ss:372
- include(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.ElementalPage.ss)
SSViewer.php:1172
- SSViewer->includeGeneratedTemplate(/home/osetbike/public_html/silverstripe-cache/osetbike-php7.4.33/.cache.themes.oset2015.templates.ElementalPage.ss,ElementalPage_Controller,,Array,)
SSViewer.php:1234
- SSViewer->process(ElementalPage_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)
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(/us/bikes/txp-24,DataModel)
main.php:206