modified : minor changes curl get basic function added

This commit is contained in:
Fahad Abbas 2017-07-24 18:37:20 +05:00
parent f612ebdada
commit fbfa14c3e4
3 changed files with 16 additions and 2 deletions

View file

@ -4040,7 +4040,7 @@ class userquery extends CBCategory{
$fields = array( $fields = array(
'users' => get_user_fields(), 'users' => get_user_fields(),
'profile' => array( 'rating', 'rated_by', 'voters', 'first_name', 'last_name', 'profile_title', 'profile_desc'), 'profile' => array( 'rating', 'rated_by', 'voters', 'first_name', 'last_name', 'profile_title', 'profile_desc','city','hometown'),
); );
$fields['users'][] = 'last_active'; $fields['users'][] = 'last_active';
$fields['users'][] = 'total_collections'; $fields['users'][] = 'total_collections';

View file

@ -14,6 +14,7 @@ include('common.php');
include('plugins.php'); include('plugins.php');
define('TEMPLATEDIR',BASEDIR.'/'.TEMPLATEFOLDER.'/'.$Cbucket->template); define('TEMPLATEDIR',BASEDIR.'/'.TEMPLATEFOLDER.'/'.$Cbucket->template);
define('TEMPLATEURL',BASEURL.'/'.TEMPLATEFOLDER.'/'.$Cbucket->template); define('TEMPLATEURL',BASEURL.'/'.TEMPLATEFOLDER.'/'.$Cbucket->template);
define('LAYOUT',TEMPLATEDIR.'/layout'); define('LAYOUT',TEMPLATEDIR.'/layout');

View file

@ -5427,7 +5427,7 @@
"SA" => "South America" "SA" => "South America"
); );
if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) { if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) {
$ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip)); $ipdat = @json_decode(get_data("http://www.geoplugin.net/json.gp?ip=" . $ip));
if (@strlen(trim($ipdat->geoplugin_countryCode)) == 2) { if (@strlen(trim($ipdat->geoplugin_countryCode)) == 2) {
switch ($purpose) { switch ($purpose) {
case "location": case "location":
@ -5849,6 +5849,19 @@
} }
function cb_curl($url)
{
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
include( 'functions_db.php' ); include( 'functions_db.php' );