Gabriel Fernandez Posted June 9, 2010 Report Share Posted June 9, 2010 Hello guys, I have a great suggestion to be applied in phpvms. My friend sent me a code to my application for dynamic signatures (http://www.starflightvirtual.com.br/ credits) and I tried but I could not adapt it to our vms. I noticed that our signature (background) the codes are located in pilotdata.class from what I remember. Well I'll be leaving here the code of the signature dynamics transforming for someone to be our platform. For those who do not know what would be a signature dynamics, it's the explanation: it is a sign that connects to the db and FSACARS and so this signing as an ACARS shows some images of every moment of the flight, taxiing, climbing, cruise, and all the situations of a flight, I already did mine, I'll be leaving here to look. Grateful, waiting for an answer. <?php //error_reporting(0); //CODIGO PROJETADO por Ian D. (Lucas Roquefort) para STARFLIGHT AVIATION VIRTUAL //http://starflightvirtual.com.br //antes de alterar ou publicar peça autorizaçao do autor!!! //$base=$_GET['base']; $id=$_GET['id']; //$nome=$_GET['nome']; $hostName = "localhost"; header("Content-type: image/png"); /* CHANGE THESE LINES BELOW TO YOUR DETAILS */ $userName = ""; $password = ""; $dbName = ""; /* make connection to database */ mysql_connect($hostName, $userName, $password) or die("Unable to connect to host $hostName"); mysql_select_db($dbName) or die("Unable to select database $dbName"); $idn=str_replace(array("STA"), "", $id); $sql = "SELECT lat, lon, alt, gs, IATA, phase, timeDestApt, depAptICAO, destAptICAO FROM positions WHERE pilot_num='$idn' AND last_update > DATE_SUB( NOW() , INTERVAL 15 MINUTE )"; $result = mysql_query( $sql ); $dados = mysql_fetch_assoc($result); @$eta = mysql_result($result,0, "timeDestApt"); @$dep = mysql_result($result,0, "depAptICAO"); @$dest = mysql_result($result,0, "destAptICAO"); $sql = "SELECT * FROM phpbb_profile_fields_data p, phpbb_users u WHERE p.user_id = u.user_id AND pilot_num = '$id'"; $result = mysql_query( $sql ); $nome = mysql_result($result,0,"pf_realname"); $SAVID = mysql_result($result,0,"SAVID"); $query_hours = "SELECT sec_to_time(sum(time_to_sec(t2.duration))) AS duration_sum FROM phpbb_users t1, reports t2 WHERE t1.SAVID=$SAVID AND t1.SAVID=t2.SAVID"; $result_hours = mysql_query($query_hours); $time = mysql_result($result_hours,0,"duration_sum"); if (mysql_num_rows($result) == 0) { ($im = ImageCreateFromPng("imagens/off.png")); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 435, 102, "$time", $corTexto); } elseif ($dados['phase'] == 1 ) { $im = ImageCreateFromPng("imagens/embarque.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); imagestring($im, 3, 250, 102, "$eta", $corTexto); // Boarding } elseif ($dados['phase'] == 2 ) { $im = ImageCreateFromPng("imagens/taxiparapista.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); imagestring($im, 3, 250, 102, "$eta", $corTexto); // Taxi From Gate } elseif ($dados['phase'] == 3 ) { $im = ImageCreateFromPng("imagens/decolando.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto); // Departing } elseif ($dados['phase'] == 4 ) { $im = ImageCreateFromPng("imagens/subida.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto); // Climbing } elseif ($dados['phase'] == 5 ) { $im = ImageCreateFromPng("imagens/cruzeiro.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto); // Cruising } elseif ($dados['phase'] == 6 ) { $im = ImageCreateFromPng("imagens/descida.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto); // Descending } elseif ($dados['phase'] == 7 ) { $im = ImageCreateFromPng("imagens/pousando.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); imagestring($im, 3, 245, 102, "$eta - $alt", $corTexto); // Landed } elseif ($dados['phase'] == 8 ) { $im = ImageCreateFromPng("imagens/taxiparagate.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); //imagestring($im, 3, 250, 102, "$eta", $corTexto); // Taxi To Gate } elseif ($dados['phase'] == 9 ) { $im = ImageCreateFromPng("imagens/desembarque.png"); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 430, 102, "$dep/$dest", $corTexto); //imagestring($im, 3, 250, 102, "$eta", $corTexto); // Arrived at Gate } else { ($im = ImageCreateFromPng("imagens/off.png")); $corTexto = imagecolorallocate($im, 255, 255, 255); imagestring($im, 3, 5, 102, "$id - $nome", $corTexto); imagestring($im, 3, 435, 102, "$time", $corTexto); } imagepng($im); imagepng($im, "$id.png"); imagedestroy($im); ?> Quote Link to comment Share on other sites More sharing options...
Artjom Posted June 10, 2010 Report Share Posted June 10, 2010 This is a good idia! At the time I'm make output to signature (Phase Status)Â And I've a question how can I maka a dynamic signature? i need the code for these. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 10, 2010 Administrators Report Share Posted June 10, 2010 Very cool idea, I have downloaded this and am working on it. Quote Link to comment Share on other sites More sharing options...
skymx Posted June 10, 2010 Report Share Posted June 10, 2010 I will take a look at it, and see what I can get... Thanks a lot, nice! SK Quote Link to comment Share on other sites More sharing options...
Artjom Posted June 10, 2010 Report Share Posted June 10, 2010 I've created a output Phasedetail! here is the code <?php     $acars = ACARSData::get_flight_by_pilot($userinfo->pilotid); ?> <?php echo $acars->phasedetail; ?> It works perfect! I needed the dynamic signature I've create this code: if($status->old <> $status->new) { pilotdata::regeneratesiggy($pilot->id);} Output working perfect in signature, but regenarating doesn't work... here is a status (Test): http://live-mix.ath....ures/KNI001.png   (at the left bottom) Quote Link to comment Share on other sites More sharing options...
Gabriel Fernandez Posted June 10, 2010 Author Report Share Posted June 10, 2010 ok, thanks for work's wainting for a beta version, Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 10, 2010 Administrators Report Share Posted June 10, 2010 Guys, I think I have figured out what you are trying to do. I have created a module that creates a "status" image depending on the pilots current flight status. It is similar to the vatsim indicators function except it is tied to the phpvms system. What I have done, Get all pilots and check to see if there is acars data available if there is acars data available check and see if it is more than 10 minutes old if it is current create a "online" status indicator image with the pilot name, id , flight, and phase detail from acars if it is more than 10 min old create a "offline" status indicator image with the pilot name, id , flight, and phase detail (should be Arrived) from acars In the case there is no acars data look for the last pirep if there is a pirep use the newest one to create a "offline" status indicator image with the pilot name, id , last flight, and the date it was filed as "Last Seen" if there are no PIREPS filed for the pilot create a "offline" image showing the pilot name and pid and the text "No Flights Filed" This is all seperate from the signature badges. Is this what you are thinking. This is what I get.... http://www.westjetvirtual.net/index.php/Status/show_all Quote Link to comment Share on other sites More sharing options...
Artjom Posted June 10, 2010 Report Share Posted June 10, 2010 Guys, I think I have figured out what you are trying to do. I have created a module that creates a "status" image depending on the pilots current flight status. It is similar to the vatsim indicators function except it is tied to the phpvms system. What I have done, Get all pilots and check to see if there is acars data available if there is acars data available check and see if it is more than 10 minutes old if it is current create a "online" status indicator image with the pilot name, id , flight, and phase detail from acars if it is more than 10 min old create a "offline" status indicator image with the pilot name, id , flight, and phase detail (should be Arrived) from acars In the case there is no acars data look for the last pirep if there is a pirep use the newest one to create a "offline" status indicator image with the pilot name, id , last flight, and the date it was filed as "Last Seen" if there are no PIREPS filed for the pilot create a "offline" image showing the pilot name and pid and the text "No Flights Filed" This is all seperate from the signature badges. Is this what you are thinking. This is what I get.... http://www.westjetvi...Status/show_all Hello simpilot! yes this is it! can you give us your script? Quote Link to comment Share on other sites More sharing options...
Gabriel Fernandez Posted June 12, 2010 Author Report Share Posted June 12, 2010 any code? Quote Link to comment Share on other sites More sharing options...
Gabriel Fernandez Posted June 16, 2010 Author Report Share Posted June 16, 2010 any!??? Quote Link to comment Share on other sites More sharing options...
dimitris Posted June 28, 2010 Report Share Posted June 28, 2010 a code please Quote Link to comment Share on other sites More sharing options...
Artjom Posted June 28, 2010 Report Share Posted June 28, 2010 code please!!!! Quote Link to comment Share on other sites More sharing options...
IDR Posted October 23, 2010 Report Share Posted October 23, 2010 Hy, I'm Lucas Roquefort and the developer of this code. So, for any problem i'm here. bye Lucas Roquefort VATBRZ5 - VATSIM Brasil STARFLIGHT virtual http://starflightvirtual.com.br Azul Linhas Aéreas Virtuais http://www.voeazulvirtual.com.br Quote Link to comment Share on other sites More sharing options...
Silas Posted November 19, 2010 Report Share Posted November 19, 2010 code please!!!! Quote Link to comment Share on other sites More sharing options...
4961301 Posted December 9, 2010 Report Share Posted December 9, 2010 Heey people, I'm almost there ;] But I'm thinking if I'll sell this or not Joking E aaai gaalera :] Depois de horas de teste e taalz, acho que finalmente consegui :] Mais alguns ajustes e boa! Mas to pensando em cobrar por esse add-on eim Bricadeira. Quote Link to comment Share on other sites More sharing options...
mattia Posted December 11, 2011 Report Share Posted December 11, 2011 where I put this code? Quote Link to comment Share on other sites More sharing options...
CN@ndo Posted December 27, 2011 Report Share Posted December 27, 2011 Please. where I put this code? Tks 1 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.