本文整理汇总了PHP中erLhcoreClassIPDetect::getServerAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassIPDetect::getServerAddress方法的具体用法?PHP erLhcoreClassIPDetect::getServerAddress怎么用?PHP erLhcoreClassIPDetect::getServerAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassIPDetect
的用法示例。
在下文中一共展示了erLhcoreClassIPDetect::getServerAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$responseDetection = erLhcoreClassModelChatOnlineUser::getUserData('locatorhq', erLhcoreClassIPDetect::getServerAddress(), array('ip' => $data['locatorhqip'], 'username' => $data['locatorhqusername'], 'api_key' => $data['locatorhq_api_key']));
if ($responseDetection == false || !isset($responseDetection->country_code)) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Setting service provider failed, please check that your service provider allows you to make requests to remote pages and your API key and username is correct!');
}
}
} elseif ($form->UseGeoIP == 'ipinfodbcom') {
$data['geo_service_identifier'] = 'ipinfodbcom';
$filledAPIData = true;
if ($form->hasValidData('ipinfodbAPIKey') && $form->ipinfodbAPIKey != '') {
$data['ipinfodbcom_api_key'] = $form->ipinfodbAPIKey;
} else {
$filledAPIData = false;
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Please enter the API key!');
}
if ($filledAPIData == true) {
$responseDetection = erLhcoreClassModelChatOnlineUser::getUserData('ipinfodbcom', erLhcoreClassIPDetect::getServerAddress(), array('api_key' => $data['ipinfodbcom_api_key']));
if ($responseDetection == false || !isset($responseDetection->country_code)) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Setting service provider failed, please check that your service provider allows you to make requests to remote pages and your API key is correct!');
}
}
} elseif ($form->UseGeoIP == 'php_geoip') {
$data['geo_service_identifier'] = 'php_geoip';
$responseDetection = erLhcoreClassModelChatOnlineUser::getUserData('php_geoip', '94.23.200.91');
if ($responseDetection == false || !isset($responseDetection->country_code)) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Setting service provider failed, please check that you have installed php-GeoIP module and GeoIPCity.dat file is available!');
}
}
} else {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Please choose a service provider!');
}
}
示例2: isset
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Username');
?>
</label>
<input class="form-control" type="text" name="locatorhqUsername" value="<?php
isset($geo_data['locatorhqusername']) ? print htmlspecialchars($geo_data['locatorhqusername']) : (print '');
?>
">
</div>
<div class="form-group">
<label><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'IP, if your site remote IP is different from detected one, please provide correct remote IP address');
?>
</label>
<input class="form-control" type="text" name="locatorhqIP" value="<?php
isset($geo_data['locatorhqip']) ? print htmlspecialchars($geo_data['locatorhqip']) : (print erLhcoreClassIPDetect::getServerAddress());
?>
">
</div>
</div>
</div>
</div>
</div>
<input type="submit" class="btn btn-default" name="StoreGeoIPConfiguration" value="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Save');
?>
" />