MrAmsterdam Posted August 17, 2010 Report Posted August 17, 2010 Hi guys, I would like to add our rank (serious-airlines.com) to my phpvms website for our members to quickly see the rank that we are at that specific moment. is this possible? Regards, Lucas Quote
Administrators Nabeel Posted August 17, 2010 Administrators Report Posted August 17, 2010 Yes, I just added an XML feed, and to access it, get your VA central page, and add /xml to the end of the URL: IE: http://www.vacentral.net/airline/cva_canadianvirtualairlines/xml Then you can call it in phpVMS: <?php $cws = new CodonWebService(); $xml = $cws->get('YOUR VACENTRAL XML URL'); $xml = simplexml_load_string($xml); echo "Our airline's rank is {$xml->rank}"; ?> Moving this to code snippets... 1 Quote
MrAmsterdam Posted August 17, 2010 Author Report Posted August 17, 2010 Yes, I just added an XML feed, and to access it, get your VA central page, and add /xml to the end of the URL: IE: http://www.vacentral.net/airline/cva_canadianvirtualairlines/xml Then you can call it in phpVMS: <?php $cws = new CodonWebService(); $xml = $cws->get('YOUR VACENTRAL XML URL'); $xml = simplexml_load_string($xml); echo "Our airline's rank is {$xml->rank}"; ?> Moving this to code snippets... wow... thanks! Quote
Moderators joeri Posted August 17, 2010 Moderators Report Posted August 17, 2010 working like a charm www.tnt-virtual.be Quote
MrAmsterdam Posted August 18, 2010 Author Report Posted August 18, 2010 Jups.. works fine baby!! :-) WOOOHOOOOOO! Quote
Txmmy83 Posted September 10, 2010 Report Posted September 10, 2010 Yes, I just added an XML feed, and to access it, get your VA central page, and add /xml to the end of the URL: IE: http://www.vacentral.net/airline/cva_canadianvirtualairlines/xml Then you can call it in phpVMS: <?php $cws = new CodonWebService(); $xml = $cws->get('YOUR VACENTRAL XML URL'); $xml = simplexml_load_string($xml); echo "Our airline's rank is {$xml->rank}"; ?> Moving this to code snippets... where should I post this code to make it show up on site? Best Regards Thomas Quote
TAV1702 Posted September 11, 2010 Report Posted September 11, 2010 You can put it anywhere you want on a tpl file. I chose to put mine on the front page in a box on the left side of the page. Quote
Txmmy83 Posted September 11, 2010 Report Posted September 11, 2010 Thank you very much for quick reply will probably put the Rank below the recent PIREP in my sidebar Best Regards Thomas Quote
TAV1702 Posted September 11, 2010 Report Posted September 11, 2010 Thank you very much for quick reply will probably put the Rank below the recent PIREP in my sidebar Best Regards Thomas No Probs. I hope it works out for you. It seems to be good to go on my site. I used the code that was provided here. Quote
James142 Posted September 30, 2010 Report Posted September 30, 2010 (edited) [removed] Edited September 2, 2011 by James142 Quote
flyalaska Posted February 27, 2011 Report Posted February 27, 2011 Is it possible to change the font size? Quote
greertr Posted March 1, 2011 Report Posted March 1, 2011 Is it possible to change the font size? Here's one way, Eddie... echo "<div style='text-align: center; font-weight: bold; font-size: 500%; color: #FF9900'> {$xml->rank} </div>"; demo url: Virtual Sim eXtremev VSX Web Site (note: I have it displayed on the bottom left of my main web page) Quote
flyalaska Posted March 1, 2011 Report Posted March 1, 2011 That's exactly what I am looking for. Thank you! Quote
llju1 Posted May 26, 2011 Report Posted May 26, 2011 (edited) I am a bit confused. How do you add a xml feed to you site? Silly question I am sure but it has been a while since I have done much it he way of coding. Well a few months anyways Thanks Lloyd Got it fixed duh so simple Thanks Edited May 26, 2011 by llju1 Quote
Colin Posted June 17, 2012 Report Posted June 17, 2012 Yes, I just added an XML feed, and to access it, get your VA central page, and add /xml to the end of the URL: IE: http://www.vacentral.net/airline/cva_canadianvirtualairlines/xml Then you can call it in phpVMS: <?php $cws = new CodonWebService(); $xml = $cws->get('YOUR VACENTRAL XML URL'); $xml = simplexml_load_string($xml); echo "Our airline's rank is {$xml->rank}"; ?> Moving this to code snippets... Where do I put the XML code at the end of the URL on VA Central ? if so I did this and it didn't work Quote
flyalaska Posted June 17, 2012 Report Posted June 17, 2012 Put the entire code where ever you want to display it. Example. <?php $cws = new CodonWebService(); $xml = $cws->get('http://www.vacentral.net/airline/cva_canadianvirtualairlines/xml'); $xml = simplexml_load_string($xml); echo "Our airline's rank is {$xml->rank}"; ?> Replace the VACentral URL with your VA's VACentral URL. Quote
josh90 Posted January 18, 2013 Report Posted January 18, 2013 Great piece of code! Just one question, is there anyway of showing the total amount of airline ranks, for example: Our airline is rank X out of (Total airlines) Thanks Josh Quote
flyalaska Posted October 18, 2015 Report Posted October 18, 2015 Great piece of code! Just one question, is there anyway of showing the total amount of airline ranks, for example: Our airline is rank X out of (Total airlines) Thanks Josh I would like that too Quote
Administrators simpilot Posted October 18, 2015 Administrators Report Posted October 18, 2015 I would like that too I have added it to the feed. $xml->total_airlines It is only active airlines, not the total count. Quote
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.