Jump to content
Kyle

vStatsCenter

Kyle

WARNING: This module is no longer supported from the developer as the developer is shifting their focus on phpVMS v4 Addons.

Message added by Kyle

Recommended Posts

TAV1702    909

I'll double check on that. I am postitive I only have it in one spot. I have been wrong before though. ;-)

  • Like 1

Share this post


Link to post
Share on other sites
MPECEO    5

I am getting this

Notice: The template file "/home/canadian/public_html//core/templates/vStatsCenter/index.tpl" doesn't exist in /home/canadian/public_html/core/classes/TemplateSet.class.php on line 248

Share this post


Link to post
Share on other sites
Kyle    400

You guys must download the correct template format.

If you are using phpVMS with templates that uses the .TPL extension, then this one will be correct for your installation -> https://github.com/Vansers/phpVMS_vStatsCenter/archive/tpl_version.zip

If your using with .PHP extension, then this will be correct as well -> https://github.com/Vansers/phpVMS_vStatsCenter/archive/php_version.zip

Cheers!

Share this post


Link to post
Share on other sites
Soundman9    0

Hi

I have installed this module and it pulls the figures great but its just in plain text format? the table does not show like in your pictures? any way to fix this?

Capture_zps096ste67.png

Thanks

Martin

Share this post


Link to post
Share on other sites
Taran    14

Hi

I have installed this module and it pulls the figures great but its just in plain text format? the table does not show like in your pictures? any way to fix this?

Capture_zps096ste67.png

Thanks

Martin

Kyle,

Thanks for making this module and distributing it. For those that are not getting a table to enclose their data, use <table width="100%" border="1px" align="center"> in your index.tpl where <table align="center" is.

There's 6 of these to change

  • Like 1

Share this post


Link to post
Share on other sites
Taran    14

When I go to the link it doesn't show the current month's stats until I click "View Month Stats" button. Anyway to have it automatically show the current month stats upon clicking the link to the page?

Share this post


Link to post
Share on other sites
natcret    0

Just got through installing the module to do some local testing and everything looks good. However, when i go to click on a pirep link or pilot link within the screen, I get the following error:

" Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'vStatsCenter' does not have a method '%3c' in C:\wamp\www\core\classes\MainController.class.php on line218"

I also get the same error when I install the script to live site:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'vStatsCenter' does not have a method '%3c' in/xxxx/xxxxx/xxxxxxxxx.org/phpvms/core/classes/MainController.class.php on line 218

The x's represent the entire url which seems really go back the initial root.

Any ideas?

Regards,

Nat

Share this post


Link to post
Share on other sites
Kyle    400

NEW VERSION!

I have updated this module to provide a cleaner URL. The file changes are listed here - GitHub Commit

- The URL to the module will be required to be updated.

<a href="<?php echo url('/vStatsCenter/index/'.date(n).'/'.date(Y)) ?>">vStatsCenter</a>

- Simply, download the new files, replace them, and update the URL!

Download Version 1.1

Share this post


Link to post
Share on other sites
LH154    0

Hi Guys,

i have a problem on the Lines

Warning: Missing argument 1 for vStatsCenter::index() in /home/stuttgar/public_html/core/modules/vStatsCenter/vStatsCenter.php on line 19

Warning: Missing argument 2 for vStatsCenter::index() in /home/stuttgar/public_html/core/modules/vStatsCenter/vStatsCenter.php on line 19

Notice: The template file "/home/stuttgar/public_html//core/templates/vStatsCenter/index.php.tpl" doesn't exist in /home/stuttgar/public_html/core/classes/TemplateSet.class.php on line 248

can anyone help me to script or finish?

 

greating Niko

Share this post


Link to post
Share on other sites
web541    50
4 hours ago, LH154 said:

Hi Guys,

i have a problem on the Lines

Warning: Missing argument 1 for vStatsCenter::index() in /home/stuttgar/public_html/core/modules/vStatsCenter/vStatsCenter.php on line 19

Warning: Missing argument 2 for vStatsCenter::index() in /home/stuttgar/public_html/core/modules/vStatsCenter/vStatsCenter.php on line 19

Notice: The template file "/home/stuttgar/public_html//core/templates/vStatsCenter/index.php.tpl" doesn't exist in /home/stuttgar/public_html/core/classes/TemplateSet.class.php on line 248

can anyone help me to script or finish?

 

greating Niko

The first two mean that you have to access the site via the url with the date parameters

BAD: http://siteurl.com/index.php/vStatsCenter

GOOD: http://siteurl.com/index.php/vStatsCenter/month/year

or via the code as suggested above in Kyle's post

 

<a href="<?php echo url('/vStatsCenter/index/'.date(n).'/'.date(Y)) ?>">vStatsCenter</a>

 

The second error means that you are using the wrong version of phpvms for this module, you should be using this version.

You can try to edit the module and rename files, but no guarantees it will work with your version.

Edited by web541

Share this post


Link to post
Share on other sites
LH154    0

Many thanks for all the info.

I am not sure if I should take the risk with the phpvms version installation.

Is there any way to customize the module to my version?

Share this post


Link to post
Share on other sites
web541    50

Haven't tested this

core/common/VStatsData.class.php
Add This

public function monthly_awards_vawards($month, $year) {
  $query = "SELECT l.*, UNIX_TIMESTAMP(l.grt_dategrant) as dateissued, p.*, e.*
  FROM `vawards_grants` l
  LEFT JOIN `vawards_awards` p ON p.awd_id = l.grt_awdid
  LEFT JOIN " . TABLE_PREFIX . "pilots e ON e.pilotid = l.grt_pilotid WHERE e.retired = 0 AND MONTH(l.grt_dategrant) = ".DB::escape($month)." AND YEAR(l.grt_dategrant) = ".DB::escape($year)."
  ORDER BY l.grt_dategrant ASC";

  $results = DB::get_results($query);
  return $results;
}


In core/modules/vStatsCenter/vStatsCenter.php
Find this
 

$this->set('awards', VAStatsData::monthly_awards($month, $year));

Replace it with this
 

$this->set('awards', VAStatsData::monthly_awards_vawards($month, $year));


In core/templates/vStatsCenter/index.php
Find this

<tr>
    <td align="center"><a href="<?php echo url('/profile/view/'.$awd->pilotid);?>"><?php echo PilotData::GetPilotCode($awd->code, $awd->pilotid);?></a></td>
    <td align="center"><?php echo $awd->firstname . ' ' . $awd->lastname; ?></td>
    <td align="center"><?php echo $awd->name;?></td>
    <td align="center"><?php echo date("F j, Y", $awd->dateissued); ?></td>
</tr>

Replace it with this
 

<tr>
    <td align="center"><a href="<?php echo url('/profile/view/'.$awd->pilotid);?>"><?php echo PilotData::GetPilotCode($awd->code, $awd->pilotid);?></a></td>
    <td align="center"><?php echo $awd->firstname . ' ' . $awd->lastname; ?></td>
    <td align="center"><?php echo $awd->awd_name; ?></td>
    <td align="center"><?php echo date("F j, Y", $awd->dateissued); ?></td>
</tr>


If it doesn't work, then play around with the sql query at the top here.

Edited by web541
  • Like 1

Share this post


Link to post
Share on other sites
natcret    0
On 12/16/2016 at 1:05 PM, Kyle said:

NEW VERSION!

I have updated this module to provide a cleaner URL. The file changes are listed here - GitHub Commit

- The URL to the module will be required to be updated.


<a href="<?php echo url('/vStatsCenter/index/'.date(n).'/'.date(Y)) ?>">vStatsCenter</a>

- Simply, download the new files, replace them, and update the URL!

Download Version 1.1

Keep getting the following error:

Deprecated: Non-static method VAStatsData::monthly_flight_stats() should not be called statically, assuming $this from incompatible context in phpvms\core\modules\vStatsCenter\vStatsCenter.php on line 36

 

 

Share this post


Link to post
Share on other sites
web541    50

Go to core/common/VStatsData.class.php

Replace all of

public function

with

public static function

and it should continue to work.

Share this post


Link to post
Share on other sites
natcret    0
5 hours ago, web541 said:

Go to core/common/VStatsData.class.php

Replace all of


public function

with


public static function

and it should continue to work.

Thanks!

Share this post


Link to post
Share on other sites
elfrost    2

I tried to get it working but now im getting 
I ve replaced public by public static and some minor thing read above ..


Fatal error: Using $this when not in object context in /core/modules/vStatsCenter/vStatsCenter.php on line 29

Edited by elfrost

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×