Jump to content

CedGauche

Members
  • Posts

    117
  • Joined

  • Last visited

Posts posted by CedGauche

  1. I want to switch my whole server envoriment to php 7.2, because there are some other business projects on the server which are vulnerable with php 5.6, because there will be no secuirty updates anymore. At the moment my va is the only webpage stopping my switching to 7.2.

     

    I am able to migrate the va to another server with one instance and php 5.6, but this could be wasted time, when I am able to port over the page to 7.2.

     

     

    The link from phovms lecgacy with 7.0 support seems to be down ;(

     

     

     

  2. Good morning from germany,

    I've created a new module with a form. But how can I get the form values as a variable into the DataClass query.  The module has these 3 files:

    TourenDataClass.php

    Touren.php

    touren.tpl

     

    queries without variables from the TourenDataClass.php are working in the touren.tpl.

     

    I'm quity new in php so I need advice ;)

     

  3. Hi,

    yesterday I've updated to PHP5.6, since this update we have problems with our live map. Sometimes it's working, sometimes not (without changing something).

    It seems to be a javascript issue, the error is:

    live_map.jpg

     

    I am usign phpvms classic, but also tried another acarsmap.js file (5.5), but this is also not working.

    Google API has been updated.

    When switching back to 5.4 the map is back again

  4. We have expenses to simulate a real airline, but since 2 month every expense is doubled without changing something. The doubled expandes came in the database at the beginning of the monnth.

    In the phpvms_expenselog the expanses are twice, so that me make a big loss and the end of the month.

    Is there an option to fix that?

  5. I have the same memory problems, so I disabeld the StatsData::UpdateTotalHours(); and the pirpep approval worked again!

    But Now I get this memory error when running the maintenance.php script or the reset hours function in the Admin menu. Is this a big problem?

    Or is there a way to reduce memory usage of the StatsData::UpdateTotalHours(); function?

    We have 13774 Pireps and a Memory Size of 128 MB.

    post-45014-0-90188000-1476613387_thumb.jpg

  6. Hi,

    the maintenance script is planed as a cronjob every day at 01:00 am and it worked for 2 years now.

    But I noticed, that the script stopped marking pilots as retired.

    Only when I manually start the script by entering the url in the navbar the pilots are inactive.

    Anybody can help?

  7. Hello,

    after marking an inactive pilot to active and saving the profile I get the following Message at the top of the Admin Menu.

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8339 bytes) in/var/www/web1112/html/va/core/classes/ezdb/ezdb_mysql.class.php on line 282

    I have also a cronjob which is cleaning the pireps table every month and no problems with memory issues until now. The DB is only 56 MB in size.

  8. <?php

    $string = "$pirep->log";

    if($string!=str_replace("a pitch angle of 2deg","",$string)) echo "<font color='red'>Pitch of 2 deg!</font> </br>";

    ?>

    But you get only a message, if the pitch angle was 2deg. If you want to have it for other values, you can copy it and change the angle of pitch here

    ("a pitch angle of 2deg",
  9. Hey,

    I had this idea some months ago: A virtual Stock market for pilots of your VA. The pilots can spend their money and all pilots are in a competition, who is the best trader (of the month, of the year...).

    You can add virtual stocks and they are randomly generated or you are able to use an API like Yahoo Finance to get real values. As an option you can add your own VA into the stock market and it depends on the flights and revenue if the share rises or fall.

    We can code this script together, but my knowledge in php is not the best. I can make the conent and the layout or design.

  10. Try removing the / from Template::show('/');

    class spiel4 extends CodonModule
    {
    public function index()
    {
    Template::Show('spiel4/poker.tpl');
    }
    public function pageone()
    {
    Template::Show('spiel4/card_results.tpl');
    }
    public function pagetwo()
    {
    Template::Show('spiel4/card_new_game.tpl');
    }
    }
    

    --> Just realised,try changing your form action to this in your case <?php echo SITE_URL; ?>/index.php/spiel4/page_one">

    Ok thx, that worked for me...but I think it's to complex to add external scripts or modules to phpvms.

    Now the error is:

    Fatal error: Cannot redeclare checkWinner() (previously declared in /var/www/web1112/html/va/core/templates/spiel4/card_results.tpl:59) in/var/www/web1112/html/va/core/templates/spiel4/card_results.tpl on line 95

    The code from card_results.tpl:

    session_start();

    <?php

    /* Poker Ranks

    1 = Royal Straight Flush

    2 = Straight Flush

    3 = 4 Of A Kind

    4 = Full House

    5 = Flush

    6 = Straight

    7 = 3 Of A Kind

    8 = 2 Pair

    9 = 1 Pair

    10 = High Card

    */

    /*

    displayCards() Results:

    1 = Win

    2 = Loss

    3 = Tie

    */

    if(isset($_POST['swap']) && $_SESSION['state'] == 1)

    {

    checkWinner();

    }

    elseif(isset($_POST['new_game']))

    {

    session_destroy();

    session_start();

    include "poker.tpl";

    }

    elseif(isset($_POST['stay']))

    {

    checkWinner();

    }

    else

    {

    include "card_new_game.tpl";

    }

    function checkWinner()

    {

    $_SESSION['state'] = 0;

    for($x=1; $x<6; $x++)

    {

    if(isset($_POST['chk_' . $x]))

    {

    $_SESSION['counter']++;

    $temp = explode('-', $_SESSION['deck'][9 + $_SESSION['counter']]);

    $_SESSION['player_cards'][$x-1] = $temp[0];

    $_SESSION['player_suits'][$x-1] = $temp[1];

    }

    }

    if(pokerRank($_SESSION['player_cards'], $_SESSION['player_suits']) > pokerRank($_SESSION['dealer_cards'], $_SESSION['dealer_suits']))

    {

    displayCards('1');

    }

    elseif(pokerRank($_SESSION['player_cards'], $_SESSION['player_suits']) == pokerRank($_SESSION['dealer_cards'], $_SESSION['dealer_suits']))

    {

    if(highestCard($_SESSION['player_cards']) > highestCard($_SESSION['dealer_cards']))

    {

    displayCards('1');

    }

    elseif(highestCard($_SESSION['player_cards']) == highestCard($_SESSION['dealer_cards']))

    {

    displayCards('3');

    }

    else

    {

    displayCards('2');

    }

    }

    else

    {

    displayCards('2');

    }

    }

    function displayCards($result)

    {

    switch($result)

    {

    case 1:

    $msg = "You have won...";

    break;

    case 2:

    $msg = "You have lost...";

    break;

    case 3:

    $msg = "A tie somehow...";

    break;

    }

    include "poker.tpl";

    }

    function highestCard($cards)

    {

    sort($cards);

    return $cards[0];

    }

    function pokerRank($cards, $suits)

    {

    //reassign some cards if needed by number to make it easier to check for straights.

    for($x=0; $x<count($cards); $x++)

    {

    switch ($cards[$x])

    {

    case "j":

    $cards[$x] = 11;

    break;

    case "q":

    $cards[$x] = 12;

    break;

    case "k":

    $cards[$x] = 13;

    break;

    case "a":

    $cards[$x] = 14;

    break;

    }

    }

    sort($cards);

    //check for one pair

    if ($cards[0] == $cards[1] || $cards[1] == $cards[2] || $cards[2] == $cards[3] || $cards[3] == $cards[4])

    $pokerRank = 9;

    //check for two pair

    if( ($cards[0] == $cards[1] && $cards[2] == $cards[3]) ||

    ($cards[0] == $cards[1] && $cards[3] == $cards[4]) ||

    ($cards[1] == $cards[2] && $cards[3] == $cards[4]))

    $pokerRank = 8;

    //check for 3 of a kind.

    if( ($cards[0] == $cards[1] && $cards[1] == $cards[2]) ||

    ($cards[1] == $cards[2] && $cards[2] == $cards[3]) ||

    ($cards[2] == $cards[3] && $cards[3] == $cards[4]))

    $pokerRank = 7;

    //check for straight

    if( ( $cards[0]+1 == $cards[1] && $cards[1]+1 == $cards[2] && $cards[2]+1 == $cards[3] && $cards[3]+1 == $cards[4]) ||

    ($cards[4] == "14" && $cards[0] == "2" && $cards[1] == "3" && $cards[2] == "4" && $cards[3] == "5") )

    $pokerRank = 6;

    //check for flush

    if($suits[0] == $suits[1] && $suits[0] == $suits[1] && $suits[0] == $suits[2] && $suits[0] == $suits[3] & $suits[0] == $suits[4])

    {

    //check for royal straight flush

    if($pokerRank == 6 && $cards[4] == 14)

    {

    $pokerRank = 1;

    }

    //check for a straight flush

    elseif($pokerRank == 6)

    {

    $pokerRank = 2;

    }

    else

    {

    $pokerRank = 5;

    }

    }

    //check for full house

    if( ($cards[0] == $cards[1] && $cards[0] == $cards[2] && $cards[3] == $cards[4]) ||

    ($cards[0] == $cards[1] && $cards[2] == $cards[3] && $cards[3] == $cards[4]) )

    $pokerRank = 4;

    //check for four of a kind

    if( ( $cards[0] == $cards[1] && $cards[1] == $cards[2] && $cards[2] = $cards[3]) ||

    ($cards[1] == $cards[2] && $cards[2] == $cards[3] && $cards[3] == $cards[4]) )

    $pokerRank = 3;

    return $pokerRank;

    }

    ?>

×
×
  • Create New...