Jump to content

ChartsData.class.php


ProAvia
 Share

Recommended Posts

  • Administrators

In the default phpVMS 5.5.2 (Simpilot version), there is a file in 'core/common' named 'ChartsData.class.php -  it's not in version 2.1.934. I see in that file a reference to -

#replacement functions for OFC charts - Google Charts API - simpilot
#load Google Chart Wrapper library (3rd party)
require CORE_LIB_PATH . '/gChart/gChart.php';

- at the top of the file. Is there something else I need to download/install for ChartsData.class.php to function? Seems this file provides a replacement for OFC (Open Flash Chart) functionality. What exactly does this file do and is it linked to specific default modules?

______________________________

My main reason for asking about this file is that on my version 2.1.934 site, I am using Airport Charts - by Vansers. That add-on module contains the exact same file name... ChartsData.class.php. The two files are nowhere near similar in content. I'd like to use the Airport Charts module in phpVMS 5.5.2 - AND any functions of the default chart as well. I don't think renaming a default file would be a good thing - as it would break stuff that I'm not even aware of.

Kyle hasn't updated Airport Charts since 10/2011. I can get the original to work in version phpVMS 5.5.2 using the normal methods found here for other modules. I saw in the Airport Charts thread that Kyle is fine with the module being modded for personal use. Maybe I need to mod the Airport Charts folders/files to 'NavCharts' from 'Charts'?  I suppose the best course of action is to use the new name of 'NavCharts' throughout the module to make it easier to keep track of the mod files (and rename the DB table to 'navcharts' also).

Edited by ProAvia
Link to comment
Share on other sites

Yeah, the charts data class here is mainly for the charts built in to phpVMS by default (used in the /index.php/profile/stats link and I think the admin panel) to replace the OFC charts in an earlier version. Now, you could just merge the two files but I have split them and updated them for you (haven't tested them) here so take a look and it should work out of the box.

If you are looking for charts from an API source (that can be read on say a hub page or something), then check this module out.

Edited by web541
Module merged with master branch
  • Like 1
Link to comment
Share on other sites

  • Administrators

Thanks! Yeah - I thought the default 5.5.2 file did something like that. On the main admin page, I don't get a chart. Nothing at /index.php/profile/stats either. Hence my question if I need to download anything else to make ChartsData.class.php work - see my first post.

I messed with it some before loading your update. And I was able to get it to load. But I took mine out and used yours instead, cause yours looked cleaner and adds a few changes not in the original files.

There is one small omission/error that was in the original files - and carried over into yours. admin/templates/charts/index.php, line 41

// Originally:
<a href="viewcharts?icao=<?php echo $airport->icao; ?>"><?php echo $airport->icao; ?></a>

// Change to:
<a href="chartsadmin/viewcharts?icao=<?php echo $airport->icao; ?>"><?php echo $airport->icao; ?></a>

//This will allow viewing the charts in the admin panel without the error of:
//The module "VIEWCHARTS" doesn't exist!

After changing that, it works great! If you'd like, maybe send a pull request to Kyle.

I'll look at the AirCharts module too and then decide which to offer - heck, maybe both. I do like the option of viewing from the schedule briefing page in AirCharts.

Thanks again!

Edited by ProAvia
  • Like 1
Link to comment
Share on other sites

3 hours ago, ProAvia said:

Thanks! Yeah - I thought the default 5.5.2 file did something like that. On the main admin page, I don't get a chart. Nothing at /index.php/profile/stats either. Hence my question if I need to download anything else to make ChartsData.class.php work - see my first post.

I messed with it some before loading your update. And I was able to get it to load. But I took mine out and used yours instead, cause yours looked cleaner and adds a few changes not in the original files.

There is one small omission/error that was in the original files - and carried over into yours. admin/templates/charts/index.php, line 41


// Originally:
<a href="viewcharts?icao=<?php echo $airport->icao; ?>"><?php echo $airport->icao; ?></a>

// Change to:
<a href="chartsadmin/viewcharts?icao=<?php echo $airport->icao; ?>"><?php echo $airport->icao; ?></a>

//This will allow viewing the charts in the admin panel without the error of:
//The module "VIEWCHARTS" doesn't exist!

After changing that, it works great! If you'd like, maybe send a pull request to Kyle.

I'll look at the AirCharts module too and then decide which to offer - heck, maybe both. I do like the option of viewing from the schedule briefing page in AirCharts.

Thanks again!

Yes now works good. Only i have to find the charts and add the links :D Thanks guys...

Link to comment
Share on other sites

4 hours ago, ProAvia said:

Thanks! Yeah - I thought the default 5.5.2 file did something like that. On the main admin page, I don't get a chart. Nothing at /index.php/profile/stats either. Hence my question if I need to download anything else to make ChartsData.class.php work - see my first post.

I messed with it some before loading your update. And I was able to get it to load. But I took mine out and used yours instead, cause yours looked cleaner and adds a few changes not in the original files.

There is one small omission/error that was in the original files - and carried over into yours. admin/templates/charts/index.php, line 41


// Originally:
<a href="viewcharts?icao=<?php echo $airport->icao; ?>"><?php echo $airport->icao; ?></a>

// Change to:
<a href="chartsadmin/viewcharts?icao=<?php echo $airport->icao; ?>"><?php echo $airport->icao; ?></a>

//This will allow viewing the charts in the admin panel without the error of:
//The module "VIEWCHARTS" doesn't exist!

After changing that, it works great! If you'd like, maybe send a pull request to Kyle.

I'll look at the AirCharts module too and then decide which to offer - heck, maybe both. I do like the option of viewing from the schedule briefing page in AirCharts.

Thanks again!

Thanks and fixed :P

Link to comment
Share on other sites

  • Administrators

Cool! Thank you to both you and Kyle.

So, in the admin panel - am I supposed to see a chart for the last 30 days? And on the My Stats page as well? I do have the default 5.5.2 ChartsData.class.php file in place, as well as the gchart/gchart.php.

Link to comment
Share on other sites

  • Administrators

Not showing any errors.

I'll have a look at those links at a later date. Right now, I need to finish the site update from 2.1.934 to 5.5.2 so I can change the live site over. Don't really need the charts right now - and have been doing without on the old live site too. This will give me something to do after the update.

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...