Jump to content

markusr

Members
  • Posts

    54
  • Joined

  • Last visited

Posts posted by markusr

  1. It is not a fix to ACARS. It is a fix to the ACARS map template. If you install this you should be able to click on an aircraft and if there is a route it should be displayed.

    (Just to clear up any confusion :D )

    Like this.....

    post-451-037049200 1291072180_thumb.jpg

    Hello,

    will it show the route thet the pilot entered in XACARS, or the route that is stored in the DB to the flight?

    In our chase we don't have routes stored, the pilot can book an aircraft and enter Depature and Destination airport in XACARS as well as the route.

    Thanks for an answer,

    Mark

  2. Hello,

    I got notified from a pilot today, that he is getting the same message as Mark described.

    I looked in the en.lang.php and saw, that the line 31 is exactly the same as you have posted here.

    I am running 2.1.944 release.

    /* Email stuff */
    'email.inuse'						=> 'This email address is already in use',
    'email.register.accepted.subject'	=> 'Your registration was accepted!',
    'email.register.rejected.subject'	=> 'Your registration was denied!',
    'email.pilot.retired.subject'		=> SITE_NAME.': You\'ve been marked as retired',
    

    it must be another issue....

  3. Hi,

    yes around 80 Pireps are logged. The fleet module is working when I don't try to filter only the enabled aircraft. If I add the filter for the enabled aircraft, the script stops working.

  4. Yes, they are enabled. Schedules are existant, but without dep/arr airport. They were delted in the database directly, so that you can book an aircraft, but not a specific route.

    ajs_sched.jpg

    and the fleet:

    ajs_fleet.jpg

  5. Hi,

    I have just tried replacing the sql script, but I get the same error:

    Warning: Invalid argument supplied for foreach() in /var/www/web97/html/phpvms/core/templates/fleet_table.tpl on line 4 

    I have only 5 aircraft for our business VA fleet.

  6. Hello,

    I have just updated to this 944 release.

    But the rank image is not showing up in the signature.

    I always get the error when updating the profile:

    Warning: imagecreatefromstring(): Empty string or invalid image in /var/www/web97/html/markus/phpvms/core/common/PilotData.class.php on line 1104

    The line says:$rankimg = imagecreatefromstring($rankimg);

    The images are showing up in the roster as well in the the pilot profile.

    The ranks are in gif format, but I have also tried it with JPG.

    thanks,

    Markus

    EDIT: I have only uploaded the changed files to the server. Do I need to upload all files from the compressed file?

    Edit again: I have now uploaded all files from the package and executed the update.php, but same error.

  7. Hi,

    here is the whole fleet.php

    <?php
    
    
    
    class Fleet extends CodonModule 
    {
    
           public function index()
           {
           $fleet = self::FleetInfo();
           Template::Set('fleet', $fleet);
           Template::Show('fleet_table.tpl');
    
           }
           /**
           * Return all possible information about the fleet
           * Code by Mitchell W
           * Enhanced by Stu (stuartpb)         
           * Fleet Table 2.0                            
           */
           public static function FleetInfo()
           {
       $sql = 'SELECT a.*, a.name AS aircraft,
         COUNT(p.pirepid) AS routesflown,
         SUM(p.distance) AS distance,
         SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
         AVG(p.distance) AS averagedistance,
         AVG(p.flighttime) as averagetime
         FROM   '.TABLE_PREFIX.'aircraft a
         WHERE a.enabled = 1
         LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
         GROUP BY a.registration';
    
               return DB::get_results($sql);
               DB::debug();
               return $ret;
    
           }
    
    }
    
    ?>

    and the tpl:

    <h1><?php echo SITE_NAME?> Fleet</h1>
    <table align="center"><tr><td>
    <?php 
    foreach ($fleet as $aircraft) 
    {
    ?>
    <div style="float: left;" align="right">
    ICAO :<br>
    Type :<br>
    Full Name:<br>
    Registration :<br>
    Range :<br>
    Empty Weight :<br>
    Cruise Alt :<br>
    Max Pax :<br>
    Max Cargo :<br>
    Total hours :<br>
    Total Routes flown :<br>
    current Airport :<br>
    current Country :<br>
    <br>
    Download :
    </div>
    <div style="float: left;">
    <?php echo $aircraft->icao; ?><br>
    <?php echo $aircraft->name; ?><br>
    <?php echo $aircraft->fullname; ?><br>
    <?php echo $aircraft->registration; ?><br>
    <?php echo $aircraft->range; ?><br>
    <?php echo $aircraft->weight; ?><br>
    <?php echo $aircraft->cruise; ?><br>
    <?php echo $aircraft->maxpax; ?><br>
    <?php echo $aircraft->maxcargo; ?><br>
    <?php echo $aircraft->totaltime; ?><br>
    <?php echo $aircraft->routesflown; ?><br>
    
    <?php $params = (array('a.registration'=>$aircraft->registration, 'p.accepted'=>PIREP_ACCEPTED));
    $pirep = PIREPData::findPIREPS($params);
    $current_location = $pirep[0]->arricao;
    $current_location2 = $pirep[0]->arrname;
    echo $current_location.'-'.$current_location2;
    ?>
    <?php $airport = OperationsData::getAirportInfo($pirep[0]->arricao); ?><br>
    <?php echo $airport->country; ?><br>
    <br>
    <a href="<?php echo $aircraft->downloadlink; ?>">Download!</a>
    </div>
    <div style="float: right;">
    <img src="<?php echo $aircraft->imagelink; ?>" height="97"
    width="160"></div>
    <br style="clear:both;">
    <br>
    <hr>
    <br>
    <?
    }
    ?>
    </td></tr></table>
    
    
    

    the error says:

    Warning: Invalid argument supplied for foreach() in /var/www/web97/html/phpvms/core/templates/fleet_table.tpl on line 4 

    Thanks for help!

    best regards,

    Markus

  8. Hi,

    with this one, I get an error on line 4 from the tpl file:

    $sql = 'SELECT a.*, a.name AS aircraft,
         COUNT(p.pirepid) AS routesflown,
         SUM(p.distance) AS distance,
         SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
         AVG(p.distance) AS averagedistance,
         AVG(p.flighttime) as averagetime
         FROM   '.TABLE_PREFIX.'aircraft a
         WHERE a.enabled = 1
         LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
         GROUP BY a.registration';
    
               return DB::get_results($sql);
               DB::debug();
               return $ret;

    Line 4 of the tpl is:

    foreach ($fleet as $aircraft) 

    any idea?

  9. And another question: The script shows all aircraft, also those who are marked as disabled. What do I need to change to see only active aircraft in the list?

    I think only the SQL query need to be adopted

    		public static function FleetInfo()
    	{
       $sql = 'SELECT a.*, a.name AS aircraft,
         COUNT(p.pirepid) AS routesflown,
         SUM(p.distance) AS distance,
         SEC_TO_TIME(SUM(p.flighttime*60*60)) AS totaltime,
         AVG(p.distance) AS averagedistance,
         AVG(p.flighttime) as averagetime
         FROM   '.TABLE_PREFIX.'aircraft a
         LEFT OUTER JOIN '.TABLE_PREFIX.'pireps p ON (p.aircraft = a.id)
         GROUP BY a.registration';
    
    		return DB::get_results($sql);
    		DB::debug();
    		return $ret;
    
    	}

    to include only enabled aircraft, but I didn't managed to get it working.

    Maybe some sql expert could help.

    thanks,

    Markus

  10. There is a skin that was released here on site that has that feature built in to it. I am thinking you could find it and adapt the code to your skin. ;) I tried it on another skin for the sake of just trying and it worked. I don't recall the name of the skin right now that had that feature. If I find it, I will come back and let you know.

    Hello,

    I have tried it now with the pikachoose script (http://pikachoose.com/download/)

    in the layout.tpl:

    <title><?php echo $page_title; ?></title>
    
    
    
    <link rel="stylesheet" media="all" type="text/css" href="<?php echo SITE_URL?>/lib/skins/crystal-II/styles.css" />
    	<script type="text/javascript" src="assets/js/jquery.js"></script>
    	<script type="text/javascript" src="assets/js/jquery.pikachoose.js"></script>
    	<script type="text/javascript" src="assets/js/jquery.jcarousel.min.js"></script>
    	<script language="javascript">
    		<!--
    		$(document).ready(
    			function (){
    				$("#pikame").PikaChoose();
    
    				$("#pikame").jcarousel({scroll:4,					
    					initCallback: function(carousel) 
    					{
    				        $(carousel.list).find('img').click(function() {
    				        	//console.log($(this).parents('.jcarousel-item').attr('jcarouselindex'));
    				            carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
    				        });
    				    }
    			    });
    
    			});
    
    		-->
    	</script>

    But it won't load the js script. Any idea? I have already made a index.html with the same script code

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    	<link type="text/css" href="styles.css" rel="stylesheet" />
    	<script type="text/javascript" src="assets/js/jquery.js"></script>
    	<script type="text/javascript" src="assets/js/jquery.pikachoose.js"></script>
    	<script type="text/javascript" src="assets/js/jquery.jcarousel.min.js"></script>
    	<script language="javascript">
    		<!--
    		$(document).ready(
    			function (){
    				$("#pikame").PikaChoose();
    
    				$("#pikame").jcarousel({scroll:4,					
    					initCallback: function(carousel) 
    					{
    				        $(carousel.list).find('img').click(function() {
    				        	//console.log($(this).parents('.jcarousel-item').attr('jcarouselindex'));
    				            carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
    				        });
    				    }
    			    });
    
    			});
    
    		-->
    	</script>
    
    
    </head>
    <body>
    <!-- not really needed, i'm using it to center the gallery. -->
    
    <div class="pikachoose">
    Basic example
    <ul id="pikame" class="jcarousel-skin-pika">
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/1.jpg"/></a><span>Thanks to <a href="http://web.cara-jo.net">Cara Jo</a> for the awesome new themes!</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/2.jpg"/></a><span>jCarousel is supported and integrated with PikaChoose!</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/3.jpg"/></a><span>Let me know at jeremy.m.fry@gmail.com if you find any bugs!</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/4.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/5.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/1.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/2.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/3.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/4.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/5.jpg"/></a><span>Caption</span></li>
    
    </ul>
    </div>
    
    </body>
    </html>
    

    the TPL:

    <div id="body">
    
    <div id="innerwrapper">
    
    <div class="pikachoose">
    Basic example
    <ul id="pikame" class="jcarousel-skin-pika">
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/1.jpg"/></a><span>Thanks to <a href="http://web.cara-jo.net">Cara Jo</a> for the awesome new themes!</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/2.jpg"/></a><span>jCarousel is supported and integrated with PikaChoose!</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/3.jpg"/></a><span>Let me know at jeremy.m.fry@gmail.com if you find any bugs!</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/4.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/5.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/1.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/2.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/3.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/4.jpg"/></a><span>Caption</span></li>
    	<li><a href="http://www.pikachoose.com"><img src="/Markus/phpvms/lib/skins/crystal-II/assets/5.jpg"/></a><span>Caption</span></li>
    
    </ul>
    
    
    </div>

    and the TPL won't load the js script.... I only see all pictures below each other and after all pictures the site is shown.

    thanks for your help.

  11. Hello,

    I have tried the following, but I dind't get it working:

    rotate.php:

    <?php
    
    /*
    DOWNLOADED FROM http://www.marcofolio.net/
    Check it out for more interesting scripts & downloads
    
    AUTOMATIC IMAGE ROTATOR
    Version 2.2 - December 4, 2003
    Copyright (c) 2002-2003 Dan P. Benjamin, Automatic, Ltd.
    All Rights Reserved.
    
    http://www.hiveware.com/imagerotator.php
    
    http://www.automaticlabs.com/
    
    
    DISCLAIMER
    Automatic, Ltd. makes no representations or warranties about
    the suitability of the software, either express or
    implied, including but not limited to the implied
    warranties of merchantability, fitness for a particular
    purpose, or non-infringement. Dan P. Benjamin and Automatic, Ltd.
    shall not be liable for any damages suffered by licensee
    as a result of using, modifying or distributing this
    software or its derivatives.
    
    
    ABOUT
    This PHP script will randomly select an image file from a
    folder of images on your webserver.  You can then link to it
    as you would any standard image file and you'll see a random
    image each time you reload.
    
    When you want to add or remove images from the rotation-pool,
    just add or remove them from the image rotation folder.
    
    
    VERSION CHANGES
    Version 1.0
    	- Release version
    
    Version 1.5
    	- Tweaked a few boring bugs
    
    Version 2.0
    	- Complete rewrite from the ground-up
    	- Made it clearer where to make modifications
    	- Made it easier to specify/change the rotation-folder
    	- Made it easier to specify/change supported image types
    	- Wrote better instructions and info (you're them reading now)
    	- Significant speed improvements
    	- More error checking
    	- Cleaner code (albeit more PHP-specific)
    	- Better/faster random number generation and file-type parsing
    	- Added a feature where the image to display can be specified
    	- Added a cool feature where, if an error occurs (such as no
    	  images being found in the specified folder) *and* you're
    	  lucky enough to have the GD libraries compiled into PHP on
    	  your webserver, we generate a replacement "error image" on
    	  the fly.
    
       Version 2.1
           - Updated a potential security flaw when value-matching
             filenames
    
       Version 2.2
           - Updated a few more potential security issues
           - Optimized the code a bit.
           - Expanded the doc for adding new mime/image types.
    
           Thanks to faithful ALA reader Justin Greer for
           lots of good tips and solid code contribution!
    
    
    INSTRUCTIONS
    1. Modify the $folder setting in the configuration section below.
    2. Add image types if needed (most users can ignore that part).
    3. Upload this file (rotate.php) to your webserver.  I recommend
       uploading it to the same folder as your images.
    4. Link to the file as you would any normal image file, like this:
    
    		<img src="http://example.com/rotate.php">
    
    5. You can also specify the image to display like this:
    
    		<img src="http://example.com/rotate.php?img=gorilla.jpg">
    
    	This would specify that an image named "gorilla.jpg" located
    	in the image-rotation folder should be displayed.
    
    That's it, you're done.
    
    */
    
    
    
    
    /* ------------------------- CONFIGURATION -----------------------
    
    
    Set $folder to the full path to the location of your images.
    For example: $folder = '/user/me/example.com/images/';
    If the rotate.php file will be in the same folder as your
    images then you should leave it set to $folder = '.';
    
    */
    
    
    $folder = '/var/www/web97/html/markus/phpvms/lib/skins/crystal-II/rotateimage/';
    
    
    /*	
    
    Most users can safely ignore this part.  If you're a programmer,
    keep reading, if not, you're done.  Go get some coffee.
    
       If you'd like to enable additional image types other than
    gif, jpg, and png, add a duplicate line to the section below
    for the new image type.
    
    Add the new file-type, single-quoted, inside brackets.
    
    Add the mime-type to be sent to the browser, also single-quoted,
    after the equal sign.
    
    For example:
    
    PDF Files:
    
    	$extList['pdf'] = 'application/pdf';
    
       CSS Files:
    
           $extList['css'] = 'text/css';
    
       You can even serve up random HTML files:
    
        $extList['html'] = 'text/html';
        $extList['htm'] = 'text/html';
    
       Just be sure your mime-type definition is correct!
    
    */
    
       $extList = array();
    $extList['gif'] = 'image/gif';
    $extList['jpg'] = 'image/jpeg';
    $extList['jpeg'] = 'image/jpeg';
    $extList['png'] = 'image/png';
    
    
    // You don't need to edit anything after this point.
    
    
    // --------------------- END CONFIGURATION -----------------------
    
    $img = null;
    
    if (substr($folder,-1) != '/') {
    $folder = $folder.'/';
    }
    
    if (isset($_GET['img'])) {
    $imageInfo = pathinfo($_GET['img']);
    if (
        isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
           file_exists( $folder.$imageInfo['basename'] )
       ) {
    	$img = $folder.$imageInfo['basename'];
    }
    } else {
    $fileList = array();
    $handle = opendir($folder);
    while ( false !== ( $file = readdir($handle) ) ) {
    	$file_info = pathinfo($file);
    	if (
    	    isset( $extList[ strtolower( $file_info['extension'] ) ] )
    	) {
    		$fileList[] = $file;
    	}
    }
    closedir($handle);
    
    if (count($fileList) > 0) {
    	$imageNumber = time() % count($fileList);
    	$img = $folder.$fileList[$imageNumber];
    }
    }
    
    if ($img!=null) {
    $imageInfo = pathinfo($img);
    $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
    header ($contentType);
    readfile($img);
    } else {
    if ( function_exists('imagecreate') ) {
    	header ("Content-type: image/png");
    	$im = @imagecreate (100, 100)
    	    or die ("Cannot initialize new GD image stream");
    	$background_color = imagecolorallocate ($im, 255, 255, 255);
    	$text_color = imagecolorallocate ($im, 0,0,0);
    	imagestring ($im, 2, 5, 5,  "IMAGE ERROR", $text_color);
    	imagepng ($im);
    	imagedestroy($im);
    }
    }
    
    ?>
    

    and in the css:

    #topBanner {
     background: url(rotateimage/rotate.php) no-repeat;
     width: 920px;
     height: 250px;
    }

    It will display only 1 picture and not the random ones.

    If I open the rotate.php via the webbrowser the rotation is working. But not when only opening / refreshing the website.

    Maybe some css/php programmer could assist us.

    thanks a lot,

  12. Hi guys,

    what do I have to edit if I want only the approved airports from the pireps to be shown?

    With this script you can see all airports that are in the DB stored.

    Hope someone can help me.

    Thanks,

    Mark

×
×
  • Create New...