bass Posted January 17, 2017 Report Share Posted January 17, 2017 a small code that displays information on the VATSIM pilotin order to work the script I made in the database phpvms_pilots column "CID" and put in his ID number vatsim pilots. <div class="col col_5_of_12"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title"><i class="fa fa-wifi" aria-hidden="true"></i> Vatsim Pilot </h3> </div> <div class="panel-body"> <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://api.vateud.net/members/id/$userinfo->cid.json"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); $response = curl_exec($ch); curl_close($ch); $json=json_decode($response,true); ?> <div id="vf"> <ul class="blocklist"> <li>Дивизион : <?php echo $json['division']; ?></li> <li>Ранг Vatsim : <?php echo $json['humanized_pilot_rating']; ?></li> <li>Регион : <?php echo $json['region']; ?></li> <li>country : <?php echo $json['country']; ?></li> </ul> </div> </div> </div> </div> Quote Link to comment Share on other sites More sharing options...
ncd200 Posted January 18, 2017 Report Share Posted January 18, 2017 Thanks, but will it take the ID from the custom profile field? Quote Link to comment Share on other sites More sharing options...
bass Posted January 18, 2017 Author Report Share Posted January 18, 2017 I tried to put this code in the query, but it doesn't work( <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://api.vateud.net/members/id/$userinfo->cid.json"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); --------------------------------------------------- "http://api.vateud.net/members/id/$userinfo->cid.json" $userinfo->cid = <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> Quote Link to comment Share on other sites More sharing options...
bass Posted January 18, 2017 Author Report Share Posted January 18, 2017 <?php $cidvatsim = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://api.vateud.net/members/id/$cidvatsim.json"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); $response = curl_exec($ch); curl_close($ch); $json=json_decode($response,true); ?> <div id="vf"> <ul class="blocklist"> <li>Дивизион : <?php echo $json['division']; ?></li> <li>Ранг Vatsim : <?php echo $json['humanized_pilot_rating']; ?></li> <li>Регион : <?php echo $json['region']; ?></li> <li>country : <?php echo $json['country']; ?></li> </ul> Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted January 19, 2017 Moderators Report Share Posted January 19, 2017 Can you try var dumping $cidvatsim after setting in on the first line? <?php $cidvatsim = PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); var_dump($cidvatsim); ?> What do you get? Quote Link to comment Share on other sites More sharing options...
Jetwave Posted February 21, 2017 Report Share Posted February 21, 2017 Is it possible to pull their VATSIM hours under a specific ICAO? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.