当前位置: 首页>>代码示例>>PHP>>正文


PHP erLhcoreClassIPDetect::getServerAddress方法代码示例

本文整理汇总了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!');
     }
 }
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:31,代码来源:geoconfiguration.php

示例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');
?>
" />
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:30,代码来源:geoconfiguration.tpl.php


注:本文中的erLhcoreClassIPDetect::getServerAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。