Ejemplo n.º 1
0
if (isset($_GET['show'])) {
    $show = @$_GET['show'];
}
if (isset($_GET['importSections'])) {
    TB_importSections();
    TB_loadSections();
    save_array($TB_settings, ToolBox_settings);
}
if (isset($_GET['updateTempStats'])) {
    $update_tempStats = true;
}
//small checks to avoid problmes
if ($tempStats['itemName'] != $TB_settings['AM_ItemName']) {
    $update_tempStats = true;
}
if ($tempStats['countGiftsInGiftBox'] != TB_numberGiftBox()) {
    $update_tempStats = true;
    save_array($TB_settings, ToolBox_settings);
}
//update temp stats?
if ($update_tempStats) {
    TB_prepareTempStats($TB_settings['AM_ItemName']);
    $tempStats = TB_loadTempStats();
}
?>

<html>
<head>
<style type="text/css">
<?php 
include 'toolbox.css';
Ejemplo n.º 2
0
function TB_prepareTempStats($getItemName = '')
{
    global $TB_settings;
    if (isset($TB_settings['AM_ItemName'])) {
        $itemName = $TB_settings['AM_ItemName'];
    } elseif ($getItemName != '') {
        $itemName = $getItemName;
    } else {
        $itemName = '';
    }
    $settings = array();
    //MysteryGifts
    $settings['countGiftsGiftbox'] = MG_getGifts('giftbox');
    $tmp = MG_getEggs('giftbox');
    $settings['countEggsGiftbox'] = $tmp['count'];
    $settings['countGiftsFarm'] = count(MG_getGifts());
    $settings['countEggsFarm'] = count(MG_getEggs());
    $settings['countGiftsInGiftBox'] = TB_numberGiftBox();
    if ($TB_settings['TB_giftboxLimit'] <= 0) {
        $TB_settings['TB_giftboxLimit'] = 200;
    }
    $settings['maxGiftsToAdd'] = $TB_settings['TB_giftboxLimit'] - $settings['countGiftsInGiftBox'];
    //AnimalsMover
    $settings['itemName'] = $itemName;
    $settings['allAnimals'] = count(AM_getAnimals($itemName));
    $settings['movingAnimals'] = count(AM_getMovingAnimals($itemName));
    $settings['standingAnimals'] = $settings['allAnimals'] - $settings['movingAnimals'];
    $settings['directionAnimals0'] = count(AM_getDirectionAnimals(0, $itemName));
    $settings['directionAnimals1'] = count(AM_getDirectionAnimals(1, $itemName));
    $settings['directionAnimals2'] = count(AM_getDirectionAnimals(2, $itemName));
    $settings['directionAnimals3'] = count(AM_getDirectionAnimals(3, $itemName));
    save_array($settings, ToolBox_temp_stats);
}