web541
Members-
Posts
700 -
Joined
-
Last visited
-
Days Won
17
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by web541
-
There aren't any available on phpvms. Someone tried to make one a while back, but it got taken down due to copyright infringement. I have made one before and it works like a charm! If you are willing to try it yourself, the following will get you started. http://forum.phpvms.net/topic/21990-editing-the-admin-skin-solved/#entry117689 http://forum.phpvms.net/topic/23046-extracting-the-dashboard-pirep-data/ http://forum.phpvms.net/topic/23055-vacentral-pireps-to-export-wont-display-when-inside-another-div/ And here's what can be accomplished http://forum.phpvms.net/topic/18877-admin-centre-skin/ It is a lot like skinning the main site.
-
[Help/Request] Using Chart.js to replace default charts.
web541 replied to TechAttax's topic in Development Help
Where would you find that map? (Vataware?) -
try flown_routes_map.php . I had the same problem, it seemed obvious that it would be route_map, but no. *If you are looking to change the style of the map instead of the default, Go to https://snazzymaps.com/ and find a map you like, then Replace var map = new google.maps.Map(document.getElementById("routemap"), options); With this var styles = PASTESTYLEHERE // Create a new StyledMapType object, passing it the array of styles, // as well as the name to be displayed on the map type control. var styledMap = new google.maps.StyledMapType(styles, {name: "Flight Map"}); // Create a map object, and include the MapTypeId to add // to the map type control. var mapOptions = { zoom: 11, center: new google.maps.LatLng(55.6468, 37.581), mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style'] } }; var map = new google.maps.Map(document.getElementById('routemap'), mapOptions); //Associate the styled map with the MapTypeId and set it to display. map.mapTypes.set('map_style', styledMap); map.setMapTypeId('map_style'); and replace PASTESTYLEHERE with your Javascript Style Array from snazzymaps
-
[Help/Request] Using Chart.js to replace default charts.
web541 replied to TechAttax's topic in Development Help
I've never done it using Charts.js, but I've used Morris Charts before. - You could probably tweak it for charts.js What I did was put the following in core/modules/Pilots/Pilots.php public function morrisstatsbymonthdata() { $data = PIREPData::getIntervalDataByMonth(array('p.pilotid'=>Auth::$userinfo->pilotid), 3); header("Content-type: application/json"); echo json_encode($data); } public function morrisstatsaircraftdata($pilotid) { $data = StatsData::PilotAircraftFlownCountsMorris($pilotid); header("Content-type: application/json"); echo json_encode($data); } core/common/StatsData.class.php public static function PilotAircraftFlownCountsMorris($pilotid) { $key = 'ac_flown_counts_1_'.$pilotid; $counts = CodonCache::delete($key); if($counts === true) { //Select aircraft types $sql = 'SELECT a.name AS label, COUNT(p.aircraft) AS value, SUM(p.flighttime) AS hours FROM '.TABLE_PREFIX.'pireps p, '.TABLE_PREFIX.'aircraft a WHERE p.aircraft = a.id AND p.pilotid='.intval($pilotid).' GROUP BY a.name'; $counts = DB::get_results($sql); CodonCache::write($key, $counts, 'medium'); } return $counts; } If your using phpvms 5.5.x core/common/StatsData.class.php public static function PilotAircraftFlownCountsMorris($pilotid) { $key = 'ac_flown_counts_1_'.$pilotid; $counts = CodonCache::delete($key); if($counts === false) { //Select aircraft types $sql = 'SELECT a.name AS label, COUNT(p.aircraft) AS value, SUM(p.flighttime) AS hours FROM '.TABLE_PREFIX.'pireps p, '.TABLE_PREFIX.'aircraft a WHERE p.aircraft = a.id AND p.pilotid='.intval($pilotid).' GROUP BY a.name'; $counts = DB::get_results($sql); CodonCache::write($key, $counts, 'medium'); } return $counts; } And here's my core/templates/profile_stats.tpl/php (should really be in lib/skins/XXX/profile_stats.tpl/php) <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script> <h3>Your Stats</h3> <?php /* Added in 2.0! */ $chart_width = '800'; $chart_height = '250'; /* Don Not need to change anything below this here */ ?> <div align="center" style="width: 100%;"> <div id="monthdata" style="height: 250px;"></div> </div> <br /> <div align="center" style="width: 100%;"> <div id="aircraftdata" style="height: 250px;"></div> </div> <script type="text/javascript"> var json = (function () { var json = null; $.ajax({ 'async': false, 'global': false, 'url': "<?php echo actionurl('/pilots/morrisstatsbymonthdata');?>", 'dataType': "json", 'success': function (data) { json = data; } }); return json; }) (); new Morris.Line({ // ID of the element in which to draw the chart. element: 'monthdata', // Chart data records -- each entry in this array corresponds to a point on // the chart. data: json, // The name of the data record attribute that contains x-values. xkey: 'ym', // A list of names of data record attributes that contain y-values. ykeys: ['total'], // Labels for the ykeys -- will be displayed when you hover over the // chart. labels: ['Flights'] }); </script> <script type="text/javascript"> var json = (function () { var json = null; $.ajax({ 'async': false, 'global': false, 'url': "<?php echo actionurl('/pilots/morrisstatsaircraftdata/'.Auth::$userinfo->pilotid.'');?>", 'dataType': "json", 'success': function (data) { json = data; } }); return json; }) (); Morris.Donut({ element: 'aircraftdata', data: json }); </script> The end result http://imgur.com/wyb2lUz Thanks to Vangelis for providing most of the base code. -
You can find your captcha key in local.config.php or app.config.php under this Config::Set('RECAPTCHA_PUBLIC_KEY', 'KEY');
-
Have you checked out this very informative tutorial? http://forum.phpvms.net/topic/16736-tutorial-using-htmlcss-templates-with-phpvms/
-
It should work out of the box, but you could try going into PopUpNewsData.class.php and changing these public function popupnewsitem($id) public function get_news_list($howmany) { To these public static function popupnewsitem($id) public static function get_news_list($howmany) {
-
What php/vms version are you running it on?
-
need help_can not run install.php in paid hosting
web541 replied to ifsagadina's topic in Support Forum
Try going to your actual URL (http) and not via ftp:// and run the installer again and see if that works -
Try going into your admin/action.php and finding this line error_reporting(E_ALL ^ E_NOTICE); And replace it with this line ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); And see if that fixes it
-
In your other post you mentioned that the jquery version is conflicting between the one compatible with phpVMS and the one in your skin, I tried the following and it seems to work without breaking the skin, you will get an error in firebug stating that you need jquery 1.9.1 or higher for bootstrap, but from what I can see, nothing has broken yet and this also brings back functionality of the accepting/rejecting PIREPS and viewing the Pilots/schedules which weren't possible with your version of jquery. ... Go into your admin/lib/layout/footer.php and find these lines: <!-- jQuery 2.1.4 --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <!-- jQuery UI 1.11.4 --> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> and then move them into admin/templates/core_htmlhead.php so that it is read on every page Once done, change the jquery version to an earlier one which is compatible with phpVMS in this case I've tried it with 1.8.3 and the skin hasn't broken So you should end up like this <!-- jQuery 2.1.4 --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <!-- jQuery UI 1.11.4 --> <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> In your admin/templates/core_htmlhead.php If you do need some bootstrap functions (e.g. dropdowns), then you may need to change a few core files which isn't recommended. Otherwise you can google newer versions of the javascript files e.g. jquery.jqgrid.min.js, etc.) and place them into the corresponding position in the phpvms layout (lib/js...) and then replace the above code with a newer version of jQuery (e.g. 1.11.3) And to fix your log-on-refresh issue, open bootstrap.js and before your last }(jQuery); (very end of the page) and then put this there // Clear Modal On Hide // =================== // no cache data loaded to modal popup (by default it's cached) $('body').on('hidden.bs.modal', '.modal', function (event) { $(this).removeData('bs.modal'); }); Then change all your references of bootstrap.min.js to bootstrap.js unless you want to minify it first.
-
In regards to your import, try and reupload import.php in admin/modules/import For your airport schedules problem, it has been answered a number of times http://forum.phpvms.net/topic/22952-adding-airports-problem/#entry121431
-
Found Here https://github.com/n...s.class.php#L99 or here if your on phpvms 5.5.x https://github.com/D...s.class.php#L78
-
http://forum.phpvms.net/topic/22952-adding-airports-problem/#entry121431
-
If you go to your admin panel, then to site & settings then to profile fields and select Show In User Profile. If you don't have the code for that, then verify that you've spelt the field correctly and put this <?php $fieldvalue1 = PilotData::GetFieldValue($userinfo->pilotid, 'STATION_CALLSIGN'); ?> <?php echo $fieldvalue1; ?> Because the above code works for me. And in regards to your last question, as long as you have got information for the user you are logged in as, it will show.
-
Has you got some information for STATION_CALLSIGN in your admin panel for your pilot?
-
Oh, I forgot to mention that you have to echo the variable out, so <?php echo $fieldvalue; ?>
-
If you want it on your Pilot Roster, try this <?php $fieldvalue = PilotData::GetFieldValue($pilot->pilotid, 'FIELDNAMEHERE'); ?> If you want it in your Profile Page, try this <?php $fieldvalue = PilotData::GetFieldValue($userinfo->pilotid, 'FIELDNAMEHERE'); ?>
-
Was it working before you installed this module? Can you check to see if the PIREP actually filed and verify that your smartCARS web scripts have been installed in the appropriate location.
-
Or if you want some standard colors then bootstrap already has them integrated. alert alert-success is green alert alert-warning is yellow alert alert-info is blue alert alert-danger is red If you wanted a custom color, then just edit the line above in vbegin7's post or copy and paste it in your CSS file to override it. http://getbootstrap.com/components/#alerts
-
No worries Kim, In regards to your other two questions, The route map, as I said above, I'm not sure, you may have to contact the developer of that addon As for the pilot badge, there are a number of settings which you can change, copy and edit the following into your local.config.php file found in core/local.config.php # Options for the signature that's generated Config::Set('SIGNATURE_TEXT_COLOR', '#000'); Config::Set('SIGNATURE_USE_CUSTOM_FONT', true); Config::Set('SIGNATURE_FONT_PATH', SITE_ROOT.'/lib/fonts/tahoma.ttf'); Config::Set('SIGNATURE_FONT_SIZE', '10'); Config::Set('SIGNATURE_X_OFFSET', '10'); Config::Set('SIGNATURE_Y_OFFSET', '17'); Config::Set('SIGNATURE_FONT_PADDING', 4); Config::Set('SIGNATURE_SHOW_EARNINGS', true); Config::Set('SIGNATURE_SHOW_RANK_IMAGE', true); Config::Set('SIGNATURE_SHOW_COPYRIGHT', true); If you want to change the color of the font to white, change it to #ffffff not just #fff (red)
-
Hello Kim, 1. To delete airports you will have to go to your hosting account then go to phpmyadmin or similar (into the sql database basically) and then find the table phpvms_airports. Once in there, you may delete each one you don't need, bare in mind though, each one you delete will break any PIREP that has been filed on that airport. 2. I have never owned this map, however with just a little look, go to core/templates/AirlineMap.tpl/.php (or where ever the AirlineMap template file is) then find this link <script type="text/javascript" src="http://braathensvirtual.no/core/modules/AirlineMap/js/markerwithlabel.js"></script> or similar and then go to your hosting again, go to file manager (or via FTP, whichever works for you) and go to core/modules/AirlineMap/js/markerwithlabel.js and move it to lib/js (so that's your first directory where you see core, admin, lib etc.) Once you've done that, go to your template file again and replace <script type="text/javascript" src="http://braathensvirtual.no/core/modules/AirlineMap/js/markerwithlabel.js"></script> with this <script type="text/javascript" src="<?php echo SITE_URL?>/lib/js/markerwithlabel.js"></script> And see if that works, if not, you may have to move it above in the </head> section with the other javascript references. 3. If you go to lib/signatures/background and find the file called "background.png" then you can use that as a guide on the size, etc. and then when you have your new pilot badge, name it background.png and re-upload it to the lib/signatures/background folder and replace the other one. Once done, go to the admin panel and then go to "Site & Settings" and go to Maintenance. Then click reset signatures and it should have reset. 4. You can do this one of two ways, you can either go to admin/pages and make a new page, then copy the URL from that page and go back into your lib/skins/bra folder and find the file "core_navigation.tpl/.php" file and open it up in your code editor(or Notepad) and go and add a line where you want it like this <li><a href="PASTEYOURLINKHERE">PAGENAME</a></li> Or you can make a simple module by looking at the following post http://forum.phpvms....odules-and-mvc/ And then going back into your lib/skins/bra/core_navigation file and adding a new line where you want it like this <li><a href="<?php echo url('/modulenamehere'); ?>">PAGENAME</a></li>
-
With your code, it seems that it is returning the URL as you have not specified any action for it. As a quick solution, try an anchor <a data-toggle="modal" class="btn btn-primary btn-lg" href="<?php echo SITE_URL?>/admin/action.php/pirepadmin/viewlog?pirepid=<?php echo $pirep->pirepid;?>" data-target="#myModal">Log</a> <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Log for <?php echo $report->code.$report->pirepid?></h4> </div> <div class="modal-body"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div> See if that works
-
I may have found a solution to your problem, I have a feeling that it is not that the vaCentral Status wouldn't show up in the div, it's because I'm assuming the first block of code you have used was all put into the header.php file. What I did was separate the code into their own files and found out that because you had tried to put that status in your header file, it wasn't loading properly, but if you put it in your admin/templates/dashboard.php file (or the skin folder if you did this http://forum.phpvms....in-skin-solved/ ) it seems to work admin/lib/layout/header.php admin/templates/dashboard.php The rest of the code you provided (core_htmlhead.php and footer.php) worked as normal.
-
Try this <?php echo StatsData::PilotCount(); ?>