Jump to content
CarlosEduardo2409

[Free] ElaSkin 2018 - Designed for phpVMS

Questions  

22 members have voted

  1. 1. Did you like ElaSkin?

    • Yes
      19
    • No
      3


Recommended Posts

Hi!

I am having a problem w/ ElaSkin

Fatal error: Call to undefined method StatsData::TotalPilotMiles() in /home/bosnaxxa/crew.bosnaxx-air.com/lib/skins/ela/profile_main.php on line 70

 

Share this post


Link to post
Share on other sites
31 minutes ago, Qshad said:

Hi!

I am having a problem w/ ElaSkin


Fatal error: Call to undefined method StatsData::TotalPilotMiles() in /home/bosnaxxa/crew.bosnaxx-air.com/lib/skins/ela/profile_main.php on line 70

 

Hello @Qshad!

You will need to add TotalPilotMiles to the StatsData.class.php file. For this you must do:

1. Go to core/common/StatsData.class.php

2. After opening StatsData.class.php file, add the following code:

public static function TotalPilotMiles($pilotid) {
  $key = 'total_miles';
  $key .= '_'.$pilotid;

  $total = CodonCache::read($key);

  if($total === false) {
  $total = 0;
  $sql = "SELECT * FROM ".TABLE_PREFIX."pireps WHERE pilotid='$pilotid' AND accepted=1";
  $results = DB::get_results($sql);
  if($results) { foreach($results as $result) { $total += $result->distance; } }

  CodonCache::write($key, $total, '15minute');
  }
  return $total;
}

 

Like this: https://prnt.sc/qo9ari

 

I hope it helped you!

Share this post


Link to post
Share on other sites
14 hours ago, CarlosEduardo2409 said:

Hello @Qshad!

You will need to add TotalPilotMiles to the StatsData.class.php file. For this you must do:

1. Go to core/common/StatsData.class.php

2. After opening StatsData.class.php file, add the following code:


public static function TotalPilotMiles($pilotid) {
  $key = 'total_miles';
  $key .= '_'.$pilotid;

  $total = CodonCache::read($key);

  if($total === false) {
  $total = 0;
  $sql = "SELECT * FROM ".TABLE_PREFIX."pireps WHERE pilotid='$pilotid' AND accepted=1";
  $results = DB::get_results($sql);
  if($results) { foreach($results as $result) { $total += $result->distance; } }

  CodonCache::write($key, $total, '15minute');
  }
  return $total;
}

 

Like this: https://prnt.sc/qo9ari

 

I hope it helped you!

Hey! Yes you helped me!

But unfortunately partly.

There is only a loading screen. Nothing is loading. Infinite Loading Screen.

Share this post


Link to post
Share on other sites
4 hours ago, Qshad said:

Hey! Yes you helped me!

But unfortunately partly.

There is only a loading screen. Nothing is loading. Infinite Loading Screen.

Make sure you have the AirMail and TouchdownStats modules correctly installed. If they are installed, hit Ctrl + U on your site dashboard and on the page that opened (which will be the code of your page), see if you have any errors.

 

I am knowing about the demo site, I will see if I can host a new site somewhere.

Share this post


Link to post
Share on other sites
On 6/11/2018 at 6:19 PM, CarlosEduardo2409 said:

Hi @stifler13371,

 

So for fix this you need to go core/common and open StatsData.class.php

After open, you need to paste this code:


<?php
public static function TotalPilotMiles($pilotid) {
        $key = 'total_miles';
        $key .= '_'.$pilotid;

        $total = CodonCache::read($key);

        if($total === false)
        {
            $total = 0;
            $sql = "SELECT * FROM ".TABLE_PREFIX."pireps WHERE pilotid='$pilotid' AND accepted=1";
            $results = DB::get_results($sql);
            if($results) { foreach($results as $result) { $total += $result->distance; } }

            CodonCache::write($key, $total, '15minute');
        }
        
        return $total;
    }

 

Sorry for not coding, nothing I'm finding the function.

tried that, but for me the page keeps the same 😞

Share this post


Link to post
Share on other sites
7 hours ago, Tummi said:

tried that, but for me the page keeps the same 😞

Did you install all modules correctly? You need Airmail and TouchdownStats installed to work. What error is showing up for you? You can see it by pressing the right button on your page and clicking "Inspect"

Share this post


Link to post
Share on other sites
3 hours ago, Tummi said:

hey i have no real error.. its just a page as shown:

 

http://prntscr.com/qprv7a

From what I see your error is because it is missing or has an error in TotalPilotMiles on StatsData.

First, to make sure you have no errors, go to your website and press Ctrl + U, it will open the view-source of your website, scroll down the page and see if there are any errors.

 

Attempt 1: To add TotalPilotMiles to StatsData:

  1. Go to core/common/StatsData.class.php
  2. At about line 21, add this code (make sure it is not inside another function).
<?php
public static function TotalPilotMiles($pilotid) {
  $key = 'total_miles';
  $key .= '_'.$pilotid;

  $total = CodonCache::read($key);

  if($total === false)
  {
    $total = 0;
    $sql = "SELECT * FROM ".TABLE_PREFIX."pireps WHERE pilotid='$pilotid' AND accepted=1";
    $results = DB::get_results($sql);
    if($results) { foreach($results as $result) { $total += $result->distance; } }

    CodonCache::write($key, $total, '15minute');
  }

  return $total;
}

 

Attempt 2: If you already have the code and don't have any errors showing, try changing your StatsData by the one below:

 

StatsData.class.php.zip

Share this post


Link to post
Share on other sites

Attempt 2 made it! thanks alot!

 

MAybe you have an idea about making a bid.. when i click "add to bid" the button is switching to "bid added" but in the list "my bids" nothing is in.. i searched the forum for this bug but nothing helped me with that...

Share this post


Link to post
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...

×
×
  • Create New...