Jump to content

web541

Members
  • Posts

    700
  • Joined

  • Last visited

  • Days Won

    17

Everything posted by web541

  1. Do you mind telling us where you want to put the code and what information you want to have formatted?
  2. make sure that your orig.png file was named orig.png and that it is placed in the following directory public_html rotateimg
  3. This is possible, it might be worthwhile creating a module to do this, but otherwise there are a few charter flight systems out on these forums which you may want to look at adapting to your needs. Namely: http://www.simpilotgroup.com/module/chartersystem https://www.crazycreatives.com/downloads/charter-ops-extended/ http://forum.phpvms.net/topic/8045-charter-flight-system-v110-updated/
  4. To format a number, the first one was correct, but I believe you were getting an error because you haven't specified what the $number variable is. Try this <?php $number = 123456789; $format = number_format($number); echo $format; ?> If that still doesn't work, then try doing it straight from a number <?php $format = number_format("123456789"); echo $format; ?> To format the money easily in phpVMS just use this: <?php echo FinanceData::formatMoney(floatval(Auth::$userinfo->totalpay)); ?> To get the pay for the currently logged in user, otherwise change Auth::$userinfo->totalpay to another variable depending on where you want to put it.
  5. Make sure that your password for your database user inside the file of core/local.config.php is set properly. In regards to your table prefix question, you can change it upon setup via the installer, just change it from phpvms_ to userid_ local.config.php should look like this define('DBASE_USER', 'DATABASEUSERHERE'); define('DBASE_PASS', 'DATABASEPASSWORDHERE'); define('DBASE_NAME', 'DATABASENAMEHERE'); define('DBASE_SERVER', 'localhost'); // change localhost if your hosting uses a different server define('DBASE_TYPE', 'mysqli'); // if you're using Simpilot's phpvms 5.5.x use mysqli, otherwise use mysql define('TABLE_PREFIX', 'phpvms_'); // change phpvms_ to userid_ if you have setup all your tables that way Change DATABASEUSERHERE, DATABASEPASSWORDHERE, DATABASENAMEHERE to the correct information specified in cPanel (or similar)
  6. Make an image, name it orig.png On your server, make a folder in public_html called rotateimg Inside this folder, place the orig.png inside the folder called rotateimg make a new folder called rotate ----------------- Inside the rotateimg folder also place this script in a file called rotate.php <?php $count = 0; while ($count < 360){ $filename = 'orig.png'; $rotang = -$count; // Rotation angle $source = imagecreatefrompng($filename) or die('Error opening file '.$filename); imagealphablending($source, false); imagesavealpha($source, true); $rotation = imagerotate($source, $rotang, imageColorAllocateAlpha($source, 0, 0, 0, 127)); imagealphablending($rotation, false); imagesavealpha($rotation, true); header('Content-type: image/png'); imagepng($rotation, "rotate/{$count}.png"); imagedestroy($source); imagedestroy($rotation); $count = $count + 1; } ?> And then you should be able to run http://yourvaurl.com...eimg/rotate.php and then transfer & overwrite the images with the ones in lib/images/inair EDIT: Final folder layout should be this public_html // root folder rotateimg // folder orig.png //only image rotate.php // only php file rotate // folder
  7. Try this? <?php /** * These are some options for the ACARS map, you can change here * * By default, the zoom level and center are ignored, and the map * will try to fit the all the flights in. If you want to manually set * the zoom level and center, set "autozoom" to false. * * You can use these MapTypeId's: * http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId * * Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive * * Also, how to style the acars pilot list table. You can use these style selectors: * * table.acarsmap { } * table.acarsmap thead { } * table.acarsmap tbody { } * table.acarsmap tbody tr.even { } * table.acarsmap tbody tr.odd { } */ ?> <script type="text/javascript"> <?php /* These are the settings for the Google map. You can see the Google API reference if you want to add more options. There's two options I've added: autozoom: This will automatically center in on/zoom so all your current flights are visible. If false, then the zoom and center you specify will be used instead refreshTime: Time, in seconds * 1000 to refresh the map. The default is 10000 (10 seconds) */ ?> var myStyle = [{"featureType":"poi","elementType":"all","stylers":[{"hue":"#000000"},{"saturation":-100},{"lightness":-100},{"visibility":"off"}]},{"featureType":"poi","elementType":"all","stylers":[{"hue":"#000000"},{"saturation":-100},{"lightness":-100},{"visibility":"off"}]},{"featureType":"administrative","elementType":"all","stylers":[{"hue":"#000000"},{"saturation":0},{"lightness":-100},{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"hue":"#000000"},{"saturation":-100},{"lightness":-100},{"visibility":"off"}]},{"featureType":"road.local","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"on"}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"on"}]},{"featureType":"transit","elementType":"labels","stylers":[{"hue":"#000000"},{"saturation":0},{"lightness":-100},{"visibility":"off"}]},{"featureType":"landscape","elementType":"labels","stylers":[{"hue":"#000000"},{"saturation":-100},{"lightness":-100},{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"hue":"#bbbbbb"},{"saturation":-100},{"lightness":26},{"visibility":"on"}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"hue":"#dddddd"},{"saturation":-100},{"lightness":-3},{"visibility":"on"}]}] var acars_map_defaults = { autozoom: true, zoom: 4, center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"), mapTypeId: google.maps.MapTypeId.TERRAIN, refreshTime: 10000, styles: myStyle }; </script> <div class="mapcenter" align="center"> <div id="acarsmap" style="width:<?php echo Config::Get('MAP_WIDTH');?>; height: <?php echo Config::Get('MAP_HEIGHT')?>"></div> </div> <?php /* See below for details and columns you can use in this table */ ?> <table border = "0" width="100%" class="acarsmap"> <thead> <tr> <td><b>Pilot</b></td> <td><b>Flight Number</b></td> <td><b>Departure</b></td> <td><b>Arrival</b></td> <td><b>Status</b></td> <td><b>Altitude</b></td> <td><b>Speed</b></td> <td><b>Distance/Time Remain</b></td> </tr> </thead> <tbody id="pilotlist"></tbody> </table> <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script> <?php /* This is the template which is used in the table above, for each row. Be careful modifying it. You can simply add/remove columns, combine columns too. Keep each "section" (<%=...%>) intact Variables you can use (what they are is pretty obvious) Variable: Notes: <%=flight.pilotid%> <%=flight.firstname%> <%=flight.lastname%> <%=flight.pilotname%> First and last combined <%=flight.flightnum%> <%=flight.depapt%> Gives the airport name <%=flight.depicao%> <%=flight.arrapt%> Gives the airport name <%=flight.arricao%> <%=flight.phasedetail%> <%=flight.heading%> <%=flight.alt%> <%=flight.gs%> <%=flight.disremaining%> <%=flight.timeremaning%> <%=flight.aircraft%> Gives the registration <%=flight.aircraftname%> Gives the full name <%=flight.client%> FSACARS/Xacars/FSFK, etc <%=flight.trclass%> "even" or "odd" You can also use logic in the templating, if you so choose: http://ejohn.org/blog/javascript-micro-templating/ */ ?> <script type="text/html" id="acars_map_row"> <tr class="<%=flight.trclass%>"> <td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a></td> <td><%=flight.flightnum%></td> <td><%=flight.depicao%></td> <td><%=flight.arricao%></td> <td><%=flight.phasedetail%></td> <td><%=flight.alt%></td> <td><%=flight.gs%></td> <td><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%></td> </tr> </script> <?php /* This is the template for the little map bubble which pops up when you click on a flight Same principle as above, keep the <%=...%> tags intact. The same variables are available to use here as are available above. */ ?> <script type="text/html" id="acars_map_bubble"> <span style="font-size: 10px; text-align:left; width: 100%" align="left"> <a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a><br /> <strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br /> <strong>Status: </strong><%=flight.phasedetail%><br /> <strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br /> </span> </script> <?php /* This is a small template for information about a navpoint popup Variables available: <%=nav.title%> <%=nav.name%> <%=nav.freq%> <%=nav.lat%> <%=nav.lng%> <%=nav.type%> 2=NDB 3=VOR 4=DME 5=FIX 6=TRACK */ ?> <script type="text/html" id="navpoint_bubble"> <span style="font-size: 10px; text-align:left; width: 100%" align="left"> <strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br /> <strong>Type: </strong> <?php /* Show the type of point */ ?> <% if(nav.type == 2) { %> NDB <% } %> <% if(nav.type == 3) { %> VOR <% } %> <% if(nav.type == 4) { %> DME <% } %> <% if(nav.type == 5) { %> FIX <% } %> <% if(nav.type == 6) { %> TRACK <% } %> <br /> <?php /* Only show frequency if it's not a 0*/ ?> <% if(nav.freq != 0) { %> <strong>Frequency: </strong><%=nav.freq%> <% } %> </span> </script> Have to add this styles: myStyle
  8. Can you paste your whole acarsmap.tpl/.php here so I can take a look.
  9. Take a look at this: http://forum.phpvms.net/topic/22627-guide-changing-the-look-of-the-acars-map/#entry120282
  10. It has worked for me <?php // We are gonna loop each day of the week for($dayofweek = 0; $dayofweek < 7; $dayofweek++) { // echo our column opening echo '<td>'; $route->daysofweek = str_replace('7', '0', $route->daysofweek); // Check if $i (the current day of week) exists if(substr_count($route->daysofweek, $dayofweek) > 0) { // there is a flight for sunday , so echo that plane icon out echo 'imagehere'; } // Close that column echo '</td>'; } ?> By default, phpvms changes the days of week to 0123456 (0 = Sunday), If you've got Sunday by itself as "7", then use your code above and it should work. If it's still not showing as required, then check the daysofweek column in your database and verify that the numbers are either "0123456" or "1234567".
  11. Hey CitationCJ, I managed to find this somewhere on these massive forums a while back <tr> <?php // We are gonna loop each day of the week for($dayofweek = 0; $dayofweek < 7; $dayofweek++) { // echo our column opening echo '<td>'; // Check if $i (the current day of week) exists if(substr_count($route->daysofweek, $dayofweek) > 0) { // there is a flight for sunday , so echo that plane icon out echo 'imagehere'; } // Close that column echo '</td>'; } ?> </tr> Feel free to edit the code as required (e.g. removing <td>/<tr> is not in table, etc.) Pseudo code I believe
  12. You can display the airline by name like this: <?php $aname = OperationsData::getAirlineByCode($route->code); ?> Make sure you change $route->code to the right variable used in your foreach statement (e.g. $schedule->code) Then this should be available <?php echo $aname->name; ?>
  13. did you put this at the top of the page where you want it? So it loads before anything else. <?php require('core/codon.config.php'); ?> and make sure you change core/codon.config.php if it's in a sub folder.
  14. Yes, do what Zumeweb suggested above and give us a pastebin of your .htaccess file. Also, what you could try is, removing the .htaccess file before installing then adding it after the make sure that that file is the problem and also check your php error logs to see if it's picking up anything to do with your code. (error_log file)
  15. I assume that you want it to be on your front page where phpVMS is not installed. Try including the phpvms config file like this <?php require('core/codon.config.php'); ?> Make sure that the above directory is correct (a.k.a not inside another folder, then you will have to change this location) and then use the code suggested above <?php MainController::Run('ACARS', 'index'); ?> Where ever you want the map to show up.
  16. Make sure your database connection has been set up correctly. If it is, then go into the folder of core/ and find the file called local.config.php And open it up and make sure it is completely empty (or just delete it)
  17. The first two, go to core/common/ExamsData.class.php and change the following public function get_setting_info($id) { $query = "SELECT * FROM ".TABLE_PREFIX."exams_settings WHERE id='$id'"; return DB::get_row($query); } public function get_exams() { $query = "SELECT * FROM ".TABLE_PREFIX."exams WHERE active='1' ORDER BY cost ASC"; return DB::get_results($query); } to public static function get_setting_info($id) { $query = "SELECT * FROM ".TABLE_PREFIX."exams_settings WHERE id='$id'"; return DB::get_row($query); } public static function get_exams() { $query = "SELECT * FROM ".TABLE_PREFIX."exams WHERE active='1' ORDER BY cost ASC"; return DB::get_results($query); } and you may as well change then all to 'static' to avoid future issues. Third Issue: go to core/templates/exams and change all .tpl files to .php Fourth Issue: Make sure you are going to YOURSITEURL/index.php/Exams_admin not just /Exams and make sure you have uploaded all the files correctly. I've made some amendments to this here, but not sure if it will work (and I can't offer any support). Just as an example of what I have said to do above.
  18. yes put this whole thing /* Keys for recaptcha, you can change these if you want to your own but it's a global key so it should just work */ Config::Set('RECAPTCHA_PUBLIC_KEY', 'PASTEPUBLICKEYHERE'); Config::Set('RECAPTCHA_PRIVATE_KEY', 'PASTEPRIVATEKEYHERE'); and edit the PASTEPUBLICKEYHERE and PASTEPRIVATEKETHERE to match the ones you just got from Google. And put it preferably a line or two before this one # Page encoding options And make sure it's after the <?php because I suspect that's why your page went white.
  19. This has been posted around many times before. Go to here http://www.google.com/recaptcha/intro/index.html get another site key for your website then go into your core/local.config.php and copy the following (if it's not already there) /* Keys for recaptcha, you can change these if you want to your own but it's a global key so it should just work */ Config::Set('RECAPTCHA_PUBLIC_KEY', 'PASTEPUBLICKEYHERE'); Config::Set('RECAPTCHA_PRIVATE_KEY', 'PASTEPRIVATEKEYHERE'); and edit the PASTEPUBLICKEYHERE and PASTEPRIVATEKETHERE to match the ones you just got from Google. Source: ------------------- http://forum.phpvms.net/topic/22280-recaptcha-problem/ http://forum.phpvms.net/topic/22870-catcha-error/
  20. It works for me with https, check your site url in lib/js/simbrief.apiv1.js core/templates/schedule_briefing.tpl/.php or lib/skins/YOURSKIN/schedule_briefing.tpl/.php
  21. .htaccess should be in the root of your site (public_html) and make sure you have installed phpVMS into your public_html folder
  22. I'm getting this error Failed to load resource: the server responded with a status of 403 (Forbidden) in the console, so check the permissions for your installation. Also check that your .htaccess file is not conflicting with anything
  23. You probably need to install phpVMS from here https://github.com/DavidJClark/phpvms_5.5.x Otherwise do a search http://forum.phpvms.net/topic/20629-most-common-fixes-phpvms-installation/
×
×
  • Create New...