當前位置: 首頁>>代碼示例>>PHP>>正文


PHP erLhcoreClassModelChatOnlineUser::getUserData方法代碼示例

本文整理匯總了PHP中erLhcoreClassModelChatOnlineUser::getUserData方法的典型用法代碼示例。如果您正苦於以下問題:PHP erLhcoreClassModelChatOnlineUser::getUserData方法的具體用法?PHP erLhcoreClassModelChatOnlineUser::getUserData怎麽用?PHP erLhcoreClassModelChatOnlineUser::getUserData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在erLhcoreClassModelChatOnlineUser的用法示例。


在下文中一共展示了erLhcoreClassModelChatOnlineUser::getUserData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: detectLocation

 public static function detectLocation(erLhcoreClassModelChat &$instance)
 {
     $geoData = erLhcoreClassModelChatConfig::fetch('geo_data');
     $geo_data = (array) $geoData->data;
     if (isset($geo_data['geo_detection_enabled']) && $geo_data['geo_detection_enabled'] == 1) {
         $params = array();
         if ($geo_data['geo_service_identifier'] == 'mod_geoip2') {
             $params['country_code'] = $geo_data['mod_geo_ip_country_code'];
             $params['country_name'] = $geo_data['mod_geo_ip_country_name'];
             $params['mod_geo_ip_city_name'] = $geo_data['mod_geo_ip_city_name'];
             $params['mod_geo_ip_latitude'] = $geo_data['mod_geo_ip_latitude'];
             $params['mod_geo_ip_longitude'] = $geo_data['mod_geo_ip_longitude'];
         } elseif ($geo_data['geo_service_identifier'] == 'locatorhq') {
             $params['username'] = $geo_data['locatorhqusername'];
             $params['api_key'] = $geo_data['locatorhq_api_key'];
         } elseif ($geo_data['geo_service_identifier'] == 'ipinfodbcom') {
             $params['api_key'] = $geo_data['ipinfodbcom_api_key'];
         } elseif ($geo_data['geo_service_identifier'] == 'max_mind') {
             $params['detection_type'] = $geo_data['max_mind_detection_type'];
             $params['city_file'] = isset($geo_data['max_mind_city_location']) ? $geo_data['max_mind_city_location'] : '';
         }
         $location = erLhcoreClassModelChatOnlineUser::getUserData($geo_data['geo_service_identifier'], $instance->ip, $params);
         if ($location !== false) {
             $instance->country_code = $location->country_code;
             $instance->country_name = $location->country_name;
             $instance->lat = $location->lat;
             $instance->lon = $location->lon;
             $instance->city = $location->city;
         }
     }
 }
開發者ID:keenick,項目名稱:livehelperchat,代碼行數:31,代碼來源:erlhcoreclassmodelchat.php

示例2: array

             $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!');
     }
 }
 if (count($Errors) == 0) {
     $geoData->value = serialize($data);
     $geoData->saveThis();
     $tpl->set('updated', 'done');
 } else {
     $tpl->set('errors', $Errors);
 }
開發者ID:sudogitguy,項目名稱:livehelperchat,代碼行數:31,代碼來源:geoconfiguration.php


注:本文中的erLhcoreClassModelChatOnlineUser::getUserData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。