$admin_emails .= ','; } $admin_emails .= $admin[$x]['admin_email']; } $to = $email; $from = $domain; $subject = "Your " . ucwords($domain) . " Subscription"; $contactname = $name; /* GET LOGO */ $logo = ''; $api_url = "http://contrib.com/api/"; $key = md5($domain); //require('curl_client.php'); $max_redirect = 3; // Skipable: default => 3 $client = new Curl_Client(array(CURLOPT_FRESH_CONNECT => 1, CURLOPT_TIMEOUT => 30, CURLOPT_USERAGENT => ''), $max_redirect); $url = $api_url . 'getdomaininfo?domain=' . $domain . '&key=' . $key; $client->get($url); $result = $client->currentResponse('body'); $data_domain = json_decode($result, true); $error = 0; if (!$data_domain['error']) { $logo = $data_domain[0]['Logo']; } if ($logo == '') { $logo = ucwords($domain); } else { $logo = '<img src="' . $logo . '" height="70px">'; } /* END GET LOGO*/ /*$message = '
<?php require 'vendor/.composer/autoload.php'; require_once 'vendor/floomoon/phpoo-curl/lib/Curl/Autoloader.php'; Curl_Autoloader::register(); // Basic construct $client = new Curl_Client(); // Initialize with a url like the function curl_init('example.com') $client = new Curl_Client('floomoon.org'); // Set the default configuration of the client $client = new Curl_Client('http://universidade.caixa/aplicacoes/trilhasDesenvolvimento/zUI/acesso_trilhas_ajax?nu_trilha=332&acao=comparar&nu_usuario=C004397&data=01/01/2011', true); $result = $client->execute(); var_dump($result);
$intro_title = stripslashes($challenge_info[0]['IntroTitle']); $small_description = stripslashes($challenge_info[0]['Introduction']); $desc_graphic = $challenge_info[0]['Desc_Graphics']; $categoryid = $challenge_info[0]['CategoryId']; $color = $challenge_info[0]['TemplateColor']; $header_script = html_entity_decode(base64_decode($challenge_info[0]['HeaderScript'])); $custom_html = html_entity_decode(base64_decode($challenge_info[0]['CustomHtml'])); $social_login = $challenge_info[0]['UseSocialLogin']; if($color=='') $color='lightblue'; /*get related challenges*/ $client3 = new Curl_Client(array( CURLOPT_FRESH_CONNECT => 1, CURLOPT_TIMEOUT => 30, CURLOPT_USERAGENT => '' ), $max_redirect); $limit = 4; $url3 = $api_url.'getRelatedChallenges?domainid='.$domainid.'&key='.$key.'&count='.$limit.'&categoryid='.$categoryid; $client3->get($url3); $result3 = $client3->currentResponse('body'); $related_sites = json_decode($result3,true); if(!$related_sites['error']){ $counter = 0; while($counter < $limit){ $related_sites_list[$counter]['name'] = $related_sites[$counter]['DomainName']; $related_sites_list[$counter]['id'] = $related_sites[$counter]['DomainId'];
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { //call api /* http://mychallenge.com/api/upload.php?url=http://beta.wellnesschallenge.com/uploads/submission/files/file_1372337965_2.txt&type=file param types: file, challenge, profile, application */ $target_path = $domainUrl.'/'.$target_path; $max_redirect = 3; // Skipable: default => 3 $client_file = new Curl_Client(array( CURLOPT_FRESH_CONNECT => 1, CURLOPT_TIMEOUT => 30, CURLOPT_USERAGENT => '' ), $max_redirect); $mychallenge_api = "http://mychallenge.com/api/upload.php?type=profile&url=".$target_path; $client_file->get($mychallenge_api); $result = $client_file->currentResponse('body'); $file_arr = json_decode($result,true); $error = 0; if (!$file_arr['error']){ $new_avatar_filename = $logo = $file_arr['url'];; $update_avatar = MYSQL_QUERY("UPDATE `ChallengeMembers` SET Photo = '".$new_avatar_filename."' WHERE ChallengeMemberId = '".$_SESSION['ChallengeMemberId']."' ") OR DIE(MYSQL_ERROR()); }else{ $error_msg = "Mychallenge API error."; $new_avatar_filename = $target_path;